zoukankan      html  css  js  c++  java
  • 修改难度标示

    --[[ Instance Difficulty icon
    MiniMapInstanceDifficulty:SetParent(Minimap)
    MiniMapInstanceDifficulty:ClearAllPoints()
    MiniMapInstanceDifficulty:SetPoint("TOPRIGHT", Minimap, "TOPRIGHT", 3, 2)
    MiniMapInstanceDifficulty:SetScale(0.75)]]
    MiniMapInstanceDifficulty:Hide() -- 隐藏难度图标
    MiniMapInstanceDifficulty.Show = function() return end
    
    --[[ Guild Instance Difficulty icon
    GuildInstanceDifficulty:SetParent(Minimap)
    GuildInstanceDifficulty:ClearAllPoints()
    GuildInstanceDifficulty:SetPoint("TOPRIGHT", Minimap, "TOPRIGHT", -2, 2)
    GuildInstanceDifficulty:SetScale(0.75)]]
    GuildInstanceDifficulty:Hide()    -- 隐藏难度图标
    GuildInstanceDifficulty.Show = function() return end
    
    --[[ Challenge Mode icon
    MiniMapChallengeMode:SetParent(Minimap)
    MiniMapChallengeMode:ClearAllPoints()
    MiniMapChallengeMode:SetPoint("TOPRIGHT", Minimap, "TOPRIGHT", -2, -2)
    MiniMapChallengeMode:SetScale(0.75)]]
    MiniMapChallengeMode:Hide()
    MiniMapChallengeMode.Show = function() return end
    
    -- 难度标示
    local function CreateFS(parent, size, justify)
        local f = parent:CreateFontString(nil, "OVERLAY")
        f:SetFont(C.font.filger_font, 15, "OUTLINE")
        f:SetShadowColor(0, 0, 0, 0)
        if(justify) then f:SetJustifyH(justify) end
        return f
    end
    
    local rd = CreateFrame("Frame", nil, Minimap)
    rd:SetSize(24, 8)
    --rd:SetScale(0.86)
    rd:SetPoint("TOPRIGHT", Minimap, "TOPRIGHT", -1, 1)
    rd:RegisterEvent("PLAYER_ENTERING_WORLD")
    rd:RegisterEvent("PLAYER_DIFFICULTY_CHANGED")
    rd:RegisterEvent("GUILD_PARTY_STATE_UPDATED")
    
    local rdt = CreateFS(rd, 10, "RIGHT")
    rdt:SetPoint("TOPRIGHT")
    
    rd:SetScript("OnEvent", function()
        local inInstance, instanceType = IsInInstance() 
        local _, _, difficulty, _, maxPlayers = GetInstanceInfo()
        
        if inInstance and instanceType == "raid" then
            if difficulty == 3 then
                rdt:SetText("10")
            elseif difficulty == 4 then
                rdt:SetText("25")
            elseif difficulty == 5 then
                rdt:SetText("10H")
            elseif difficulty == 6 then
                rdt:SetText("25H")
            elseif difficulty == 7 then
                rdt:SetText("L")
            elseif difficulty == 9 then
                rdt:SetText("40")
            end
        elseif inInstance and instanceType == "party" then
            if difficulty == 1 then
                rdt:SetText("5")
            elseif difficulty == 2 then
                rdt:SetText("5H")
            elseif GetChallengeMode() then
                rdt:SetText("C")
            end
        elseif inInstance and maxPlayers == 3 then
            rdt:SetText("N")
        else
            rdt:SetText("")
        end
        
        if GuildInstanceDifficulty:IsShown() then
            rdt:SetTextColor(0, .9, 0)
        else
            rdt:SetTextColor(1, 1, 1)
        end
    end)
  • 相关阅读:
    python的模块future用法实例解析
    strcmp函数和memcmp函数的用法区别及联系
    esp8266 smartconfig-智能配网分析和使用及注意事项
    ubuntu 18.04 安装并配置adb
    Markdown的常用方法总结
    mac下使用minicom几个注意事项
    最强Linux shell工具Oh My Zsh 指南
    ESP8266源码分析--打印的基本用法
    atom 在Ubuntu 18.04 上安装及基本使用
    ubuntu 查看端口被占用并删除端口
  • 原文地址:https://www.cnblogs.com/sakaras/p/2608705.html
Copyright © 2011-2022 走看看