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)
  • 相关阅读:
    使用Layui上传图片,并进行压缩(非原创,证实可用)
    mysql 存储过程及事件
    Redis一些简单的笔记
    RIOT 技术笔记-01 RIOT介绍
    杂七杂八-ubuntu安装eclipse
    杂七杂八-sqlyog连接mysql错误码2058
    杂七杂八-Mysql8.0忘记root密码
    RIOT学习笔记-01 cygwin安装
    Ubutun-安装远程桌面
    中间件-RocketMQ 02 Docker下的安装
  • 原文地址:https://www.cnblogs.com/sakaras/p/2608705.html
Copyright © 2011-2022 走看看