Skip to content

Commit 5606e56

Browse files
committed
Consolidate progress bar logic into missile widget
Remove unnecessary separate helper widget. Handle progress bar updates directly in the missile widget's Update function. Simplifies codebase without losing functionality. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
1 parent d5f3a7d commit 5606e56

2 files changed

Lines changed: 6 additions & 87 deletions

File tree

LuaUI/Widgets/gui_missile_progress.lua

Lines changed: 0 additions & 83 deletions
This file was deleted.

LuaUI/Widgets/missle_command_center.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,16 +537,13 @@ function widget:Update(dt)
537537
end
538538
timer = 0
539539

540-
WG.missileProgress = WG.missileProgress or {}
540+
local integralMenu = widgetHandler:FindWidget("Chili Integral Menu")
541541

542542
for _, command in pairs(commands) do
543543
local count = command:getCount()
544544
local buildProgress = command:getMaxBuildProgress()
545545
local customCommands = widgetHandler.customCommands
546546

547-
-- Export progress data for other widgets
548-
WG.missileProgress[command.cmd] = buildProgress
549-
550547
for i = 1, #customCommands do
551548
if customCommands[i].id == command.cmd then
552549
local displayName = ""
@@ -562,6 +559,11 @@ function widget:Update(dt)
562559
end
563560
end
564561
customCommands[i].name = displayName
562+
563+
-- Update visual progress bar on integral menu button if available
564+
if integralMenu and integralMenu.SetCmdButtonProgress and buildProgress > 0 then
565+
integralMenu:SetCmdButtonProgress(command.cmd, buildProgress)
566+
end
565567
break
566568
end
567569
end

0 commit comments

Comments
 (0)