I've been researching this a bit trying to find good examples in existing mods and the forum posts but I don't seem to be getting anywhere. A few things I have learned
*CtrlPanel.txt , can be used to create an extra column or so but nothing special
*You can hide the resourcebar and command bar with a bit of simple code
Code: Select all
local HiddenCommands = {
[CMD.MOVE] = true,
[CMD.WAIT] = true,
[CMD.STOP] = true,
[CMD.FIGHT] = true,
[CMD.ATTACK] = true,
[CMD.PATROL] = true,
[CMD.RECLAIM] = true,
[CMD.LOAD_UNITS] = true,
[CMD.LOAD_UNITS] = true,
[CMD.UNLOAD_UNITS] = true,
[CMD.GUARD] = true,
[CMD.REPEAT] = true,
-- [CMD.MOVE_STATE] = true,
-- [CMD.FIRE_STATE] = true,
[CMD.CLOAK] = true,
[CMD.AUTOREPAIRLEVEL] = true,
[CMD.IDLEMODE] = true,
}
function widget:CommandsChanged()
local cmds = widgetHandler.commands
local n = widgetHandler.commands.n
for i=1,n do
if (HiddenCommands[cmds[i].id]) then
cmds[i].hidden = true
end
end
end
Code: Select all
local commandwindow
local buildbarwindow
local screen
initwidget(){
commandwindow = new chiliwindow()
buildbarwindow = new chiliwindow()
screen.add(commandwindow)
screen.add(buildbarwindow)
}
onSelectUnit(unit){
availablecommands = unit.getAvailableCommands()
availabebuildings = unit.getAvailableBuildings()
foreach(command : availablecommands ){
uiCommand = new uiCommand(command)
commandWindow.add(uiCommand,x,y)
}
foreach(building: availabebuildings ){
uiBuilding= new uiBuilding(building)
buildbarwindow .add(uiBuilding,x,y)
}
screen.repaint()
}