possible to hide dgun, fight, move, etc buttons?

possible to hide dgun, fight, move, etc buttons?

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

possible to hide dgun, fight, move, etc buttons?

Post by knorke »

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.
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: possible to hide dgun, fight, move, etc buttons?

Post by Regret »

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
"Stop" ID = "0"
"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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: possible to hide dgun, fight, move, etc buttons?

Post by knorke »

cool thanks :)
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: possible to hide dgun, fight, move, etc buttons?

Post by zwzsg »

Instead of writing down all those command ID number, you can just use CMD.STOP, CMD.MOVE, CMD.FIGHT, CMD.ATTACK, ...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: possible to hide dgun, fight, move, etc buttons?

Post by Argh »

Yeah, the only commands you need IDs for are build commands (-unitID) and custom Lua commands.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: possible to hide dgun, fight, move, etc buttons?

Post by Jools »

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
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: possible to hide dgun, fight, move, etc buttons?

Post by Jools »

Regret wrote:"TimeWait" ID = "6"
"DeathWait" ID = "7"
"SquadWait" ID = "8"
"GatherWait" ID = "9"
Is it also possible to add some commands to the menu, such as those?
Post Reply

Return to “Help & Bugs”