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)
  • 相关阅读:
    java8--- Optional使用
    java8--- (Function、Predicate、Consumer) 通用函数式接口
    java8--- Predicate 意义 代码
    Java8---函数式编程-示例
    java8-----lambda语法
    java8----Predicate接口的使用
    Windows 下安装 ElasticSearch 修改 elasticsearch.yml的坑
    kafka 安装教程
    list 转 map java8
    数组转字符串 java8
  • 原文地址:https://www.cnblogs.com/sakaras/p/2608705.html
Copyright © 2011-2022 走看看