update, QuestWatchFrame addition and cleanup

This commit is contained in:
Crum
2018-01-03 22:14:39 -06:00
parent 5739eccbe3
commit de36d33f0a
6 changed files with 144 additions and 49 deletions
+13 -13
View File
@@ -812,7 +812,7 @@ function E:UpdateAll(ignoreInstall)
self:SetMoversPositions()
self:UpdateMedia()
-- self:UpdateCooldownSettings()
self:UpdateCooldownSettings()
local UF = self:GetModule("UnitFrames")
UF.db = self.db.unitframe
@@ -833,7 +833,7 @@ function E:UpdateAll(ignoreInstall)
bags.db = self.db.bags
bags:Layout()
bags:Layout(true)
-- bags:SizeAndPositionBagBar()
bags:SizeAndPositionBagBar()
bags:UpdateItemLevelDisplay()
bags:UpdateCountDisplay()
@@ -843,9 +843,9 @@ function E:UpdateAll(ignoreInstall)
DT.db = self.db.datatexts
DT:LoadDataTexts()
--local NP = self:GetModule("NamePlates")
--NP.db = self.db.nameplates
--NP:ConfigureAll()
local NP = self:GetModule("NamePlates")
NP.db = self.db.nameplates
NP:ConfigureAll()
local DataBars = self:GetModule("DataBars")
DataBars.db = E.db.databars
@@ -853,16 +853,16 @@ function E:UpdateAll(ignoreInstall)
DataBars:EnableDisable_ExperienceBar()
DataBars:EnableDisable_ReputationBar()
--self:GetModule("Auras").db = self.db.auras
self:GetModule("Auras").db = self.db.auras
self:GetModule("Tooltip").db = self.db.tooltip
--if(ElvUIPlayerBuffs) then
-- E:GetModule("Auras"):UpdateHeader(ElvUIPlayerBuffs)
--end
if(ElvUIPlayerBuffs) then
E:GetModule("Auras"):UpdateHeader(ElvUIPlayerBuffs)
end
--if(ElvUIPlayerDebuffs) then
-- E:GetModule("Auras"):UpdateHeader(ElvUIPlayerDebuffs)
--end
if(ElvUIPlayerDebuffs) then
E:GetModule("Auras"):UpdateHeader(ElvUIPlayerDebuffs)
end
if not (self.private.install_complete or ignoreInstall) then
self:Install()
@@ -883,7 +883,7 @@ function E:UpdateAll(ignoreInstall)
LO:TopPanelVisibility()
LO:SetDataPanelStyle()
--self:GetModule("Blizzard"):SetWatchFrameHeight()
self:GetModule("Blizzard"):SetWatchFrameHeight()
end
function E:ResetAllUI()
+1 -1
View File
@@ -82,7 +82,7 @@ function E:UpdateBlizzardFonts()
-- SetFont(GameTooltipText, NORMAL, self.db.general.fontSize);
-- SetFont(GameTooltipTextSmall, NORMAL, self.db.general.fontSize);
-- SetFont(GameTooltipHeaderText, NORMAL, self.db.general.fontSize);
-- SetFont(WorldMapTextFont, NORMAL, self.db.general.fontSize);
SetFont(WorldMapTextFont, NORMAL, 32, MONOCHROME .. "OUTLINE");
SetFont(InvoiceTextFontNormal, NORMAL, self.db.general.fontSize);
SetFont(InvoiceTextFontSmall, NORMAL, self.db.general.fontSize);
SetFont(CombatTextFont, COMBAT, 25, MONOCHROME .. "OUTLINE");
+3 -35
View File
@@ -22,9 +22,6 @@ local GetContainerItemInfo = GetContainerItemInfo
local GetContainerItemLink = GetContainerItemLink
local GetContainerNumFreeSlots = GetContainerNumFreeSlots
local GetContainerNumSlots = GetContainerNumSlots
local GetCurrentGuildBankTab = GetCurrentGuildBankTab
local GetGuildBankItemLink = GetGuildBankItemLink
local GetGuildBankTabInfo = GetGuildBankTabInfo
local GetItemInfo = GetItemInfo
local GetItemQualityColor = GetItemQualityColor
local GetKeyRingSize = GetKeyRingSize
@@ -143,7 +140,6 @@ function B:UpdateSearch()
SEARCH_STRING = searchString
B:SetSearch(SEARCH_STRING)
B:SetGuildBankSearch(SEARCH_STRING)
end
function B:OpenEditbox()
@@ -197,34 +193,6 @@ function B:SetSearch(query)
end
end
function B:SetGuildBankSearch(query)
local empty = len(gsub(query, " ", "")) == 0
if GuildBankFrame and GuildBankFrame:IsShown() then
local tab = GetCurrentGuildBankTab()
local _, _, isViewable = GetGuildBankTabInfo(tab)
if isViewable then
for slotID = 1, MAX_GUILDBANK_SLOTS_PER_TAB do
local link = GetGuildBankItemLink(tab, slotID)
--A column goes from 1-14, e.g. GuildBankColumn1Button14 (slotID 14) or GuildBankColumn2Button3 (slotID 17)
local col = ceil(slotID / 14)
local btn = mod(slotID, 14)
if col == 0 then col = 1 end
if btn == 0 then btn = 14 end
local button = _G["GuildBankColumn"..col.."Button"..btn]
local success, result = pcall(Search.Matches, Search, link, query)
if(empty or (success and result)) then
SetItemButtonDesaturated(button)
button:SetAlpha(1)
else
SetItemButtonDesaturated(button, 1)
button:SetAlpha(0.4)
end
end
end
end
end
function B:UpdateItemLevelDisplay()
if(E.private.bags.enable ~= true) then return end
for _, bagFrame in pairs(self.BagFrames) do
@@ -723,8 +691,8 @@ function B:OnEvent()
end
function B:UpdateGoldText()
-- self.BagFrame.goldText:SetText(E:FormatMoney(GetMoney(), E.db["bags"].moneyFormat, not E.db["bags"].moneyCoins))
self.BagFrame.goldText:SetText(E:FormatMoney(GetMoney(), "SMART", true))
self.BagFrame.goldText:SetText(E:FormatMoney(GetMoney(), E.db["bags"].moneyFormat, not E.db["bags"].moneyCoins))
-- self.BagFrame.goldText:SetText(E:FormatMoney(GetMoney(), "SMART", true))
end
function B:GetGraysValue()
@@ -1239,7 +1207,7 @@ function B:Initialize()
BagFrameHolder:SetPoint("BOTTOMRIGHT", RightChatPanel, "BOTTOMRIGHT", -(E.Border*2), 22 + E.Border*4 - E.Spacing*2)
E:CreateMover(BagFrameHolder, "ElvUIBagMover", L["Bag Mover"], nil, nil, B.PostBagMove)
self:SecureHook("UpdateContainerFrameAnchors")
-- self:SecureHook("UpdateContainerFrameAnchors")
return
end
@@ -0,0 +1,81 @@
local E, L, V, P, G = unpack(ElvUI)
local B = E:NewModule("Blizzard", "AceEvent-3.0", "AceHook-3.0")
local GetNumQuestChoices = GetNumQuestChoices
local GetNumQuestLogChoices = GetNumQuestLogChoices
local GetQuestLogRewardHonor = GetQuestLogRewardHonor
local GetQuestLogRewardMoney = GetQuestLogRewardMoney
local GetQuestLogRewardSpell = GetQuestLogRewardSpell
local GetRewardHonor = GetRewardHonor
local GetRewardMoney = GetRewardMoney
local GetRewardSpell = GetRewardSpell
E.Blizzard = B
function B:Initialize()
-- self:AlertMovers()
-- self:EnhanceColorPicker()
-- self:KillBlizzard()
-- self:PositionCaptureBar()
-- self:PositionDurabilityFrame()
-- self:PositionGMFrames()
self:MoveWatchFrame()
--[[self:RawHook("CombatConfig_Colorize_Update", function()
if not CHATCONFIG_SELECTED_FILTER_SETTINGS then return end
self.hooks.CombatConfig_Colorize_Update()
end, true)
hooksecurefunc("QuestFrameItems_Update", function(questState)
local spacerFrame, money, honor, numQuestRewards, numQuestChoices, numQuestSpellRewards
if questState == "QuestLog" then
spacerFrame = QuestLogSpacerFrame
money, honor, numQuestRewards, numQuestChoices, numQuestSpellRewards = GetQuestLogRewardMoney(), GetQuestLogRewardHonor(), GetNumQuestLogRewards(), GetNumQuestLogChoices(), GetQuestLogRewardSpell()
else
spacerFrame = QuestSpacerFrame
money, honor, numQuestRewards, numQuestChoices, numQuestSpellRewards = GetRewardMoney(), GetRewardHonor(), GetNumQuestRewards(), GetNumQuestChoices(), GetRewardSpell()
end
if money == 0 and honor > 0 and (numQuestRewards > 0 or numQuestChoices > 0 or numQuestSpellRewards) then
numQuestSpellRewards = numQuestSpellRewards and 1 or 0
local rewardsCount = numQuestRewards + numQuestChoices + numQuestSpellRewards
local honorFrame = _G[questState.."HonorFrame"]
if numQuestRewards > 0 then
honorFrame:ClearAllPoints()
honorFrame:SetPoint("TOPLEFT", questState.."Item"..rewardsCount, "BOTTOMLEFT", 3, 0)
QuestFrame_SetAsLastShown(questState.."HonorFrame", spacerFrame)
else
local questItemReceiveText = _G[questState.."ItemReceiveText"]
honorFrame:ClearAllPoints()
honorFrame:SetPoint("TOPLEFT", questItemReceiveText, "BOTTOMLEFT", 0, -5)
if numQuestSpellRewards > 0 then
questItemReceiveText:SetText(REWARD_ITEMS)
questItemReceiveText:SetPoint("TOPLEFT", questState.."Item"..rewardsCount, "BOTTOMLEFT", 3, 15)
elseif numQuestChoices > 0 then
questItemReceiveText:SetText(REWARD_ITEMS)
local index = numQuestChoices
if mod(index, 2) == 0 then
index = index - 1
end
questItemReceiveText:SetPoint("TOPLEFT", questState.."Item"..index, "BOTTOMLEFT", 3, 15)
else
questItemReceiveText:SetText(REWARD_ITEMS_ONLY)
questItemReceiveText:SetPoint("TOPLEFT", questState.."RewardTitleText", "BOTTOMLEFT", 3, 15)
end
QuestFrame_SetAsLastShown(questItemReceiveText, spacerFrame)
end
end
end)--]]
end
local function InitializeCallback()
B:Initialize()
end
E:RegisterModule(B:GetName(), InitializeCallback)
@@ -0,0 +1,4 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Blizzard.lua"/>
<Script file="WatchFrame.lua"/>
</Ui>
@@ -0,0 +1,42 @@
local E, L, DF = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local B = E:GetModule("Blizzard");
--Cache global variables
--Lua functions
local min = math.min
--WoW API / Variables
local hooksecurefunc = hooksecurefunc
local GetScreenWidth = GetScreenWidth
local GetScreenHeight = GetScreenHeight
local WatchFrameHolder = CreateFrame("Frame", "WatchFrameHolder", E.UIParent)
WatchFrameHolder:SetWidth(150)
WatchFrameHolder:SetHeight(22)
WatchFrameHolder:SetPoint("TOPRIGHT", E.UIParent, "TOPRIGHT", -135, -300)
function B:SetWatchFrameHeight()
local top = QuestWatchFrame:GetTop() or 0
local screenHeight = GetScreenHeight()
local gapFromTop = screenHeight - top
local maxHeight = screenHeight - gapFromTop
local watchFrameHeight = min(maxHeight, E.db.general.watchFrameHeight)
QuestWatchFrame:SetHeight(watchFrameHeight)
end
function B:MoveWatchFrame()
E:CreateMover(WatchFrameHolder, "WatchFrameMover", L["Watch Frame"])
WatchFrameHolder:SetAllPoints(WatchFrameMover)
QuestWatchFrame:ClearAllPoints()
QuestWatchFrame:SetPoint("TOP", WatchFrameHolder, "TOP")
B:SetWatchFrameHeight()
QuestWatchFrame:SetClampedToScreen(false)
hooksecurefunc(QuestWatchFrame, "SetPoint", function(_, _, parent)
if parent ~= WatchFrameHolder then
QuestWatchFrame:ClearAllPoints()
QuestWatchFrame:SetPoint("TOP", WatchFrameHolder, "TOP")
end
end)
end