Skip to content

Commit

Permalink
Merge pull request wind-addons#59 from fang2hou/beta
Browse files Browse the repository at this point in the history
1.4.0 Update
  • Loading branch information
fang2hou committed Mar 11, 2019
2 parents dfa8c8b + 3d5d353 commit a3bddd2
Show file tree
Hide file tree
Showing 14 changed files with 312 additions and 115 deletions.
17 changes: 12 additions & 5 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ L["Instance"] = true
L["Raid"] = true
L["Party"] = true
L["Solo"] = true
L["Ignore supplies quest"] = true
-- 已学配方染色
L["Already Known"] = true
L["Change item color if learned before."] = true
Expand Down Expand Up @@ -79,10 +80,16 @@ L["Blacklist"] = true
-- 进入战斗提示功能
L["Alert you after enter or leave combat."] = true
L["Enter Combat Alert"] = true
L["Use custom text"] = true
L["Custom text (Enter)"] = true
L["Custom text (Leave)"] = true
L["Default is 0.65"] = true
L["Style"] = true
L["Font"] = true
L["Font Outline"] = true
L["Use Backdrop"] = true
L["Stay Duration"] = true
L["Animation Duration (Fade In)"] = true
L["Custom Text"] = true
L["Custom Text (Enter)"] = true
L["Custom Text (Leave)"] = true
L["Default is 0.8"] = true
L["Enter Combat"] = true
L["Leave Combat"] = true
-- 右键菜单增强
Expand Down Expand Up @@ -196,7 +203,7 @@ L["Quest Icon"] = true
-- Tag 增强
L["Wan"] = true
L["Yi"] = true
L["Enhanced Tag"] = true
L["Enhanced Tags"] = true
L["Add some tags."] = true
L["Chinese W/Y"] = true
L["Example:"] = true
Expand Down
17 changes: 12 additions & 5 deletions Locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ L["Instance"] = "副本"
L["Raid"] = "团队副本"
L["Party"] = "队伍"
L["Solo"] = "单人"
L["Ignore supplies quest"] = "忽略补给品任务"
-- 已学配方染色
L["Already Known"] = "已学配方染色"
L["Change item color if learned before."] = "如果学习过了,那么商品会被上色。"
Expand Down Expand Up @@ -79,10 +80,16 @@ L["Blacklist"] = "黑名单"
-- 进入战斗提示功能
L["Alert you after enter or leave combat."] = "在进出战斗时提示信息"
L["Enter Combat Alert"] = "进出战斗提示"
L["Use custom text"] = "使用自定义文字"
L["Custom text (Enter)"] = "自定义文字(进入战斗)"
L["Custom text (Leave)"] = "自定义文字(离开战斗)"
L["Default is 0.65"] = "默认为 0.65"
L["Style"] = "风格"
L["Font"] = "字体"
L["Font Outline"] = "字体描边"
L["Use Backdrop"] = "使用背景"
L["Stay Duration"] = "停滞时间"
L["Animation Duration (Fade In)"] = "渐入动画时间"
L["Custom Text"] = "使用自定义文字"
L["Custom Text (Enter)"] = "自定义文字(进入战斗)"
L["Custom Text (Leave)"] = "自定义文字(离开战斗)"
L["Default is 0.8"] = "默认为 0.8"
L["Enter Combat"] = "进入战斗"
L["Leave Combat"] = "离开战斗"
-- 右键菜单增强
Expand Down Expand Up @@ -196,7 +203,7 @@ L["Quest Icon"] = "任务物品图标"
-- Tag 增强
L["Wan"] = ""
L["Yi"] = "亿"
L["Enhanced Tag"] = "Tag 增强"
L["Enhanced Tags"] = "Tag 增强"
L["Add some tags."] = "添加一些自定义 Tag。"
L["Chinese W/Y"] = "中文 万/亿 单位"
L["Example:"] = "范例:"
Expand Down
23 changes: 15 additions & 8 deletions Locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ L["Instance"] = "副本"
L["Raid"] = "團隊副本"
L["Party"] = "隊伍"
L["Solo"] = "個人"
L["Ignore supplies quest"] = "略過補給品任務"
-- 已学配方染色
L["Already Known"] = "已學配方上色"
L["Change item color if learned before."] = "如果學習過了,那麼商品會被上色。"
Expand Down Expand Up @@ -79,10 +80,16 @@ L["Blacklist"] = "黑名單"
-- 进入战斗提示功能
L["Alert you after enter or leave combat."] = "在進出戰鬥時彈出提示訊息"
L["Enter Combat Alert"] = "進出戰鬥提示"
L["Use custom text"] = "使用自定義文字"
L["Custom text (Enter)"] = "自定義文字(進入戰鬥)"
L["Custom text (Leave)"] = "自定義文字(離開戰鬥)"
L["Default is 0.65"] = "預設為 0.65"
L["Style"] = "風格"
L["Font"] = "字體"
L["Font Outline"] = "字體描邊"
L["Use Backdrop"] = "使用背景"
L["Stay Duration"] = "停滯時間"
L["Animation Duration (Fade In)"] = "漸入特效時間"
L["Custom Text"] = "自定義文字"
L["Custom Text (Enter)"] = "自定義文字(進入戰鬥)"
L["Custom Text (Leave)"] = "自定義文字(離開戰鬥)"
L["Default is 0.8"] = "預設為 0.8"
L["Enter Combat"] = "進入戰鬥"
L["Leave Combat"] = "離開戰鬥"
-- 右键菜单增强
Expand Down Expand Up @@ -196,7 +203,7 @@ L["Quest Icon"] = "任務物品圖標"
-- Tag 增强
L["Wan"] = ""
L["Yi"] = ""
L["Enhanced Tag"] = "Tag 增強"
L["Enhanced Tags"] = "Tag 增強"
L["Add some tags."] = "添加一些自定義 Tag。"
L["Chinese W/Y"] = "中文 萬/億 單位"
L["Example:"] = "範例:"
Expand Down Expand Up @@ -259,10 +266,10 @@ L["TheUnderrot"] = "幽腐深窟"
L["TolDagor"] = "托達戈爾"
L["WaycrestManor"] = "威奎斯特莊園"
L["Mythic+"] = "M+"
L["Mythic+(LEG&BFA)"] = "M+(LEG&BFA)"
L["Mythic+(LEG&BFA)"] = "M+ 軍團&決戰"
-- 跳过艾泽里特特质选择界面的渲染动画
L["Skip Azerite Animations"] = "跳過艾澤里特動畫"
L["Skips the reveal animation of a new azerite armor piece and the animation after you select a trait."] = "跳過艾澤里特特質選擇界面的新護甲揭示動畫和特質選擇動畫"
L["Skips the reveal animation of a new azerite armor piece and the animation after you select a trait."] = "跳過艾澤萊晶岩之力選擇界面中的新護甲揭示特效和下一圈特效。"
-- 频道切换
L["Tab Chat Mod"] = "Tab 切換頻道"
L["Use tab to switch channel."] = "可以使用 Tab 來快速切換頻道。"
Expand Down Expand Up @@ -326,6 +333,6 @@ L["Show traits for your current specialization only"] = "僅顯示當前專精"
L["Compact Mode"] = "緊湊模式"
L["Only icons"] = "僅顯示圖標,無艾澤萊晶岩之力名字提示"
L["Bag icon"] = "背包角標"
L["Show selected traits in bags (works only with Blizzard Bags and Bagnon)"] = "在背包中提示選中的特質(只在使用暴雪背包和Bagnon時會生效)"
L["Show selected traits in bags (works only with Blizzard Bags and Bagnon)"] = "在背包中提示選中的特質(只在使用暴雪背包和 Bagnon 時會生效)"
L["Character panel icon"] = "人物面板角標"
L["Show selected traits in Character Frame"] = "在人物面板中提示選中的特質"
24 changes: 21 additions & 3 deletions Modules/Interface/EnhancedTooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,24 @@ local playerGUID = UnitGUID("player")
local playerFaction = UnitFactionGroup("player")
local progressCache = {}

local function getLevelColorString(level, short)
local color = "ff8000"

if level == "Mythic" then
color = "a335ee"
elseif level == "Heroic" then
color = "0070dd"
elseif level == "Normal" then
color = "1eff00"
end

if short then
return "|cff"..color..string.sub(level, 1, 1).."|r"
else
return "|cff"..color..L[level].."|r"
end
end

function ETT:UpdateProgression(guid, faction)
local statFunc = guid == playerGUID and GetStatistic or GetComparisonStatistic

Expand Down Expand Up @@ -161,7 +179,7 @@ function ETT:SetProgressionInfo(guid, tt)
if (leftTipText:find(L[tier]) and leftTipText:find(L[level])) then
-- update found tooltip text line
local rightTip = _G["GameTooltipTextRight"..i]
leftTip:SetText(("%s [%s]:"):format(L[tier], L[level]))
leftTip:SetText(("%s %s:"):format(L[tier], getLevelColorString(level, false)))
rightTip:SetText(progressCache[guid].info["Raid"][tier][level])
updated = true
found = true
Expand All @@ -180,7 +198,7 @@ function ETT:SetProgressionInfo(guid, tt)
-- update found tooltip text line
local rightTip = _G["GameTooltipTextRight"..i]
leftTip:SetText(L[dungeon]..":")
rightTip:SetText(progressCache[guid].info["Dungeon"][k][dungeon])
rightTip:SetText(getLevelColorString(level, true)..progressCache[guid].info["Dungeon"][k][dungeon])
updated = true
found = true
break
Expand All @@ -201,7 +219,7 @@ function ETT:SetProgressionInfo(guid, tt)
if self.db["Progression"]["Raid"][tier] then
for _,level in ipairs(self.RP.levels) do
if (progressCache[guid].info["Raid"][tier][level]) then
tt:AddDoubleLine(("%s [%s]:"):format(L[tier], L[level]), progressCache[guid].info["Raid"][tier][level], nil, nil, nil, 1, 1, 1)
tt:AddDoubleLine(("%s %s:"):format(L[tier], getLevelColorString(level, false)), getLevelColorString(level, true).." "..progressCache[guid].info["Raid"][tier][level], nil, nil, nil, 1, 1, 1)
end
end
end
Expand Down
23 changes: 13 additions & 10 deletions Modules/Interface/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -768,60 +768,63 @@ WT.ToolConfigs["Interface"] = {
["Enhanced Tooltip"] = {
tDesc = L["Useful tooltip tweaks."],
oAuthor = "Nick Bockmeulen, houshuu",
cAuthor = "houshuu, SomeBlu",
["raidsetting"] = {
cAuthor = "SomeBlu",
["progression"] = {
order = 5,
name = L["Progression"],
desc = L["Add progression info to tooltip."],
get = function(info) return E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"][info[#info]] end,
set = function(info, value) E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"][info[#info]] = value; E:StaticPopup_Show("PRIVATE_RL") end,
args = {
["Dungeon"] = {
["enabled"] = {
order = 1,
name = L["Enable"],
},
["Dungeon"] = {
order = 2,
name = L["Dungeon"],
get = function(info) return E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Dungeon"][info[#info]] end,
set = function(info, value) E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Dungeon"][info[#info]] = value; E:StaticPopup_Show("PRIVATE_RL") end,
disabled = function() return not E.db.WindTools["Interface"]["Enhanced Tooltip"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Dungeon"]["enabled"] end,
args = {
["enabled"] = {
order = 1,
name = L["Enable"],
disabled = function() return not E.db.WindTools["Interface"]["Enhanced Tooltip"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["enabled"] end,
},
["MythicDungeon"] = {
order = 2,
name = L["MythicDungeon"],
disabled = function() return not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Dungeon"]["enabled"] end,
},
["Mythic+"] = {
order = 3,
name = L["Mythic+"],
disabled = function() return not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Dungeon"]["enabled"] end,
},
}
},
["Raid"] = {
order = 2,
order = 3,
name = L["Raid"],
get = function(info) return E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Raid"][info[#info]] end,
set = function(info, value) E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Raid"][info[#info]] = value; E:StaticPopup_Show("PRIVATE_RL") end,
disabled = function() return not E.db.WindTools["Interface"]["Enhanced Tooltip"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Raid"]["enabled"] end,
args = {
["enabled"] = {
order = 1,
name = L["Enable"],
disabled = function() return not E.db.WindTools["Interface"]["Enhanced Tooltip"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["enabled"] end,
},
["Uldir"] = {
order = 2,
name = L["Uldir"],
disabled = function() return not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Raid"]["enabled"] end,
},
["BattleOfDazaralor"] = {
order = 3,
name = L["BattleOfDazaralor"],
disabled = function() return not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Raid"]["enabled"] end,
},
["CrucibleOfStorms"] = {
order = 3,
order = 4,
name = L["CrucibleOfStorms"],
disabled = function() return not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["enabled"] or not E.db.WindTools["Interface"]["Enhanced Tooltip"]["Progression"]["Raid"]["enabled"] end,
},
}
}
Expand Down
4 changes: 4 additions & 0 deletions Modules/More/AnnounceSystem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ local FeastSpells = {
[259409] = true, -- 海帆盛宴
[259410] = true, -- 船长盛宴佳肴
[276972] = true, -- 秘法药锅
[286050] = true, -- 血潤盛宴
}

local Bots = {
Expand Down Expand Up @@ -335,6 +336,9 @@ function AnnounceSystem:RaidUsefulSpells()
-- 修理機器人
if Bots[spellID] then
SendChatMessage(format(ASL["PutNormal"], srcName, GetSpellLink(spellID)), CheckChat(true))
-- 凱蒂的郵哨
elseif spellID == 261602 then
SendChatMessage(format(ASL["PutNormal"], srcName, GetSpellLink(spellID)), CheckChat(true))
end
elseif subEvent == "SPELL_CREATE" then
-- MOLL-E 郵箱
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function E:ShortValue(v)
return format("%s", v)
end
elseif E.db.general.numberPrefixStyle == "CHINESE" then
if E.db.WindTools["More Tools"]["Enhanced Tag"]["enabled"] then
if E.db.WindTools["More Tools"]["Enhanced Tags"]["enabled"] then
if abs(v) >= 1e8 then
return format(shortValueDec..L["Yi"], v / 1e8)
elseif abs(v) >= 1e4 then
Expand Down
66 changes: 47 additions & 19 deletions Modules/More/EnterCombatAlert.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
-- 主要修改条目:
-- 模块化
-- 增加自定义文字设定项
-- 增加文字风格设置
-- 增加背景设置
-- 改进动画效果
-- 支持 ElvUI 移动

local E, L, V, P, G = unpack(ElvUI)
local LSM = LibStub("LibSharedMedia-3.0")
local WT = E:GetModule("WindTools")
local EnterCombatAlert = E:NewModule('Wind_EnterCombatAlert');

Expand All @@ -17,50 +22,73 @@ function EnterCombatAlert:Initialize()
local enterCombat = L["Enter Combat"]
local leaveCombat = L["Leave Combat"]

if self.db.custom_text then
-- Load custom text
if self.db.custom_text.enabled then
enterCombat = self.db.custom_text_enter
leaveCombat = self.db.custom_text_leave
end

-- Cache color setting
local color_enter = self.db.style.font_color_enter
local color_leave = self.db.style.font_color_leave

-- Create frame
local alertFrame = CreateFrame("Frame", "alertFrame", UIParent)
alertFrame:SetClampedToScreen(true)
alertFrame:SetSize(300, 65)
alertFrame:SetPoint("TOP", 0, -280)
alertFrame:SetScale(self.db.scale)
alertFrame:SetScale(self.db.style.scale)
alertFrame:Hide()
alertFrame.Bg = alertFrame:CreateTexture(nil, "BACKGROUND")
alertFrame.Bg:SetTexture("Interface\\LevelUp\\MinorTalents")
alertFrame.Bg:SetPoint("TOP")
alertFrame.Bg:SetSize(400, 60)
alertFrame.Bg:SetTexCoord(0, 400/512, 341/512, 407/512)
alertFrame.Bg:SetVertexColor(1, 1, 1, 0.4)
alertFrame.text = alertFrame:CreateFontString(nil, "ARTWORK", "GameFont_Gigantic")

-- Use backdrop
if self.db.style.use_backdrop then
alertFrame.Bg = alertFrame:CreateTexture(nil, "BACKGROUND")
alertFrame.Bg:SetTexture("Interface\\LevelUp\\MinorTalents")
alertFrame.Bg:SetPoint("TOP")
alertFrame.Bg:SetSize(400, 60)
alertFrame.Bg:SetTexCoord(0, 400/512, 341/512, 407/512)
alertFrame.Bg:SetVertexColor(1, 1, 1, 0.4)
end

-- Set text
alertFrame.text = alertFrame:CreateFontString(nil)
alertFrame.text:SetFont(LSM:Fetch('font', self.db.style.font_name), self.db.style.font_size, self.db.style.font_flag)
alertFrame.text:SetPoint("CENTER", 0, -1)

-- Animation
local stay_duration = self.db.style.stay_duration
local animation_duration = self.db.style.animation_duration
local total_time = stay_duration + animation_duration*2

alertFrame:SetScript("OnShow", function(self)
self.timer = 0
end)
alertFrame:SetScript("OnUpdate", function(self, elapsed)
self.timer = self.timer + elapsed
if (self.timer > self.totalTime) then self:Hide() end
if (self.timer <= 0.5) then
if (self.timer > total_time) then self:Hide() end
if (self.timer <= animation_duration) then
self:SetAlpha(self.timer * 2)
elseif (self.timer > 2) then
self:SetAlpha(1 - (self.timer - 2) /(self.totalTime - 2))
elseif (self.timer > (animation_duration+stay_duration)) then
self:SetAlpha(2-(self.timer-stay_duration)/animation_duration)
end
end)
alertFrame:SetScript("OnShow", function(self)
self.totalTime = 2.5
self.timer = 0
end)

-- Change text
alertFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
alertFrame:RegisterEvent("PLAYER_REGEN_DISABLED")
alertFrame:SetScript("OnEvent", function(self, event, ...)
self:Hide()
if (event == "PLAYER_REGEN_DISABLED") then
self.text:SetText(enterCombat)
self.text:SetTextColor(color_enter.r,color_enter.g,color_enter.b,color_enter.a)
elseif (event == "PLAYER_REGEN_ENABLED") then
self.text:SetText(leaveCombat)
self.text:SetTextColor(color_leave.r,color_leave.g,color_leave.b,color_leave.a)
end
self:Show()
end)
alertFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
alertFrame:RegisterEvent("PLAYER_REGEN_DISABLED")

-- Create ElvUI mover
E:CreateMover(alertFrame, "alertFrameMover", L["Enter Combat Alert"], nil, nil, nil, "ALL", function() return E.db.WindTools["Interface"]["Enter Combat Alert"].enabled; end)
end

Expand Down
Loading

0 comments on commit a3bddd2

Please sign in to comment.