Skip to content

Commit

Permalink
Update OrderHall.lua
Browse files Browse the repository at this point in the history
Reverted changes, was not final change.
  • Loading branch information
ViksUI committed Aug 28, 2017
1 parent 529eb4d commit c79d6c7
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions ShestakUI/Modules/Skins/Blizzard/OrderHall.lua
Expand Up @@ -9,7 +9,7 @@ local function LoadSkin()
OrderHallCommandBar:SetTemplate("Transparent")
OrderHallCommandBar:ClearAllPoints()
OrderHallCommandBar:SetPoint("TOP", UIParent, 0, 0)
OrderHallCommandBar:SetWidth(580)
OrderHallCommandBar:SetWidth(500)
OrderHallCommandBar.ClassIcon:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
OrderHallCommandBar.ClassIcon:SetSize(46, 20)
OrderHallCommandBar.CurrencyIcon:SetAtlas("legionmission-icon-currency", false)
Expand Down Expand Up @@ -96,20 +96,6 @@ local function LoadSkin()
ClassHallTalentInset:StripTextures()
OrderHallTalentFrame.Currency:SetFont(C["media"].normal_font, 16)
OrderHallTalentFrame.CurrencyIcon:SetAtlas("legionmission-icon-currency", false)
local index = 1
C_Timer.After(0.1, function()
for i, child in ipairs({OrderHallCommandBar:GetChildren()}) do
if child.Icon and child.Count and child.TroopPortraitCover then
child.TroopPortraitCover:Hide()
child.Icon:SetSize(40,20)
child.Count:SetFont(C["media"].normal_font, 14)
child.Count:SetTextColor(1, 1, 1)
child.Count:SetShadowOffset(0, 0)

index = index + 1
end
end
end)
end

T.SkinFuncs["Blizzard_OrderHallUI"] = LoadSkin

2 comments on commit c79d6c7

@ViksUI
Copy link
Collaborator Author

@ViksUI ViksUI commented on c79d6c7 Aug 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code needs some review. Not stable function for some reason, as it sometimes doesn't runs when reentering OrderHall. We need to run this a second after Blizzard_OrderHallUI is loaded.

@Merathilis
Copy link

@Merathilis Merathilis commented on c79d6c7 Aug 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats because you missed the events for this:

local OrderHallFollower = CreateFrame("Frame")
OrderHallFollower:RegisterEvent("ADDON_LOADED")
OrderHallFollower:SetScript("OnEvent", function(self, event, addon)
	if (event == "ADDON_LOADED" and addon == "Blizzard_OrderHallUI") then
		OrderHallFollower:RegisterEvent("DISPLAY_SIZE_CHANGED")
		OrderHallFollower:RegisterEvent("UI_SCALE_CHANGED")
		OrderHallFollower:RegisterEvent("GARRISON_FOLLOWER_CATEGORIES_UPDATED")
		OrderHallFollower:RegisterEvent("GARRISON_FOLLOWER_ADDED")
		OrderHallFollower:RegisterEvent("GARRISON_FOLLOWER_REMOVED")

	elseif event ~= "ADDON_LOADED" then
		local bar = OrderHallCommandBar

		local index = 1
		C_Timer_After(0.3, function() -- Give it a bit more time to collect.
			local last
			for i, child in ipairs({bar:GetChildren()}) do
				if child.Icon and child.Count and child.TroopPortraitCover then
					child:ClearAllPoints()
					child:SetPoint("LEFT", bar.AreaName, "RIGHT", 50 + (index - 1) * 120, 0)
					child:SetWidth(60)

					child.TroopPortraitCover:Hide()
					child.Icon:ClearAllPoints()
					child.Icon:SetPoint("LEFT", child, "LEFT", 0, 0)
					child.Icon:SetSize(32, 16)

					child.Count:ClearAllPoints()
					child.Count:SetPoint("LEFT", child.Icon, "RIGHT", 5, 0)
					child.Count:SetTextColor(.9, .9, .9)
					child.Count:SetShadowOffset(.75, -.75)

					last = child.Count

					index = index + 1
				end
			end
		end)
	end
end)

Please sign in to comment.