Skip to content

Commit 6efca5b

Browse files
committed
a few fixes
1 parent 8d9280e commit 6efca5b

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

startup.lua

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ function Details222.StartUp.StartMeUp()
2323
return Details.AddOnStartTime or GetTime()
2424
end
2525

26+
--load custom spells on login
2627
C_Timer.After(3, function()
27-
--load custom spells on login
2828
Details:FillUserCustomSpells()
2929
end)
3030

@@ -143,7 +143,8 @@ function Details222.StartUp.StartMeUp()
143143
return
144144
end
145145
Details.scheduled_window_update = nil
146-
Details:RefreshMainWindow(-1, true)
146+
local bForceRefresh = true
147+
Details:RefreshMainWindow(-1, bForceRefresh)
147148
end
148149

149150
function Details:ScheduleWindowUpdate(time, bIsForced)
@@ -154,7 +155,8 @@ function Details222.StartUp.StartMeUp()
154155
Details.scheduled_window_update = Details.Schedules.NewTimer(time or 1, Details.ScheduledWindowUpdate, Details, bIsForced)
155156
end
156157

157-
Details:RefreshMainWindow(-1, true)
158+
local bForceRefresh = true
159+
Details:RefreshMainWindow(-1, bForceRefresh)
158160
Details:RefreshUpdater()
159161

160162
for instanceId = 1, Details:GetNumInstances() do
@@ -183,7 +185,7 @@ function Details222.StartUp.StartMeUp()
183185
local refreshAllInstances = -1
184186
local forceRefresh = true
185187
Details:RefreshMainWindow(refreshAllInstances, forceRefresh)
186-
local lowerInstance = Details:GetLowerInstanceNumber()
188+
local lowerInstanceId = Details:GetLowerInstanceNumber()
187189

188190
for id = 1, Details:GetNumInstances() do
189191
local instance = Details:GetInstance(id)
@@ -201,7 +203,7 @@ function Details222.StartUp.StartMeUp()
201203
end
202204

203205
--refresh desaturated icons if is lower instance because plugins shall have installed their icons at this point
204-
if (id == lowerInstance) then
206+
if (id == lowerInstanceId) then
205207
instance:DesaturateMenu()
206208
instance:SetAutoHideMenu(nil, nil, true)
207209
end
@@ -212,8 +214,8 @@ function Details222.StartUp.StartMeUp()
212214
Details.ToolBar:ReorganizeIcons()
213215

214216
--refresh skin for other windows
215-
if (lowerInstance) then
216-
for instanceId = lowerInstance+1, Details:GetNumInstances() do
217+
if (lowerInstanceId) then
218+
for instanceId = lowerInstanceId+1, Details:GetNumInstances() do
217219
local instance = Details:GetInstance(instanceId)
218220
if (instance and instance.baseframe and instance.ativa) then
219221
instance:ChangeSkin()
@@ -230,8 +232,8 @@ function Details222.StartUp.StartMeUp()
230232
Details.Schedules.NewTimer(5, Details.CheckWallpaperAfterStartup, Details)
231233
end
232234

233-
for id = 1, Details.instances_amount do
234-
local instance = Details:GetInstance(id)
235+
for instanceId = 1, Details.instances_amount do
236+
local instance = Details:GetInstance(instanceId)
235237
if (instance and instance:IsEnabled()) then
236238
if (not instance.wallpaper.enabled) then
237239
instance:InstanceWallpaper(false)
@@ -312,17 +314,17 @@ function Details222.StartUp.StartMeUp()
312314
--scan pets
313315
Details:SchedulePetUpdate(1)
314316

315-
--send messages gathered on initialization
317+
--send messages gathered on initialization, these messages contain warnings and errors
316318
Details.Schedules.NewTimer(10, Details.ShowDelayMsg, Details)
317319

318-
--send instance open signal
320+
--send instance open event for each instance opened
319321
for id, instancia in Details:ListInstances() do
320322
if (instancia.ativa) then
321323
Details:SendEvent("DETAILS_INSTANCE_OPEN", nil, instancia)
322324
end
323325
end
324326

325-
--send details startup done signal
327+
--send details startup done event, this signal that details is ready to work
326328
function Details:AnnounceStartup()
327329
Details:SendEvent("DETAILS_STARTED", "SEND_TO_ALL")
328330

@@ -344,7 +346,7 @@ function Details222.StartUp.StartMeUp()
344346
Details.failed_to_load = nil
345347
end
346348

347-
--announce alpha version
349+
--display the version right after the startup, this will fade out after a few seconds
348350
function Details:AnnounceVersion()
349351
for index, instancia in Details:ListInstances() do
350352
if (instancia.ativa) then
@@ -356,7 +358,7 @@ function Details222.StartUp.StartMeUp()
356358
--check version
357359
Details:CheckVersion(true)
358360

359-
--restore cooltip anchor position, this is for the custom anchor in the screen
361+
--restore cooltip anchor position, this is for the custom anchor in the screen set in the tooltip options
360362
DetailsTooltipAnchor:Restore()
361363

362364
--check is this is the first run ever
@@ -423,6 +425,17 @@ function Details222.StartUp.StartMeUp()
423425
Details:AddDefaultCustomDisplays()
424426
end
425427

428+
if (C_AddOns) then
429+
hooksecurefunc(C_AddOns, "LoadAddOn", function(addOnName)
430+
if (addOnName == "Blizzard_GarrisonUI") then
431+
GarrisonMissionTutorialFrame:HookScript("OnShow", function(self)
432+
GarrisonMissionTutorialFrame:Hide()
433+
end)
434+
GarrisonMissionTutorialFrame:Hide()
435+
end
436+
end)
437+
end
438+
426439
local lowerInstanceId = Details:GetLowerInstanceNumber()
427440
if (lowerInstanceId) then
428441
local instance = Details:GetInstance(lowerInstanceId)

0 commit comments

Comments
 (0)