Is it possible to config which buttons are shown in the units menu?
For example I never click on the dgun button but use the d-hotkey, or f instead of clicking fight. Same with reclaim, patrol etc.
But I want to keep the toggles for fire&move state and the "morph commander" button some mods add.
possible to hide dgun, fight, move, etc buttons?
Moderator: Moderators
Re: possible to hide dgun, fight, move, etc buttons?
Code: Select all
function widget:GetInfo()
return {
version = "1",
name = "Hide commands",
desc = "Hides some commands",
author = "Regret",
date = "February 19, 2010", --last change February 19, 2010
license = "Public Domain",
layer = 0,
enabled = true, --enabled by default
handler = true, --access to handler
}
end
local HiddenCommands = {
[105] = true, --dgun
--[0] = true, --stop
}
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
"Wait" ID = "5"
"TimeWait" ID = "6"
"DeathWait" ID = "7"
"SquadWait" ID = "8"
"GatherWait" ID = "9"
"SelfD" ID = "65"
"Fire state" ID = "45"
"Repeat" ID = "115"
"Cloak state" ID = "95"
"Move state" ID = "50"
"Load units" ID = "76"
"Move" ID = "10"
"Patrol" ID = "15"
"Fight" ID = "16"
"Guard" ID = "25"
"Repair level" ID = "135"
"Land mode" ID = "145"
"Area attack" ID = "21"
"Attack" ID = "20"
"Repair" ID = "40"
"Reclaim" ID = "90"
"Restore" ID = "110"
"Load units" ID = "75"
"Unload units" ID = "80"
"Active state" ID = "85"
"apLandAt" ID = "34569"
"apAirRepair" ID = "34570"
"Automatic Mex Upgrade" ID = "31243"
"Upgrade Mex" ID = "31244"
"Area Attack" ID = "39954"
"Trajectory" ID = "120"
"Resurrect" ID = "125"
"0/0" ID = "100"
"Stagger" ID = "34566"
"DGun" ID = "105"
"ntPassiveMode" ID = "34571"
"Capture" ID = "130"
Last edited by Regret on 19 Feb 2010, 17:34, edited 1 time in total.
Re: possible to hide dgun, fight, move, etc buttons?
cool thanks :)
Re: possible to hide dgun, fight, move, etc buttons?
Instead of writing down all those command ID number, you can just use CMD.STOP, CMD.MOVE, CMD.FIGHT, CMD.ATTACK, ...
Re: possible to hide dgun, fight, move, etc buttons?
Yeah, the only commands you need IDs for are build commands (-unitID) and custom Lua commands.
Re: possible to hide dgun, fight, move, etc buttons?
Made this 0.83 compatible:
Code: Select all
function widget:GetInfo()
return {
version = "1",
name = "Hide commands",
desc = "Hides some commands",
author = "Regret",
date = "February 19, 2010", --last change February 19, 2010
license = "Public Domain",
layer = 0,
enabled = true, --enabled by default
handler = true, --access to handler
}
end
local HiddenCommands = {
[105] = true, --dgun
--[0] = true, --stop
}
function widget:CommandsChanged()
local cmds = widgetHandler.commands
local n = #(widgetHandler.commands)
for i=1,n do
if (HiddenCommands[cmds[i].id]) then
cmds[i].hidden = true
end
end
end
Re: possible to hide dgun, fight, move, etc buttons?
Is it also possible to add some commands to the menu, such as those?Regret wrote:"TimeWait" ID = "6"
"DeathWait" ID = "7"
"SquadWait" ID = "8"
"GatherWait" ID = "9"