# HG changeset patch
# User Nick@Zahhak
# Date 1490589569 14400
# Node ID 6748c98a6c6cf7c96449e206d270f8407006ddcb
# Parent 2105b6e5095f8dc1ad44d6edee397cb156c602aa
- Reworked OrderHallHandler triggers
- OrderHallHandler minimializes hud info
- WorldState currency headers have a unified font
diff -r 2105b6e5095f -r 6748c98a6c6c Modules/Currency.lua
--- a/Modules/Currency.lua Sun Mar 26 06:25:18 2017 -0400
+++ b/Modules/Currency.lua Mon Mar 27 00:39:29 2017 -0400
@@ -85,6 +85,7 @@
frame.Update = function (block)
debug('Update [Currency]')
local name, earned, texture, earnedThisWeek, weeklyMax, totalMax = GetCurrencyInfo(currencyID)
+
block.Icon:SetTexture(texture)
block.Label:SetFormattedText("%d / %d", earned, totalMax)
block:SetWidth(block.Icon:GetWidth() + block.Label:GetStringWidth() + 6)
@@ -186,6 +187,23 @@
end
end
+function block:OnEnter()
+ if not InCombatLockdown() then
+ GameTooltip:SetOwner(self, "ANCHOR_BOTTOMRIGHT");
+ if self.currencyID then
+ GameTooltip:SetCurrencyTokenByID(self.currencyID);
+ else
+ GameTooltip:SetItemByID(self.itemID);
+ end
+ GameTooltip:Show();
+ end
+end
+function block:OnLeave()
+ if GameTooltip:IsOwned(self) then
+ GameTooltip_Hide()
+ end
+end
+
function block:OnEvent(event, ...)
print('|cFF0088FF<'..self.name..'>|r', 'OnEvent', event, ...)
self:Update()
diff -r 2105b6e5095f -r 6748c98a6c6c Modules/Currency.xml
--- a/Modules/Currency.xml Sun Mar 26 06:25:18 2017 -0400
+++ b/Modules/Currency.xml Mon Mar 27 00:39:29 2017 -0400
@@ -8,20 +8,28 @@
+
+
+
+
+
+
+
+
-
+
-
+
-
+
diff -r 2105b6e5095f -r 6748c98a6c6c Modules/WorldState.lua
--- a/Modules/WorldState.lua Sun Mar 26 06:25:18 2017 -0400
+++ b/Modules/WorldState.lua Mon Mar 27 00:39:29 2017 -0400
@@ -147,15 +147,56 @@
function VeneerWorldStateMixin:OnMouseDown()
end
+--- Order Hall mod
+local requiresUpdate
+local ocb
function VeneerOrderHallMixin:Setup()
print('|cFFFFFF00'..self:GetName()..':Setup()')
- self:SetParent(OrderHallCommandBar)
- self:RegisterEvent("UNIT_AURA");
- self:RegisterEvent("GARRISON_FOLLOWER_CATEGORIES_UPDATED")
- self:RegisterEvent("GARRISON_FOLLOWER_ADDED")
- self:RegisterEvent("GARRISON_FOLLOWER_REMOVED")
+ ocb = OrderHallCommandBar
+ hooksecurefunc(ocb, 'RefreshCategories', function()
+ requiresUpdate = true
+ end)
+ hooksecurefunc(ocb, 'RefreshCurrency',
+ function()
+ requiresUpdate = true
+ end)
+ hooksecurefunc(ocb, 'SetShown', function(isShown)
+ self:SetShown(isShown)
+ end)
+ hooksecurefunc(ocb, 'RefreshAll', function()
+ self:Update()
+ end)
- self:SetShown(true)
+ ocb:ClearAllPoints()
+ ocb:SetAllPoints(self)
+
+
+ ocb.WorldMapButton:Hide()
+ ocb.AreaName:Hide()
+
+ ocb.Currency:SetFontObject(VeneerHeaderFont)
+ ocb.Currency:ClearAllPoints()
+ ocb.Currency:SetPoint('BOTTOMLEFT', ocb.ClassIcon, 'BOTTOMRIGHT', 15, 0)
+
+ ocb.CurrencyIcon:ClearAllPoints()
+ ocb.CurrencyIcon:SetPoint('TOP', ocb.ClassIcon, 'TOPRIGHT')
+
+ ocb.Background:SetColorTexture(0,0,0,0.5)
+
+ -- frame that calls up the resources tooltip
+ ocb.CurrencyHitTest:SetPoint('LEFT', ocb.CurrencyIcon, 'LEFT')
+ ocb.CurrencyHitTest:SetPoint('RIGHT', ocb.Currency, 'RIGHT')
+
+
+ self:SetSize(700, 23)
+ self:SetShown(ocb:IsShown())
+end
+
+function VeneerOrderHallMixin:OnUpdate()
+ if requiresUpdate then
+ self:Update()
+ end
+
end
function VeneerOrderHallMixin:OnLoad()
@@ -163,54 +204,45 @@
self:EnableMouse(false)
end
-function VeneerOrderHallMixin:OnEvent(event, ...)
-
- print('|cFF00AAFF'..self:GetName()..'|r:'.. event, ...)
- self:Update()
-end
function VeneerOrderHallMixin:OnShow()
- if OrderHallCommandBar then
- print('|cFF00AAFF'..self:GetName()..'|r:OnShow()', OrderHallCommandBar:IsShown(), self:IsShown())
+ if ocb then
+ --self:Print('|cFF00AAFF'..self:GetName()..'|r:OnShow()', ocb:IsShown(), self:IsShown())
self:Update()
end
- Veneer:DynamicReanchor()
-end
-
-function VeneerOrderHallMixin:OnHide()
- if OrderHallCommandBar then
- print('|cFF00AAFF'..self:GetName()..'|r:OnHide()', OrderHallCommandBar:IsShown(), self:IsShown())
- end
- Veneer:Reanchor()
end
function VeneerOrderHallMixin:Update()
- if not OrderHallCommandBar then
- print('|cFFFF4400'..self:GetName()..' updater called without target')
- return
- end
-
- OrderHallCommandBar:ClearAllPoints()
- OrderHallCommandBar:SetAllPoints(self)
-
- OrderHallCommandBar.Background:SetColorTexture(0,0,0,0.5)
- OrderHallCommandBar.WorldMapButton:Hide()
- OrderHallCommandBar:EnableMouse(false)
- self:SetSize(700, 22)
-
+ self:SetShown(ocb:IsShown())
+ local lastFrame
+ local categoriesWidth = 0
local troops = OrderHallCommandBar.TroopSummary
if troops then
for _, category in ipairs(troops) do
- category.Count:SetFontObject(VeneerNumberFont)
+ category.Count:SetFontObject(VeneerHeaderFont)
+ category.Count:SetTextColor(1,1,1,1)
category.Count:ClearAllPoints()
category.Count:SetPoint('BOTTOMRIGHT', category.Icon, 'BOTTOMRIGHT', -1, 1)
+
+ category:ClearAllPoints()
+ if lastFrame then
+ lastFrame:SetPoint('TOPRIGHT', category, 'TOPLEFT', 0, 0)
+ end
+ category:SetSize(category.TroopPortraitCover:GetSize())
+
+ lastFrame = category
+ categoriesWidth = categoriesWidth + category:GetWidth()
+ end
+
+ if lastFrame then
+ lastFrame:SetPoint('TOPRIGHT', ocb, 'TOPRIGHT', 0, 0)
end
+
end
-
-
-
- print('|cFF00AAFF'..self:GetName()..'|r:Update()', OrderHallCommandBar:IsVisible(), self:IsShown())
- print(debugstack(6))
+ self:SetWidth(ocb.ClassIcon:GetWidth() + 15 + ocb.Currency:GetWidth() + ocb.CurrencyIcon:GetWidth() + categoriesWidth)
+ requiresUpdate = nil
+ --print('|cFF00AAFF'..self:GetName()..'|r:Update()', OrderHallCommandBar:IsVisible(), self:IsShown())
+ --print(debugstack(6))
Veneer:DynamicReanchor()
end