Page 1 of 1

Disabled Commands

Posted: 14 Apr 2007, 21:18
by trepan
I've added the disabled parameter to CommandDescriptions. It does
not currently block commands, it only affects the rendering. To block
commands, you can use AllowCommand() in LuaRules (even if I add
real client-side blocking based on "disabled", a synced check should
still be provided in LuaRules).

Image

Test code (from LuaRules/main.lua):

Code: Select all

  local cmdDescs = Spring.GetUnitCmdDescs(unitID)
  for i = 1, cmdDescs.n do
    Spring.EditUnitCmdDesc(unitID, i, {
      disabled = (math.floor(math.mod(i, 4)) == 0)
    })
  end

Posted: 14 Apr 2007, 21:39
by trepan
Commands are now blocked client-side (mouse and keyboard).

Posted: 14 Apr 2007, 21:46
by imbaczek
Mmm last missing piece needed for abilities/spells to work :)

Posted: 26 Apr 2007, 00:30
by LOrDo
Will be great for campaigns and stuff. Ahh OTA...