Skip to content

Commit b84a180

Browse files
committed
Remove floating window UI from missile widget
Remove floatingCommand dependency and associated UI code (initialize, update, assign functions) since missiles are now managed through the command menu tab. Keep core functionality (command registration, blast radius drawing). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GiaPfKSj8kGFjaUPyxYYHd
1 parent 31f64c1 commit b84a180

1 file changed

Lines changed: 0 additions & 61 deletions

File tree

LuaUI/Widgets/missle_command_center.lua

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ end
1717
--------------------------------------------------------------------------------
1818
--------------------------------------------------------------------------------
1919

20-
VFS.Include(LUAUI_DIRNAME.."Widgets/lib/floatingCommand.lua")
2120
VFS.Include(LUAUI_DIRNAME.."Widgets/Utilities/engine_blast_radius.lua")
2221

2322
--------------------------------------------------------------------------------
@@ -43,11 +42,6 @@ local function getMouseTargetPosition()
4342
end
4443
end
4544

46-
local function assign(table, field, value)
47-
table[field] = value
48-
return value
49-
end
50-
5145
local function distance3(x1, y1, z1, x2, y2, z2)
5246
return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2)
5347
end
@@ -181,40 +175,6 @@ local function missle_class()
181175
return unit1
182176
end
183177

184-
function self:initialize()
185-
floatingCommand{
186-
name = "launch " .. self.name,
187-
x = self.x,
188-
y = self.y,
189-
action = function()
190-
self:action()
191-
end,
192-
contents = {
193-
assign(self, "bottomLabel",
194-
WG.Chili.Label:New {
195-
x = 0,
196-
y = 0,
197-
right = 5,
198-
bottom = 5,
199-
align = "right",
200-
valign = "bottom",
201-
caption = caption,
202-
fontSize = 16,
203-
autosize = false,
204-
fontShadow = true,
205-
}
206-
),
207-
WG.Chili.Image:New {
208-
x = "5%",
209-
y = "5%",
210-
right = "5%",
211-
bottom = "5%",
212-
file = "#" .. UnitDefNames[self.name].id,
213-
keepAspect = false,
214-
},
215-
},
216-
}
217-
end
218178

219179
function self:getPerferedUnit(params)
220180
local units = self:getOrderableUnits()
@@ -295,9 +255,6 @@ local function missle_class()
295255
drawLine(ux, uy, uz, mx, my, mz)
296256
end
297257

298-
function self:update()
299-
self.bottomLabel:SetCaption(self:getCount())
300-
end
301258

302259
return self
303260
end
@@ -515,28 +472,10 @@ function widget:CommandNotify(cmdID, cmdParams, cmdOptions)
515472
end
516473
end
517474

518-
function widget:Initialize()
519-
for _, command in pairs(commands) do
520-
command:initialize()
521-
end
522-
end
523475

524476
function widget:DrawWorld()
525477
for _, command in pairs(commands) do
526478
command:drawWorld()
527479
end
528480
end
529481

530-
local UPDATE_FREQUENCY = 0.25
531-
local timer = UPDATE_FREQUENCY + 1
532-
function widget:Update(dt)
533-
timer = timer + dt
534-
if timer < UPDATE_FREQUENCY then
535-
return
536-
end
537-
timer = 0
538-
539-
for _, command in pairs(commands) do
540-
command:update()
541-
end
542-
end

0 commit comments

Comments
 (0)