Page 1 of 1

Hide the command line, selection box and command menu

Posted: 29 May 2012, 04:57
by smoth
I cannot recall the commands and one of you might remember them.

I need to hide the line it draws from a unit to the command location..

as in that dotted line.

I need to remove the little green selection box on the units


I need to hide the buildbar/commandbar whatever you call it.

Re: Hide the command line, selection box and command menu

Posted: 29 May 2012, 06:33
by Google_Frog
I don't know of a simple way to do those things.

Here is a hacky way to remove unit boxes. I'm not saying this is the only solution but it is a solution. It is used in the 5 unit selection visualisation widgets that are in ZK so it may be the only solution. You could use this method to edit Command Queue Rendering as well such that all commands draw as fully transparent.

In case you aren't aware here is a list of undocumented UI commands. Of course the wiki may be out of date. That should have the command to disable the build menu, maybe it's 'ctrlpanel'?

Re: Hide the command line, selection box and command menu

Posted: 29 May 2012, 19:20
by zwzsg
smoth wrote:I need to hide the line it draws from a unit to the command location..
In cmdcolors.txt have alwaysDrawQueue 0


smoth wrote:I need to remove the little green selection box on the units

Code: Select all

local function SetupCommandColors(state)
  local alpha = state and 1 or 0
  local f = io.open('cmdcolors.tmp', 'w+')
  if (f) then
    f:write('unitBox  0 1 0 ' .. alpha)
    f:close()
    spSendCommands({'cmdcolors cmdcolors.tmp'})
  end
  os.remove('cmdcolors.tmp')
end
It seem a bit ugly but it's how Trepan did it so I suppose it's ok.


I need to hide the buildbar/commandbar whatever you call it.
Spring.SendCommands({"ctrlpanel LuaUI/Widgets/YourOwnCtrlPanel.txt"})-- With xPos or yPos out of screen there



:? None of my three answers are pretty so now Smoth will raeg all over the place about how angry it makes him to have his topics desacrated by unwanted solutions.

Re: Hide the command line, selection box and command menu

Posted: 29 May 2012, 19:41
by SinbadEV
I don't know what I'm talking about but commenting in a "maybe I'll inspire someone who does to think of a solution" capacity:

If the functions to draw those things are Lua couldn't you just make your own versions of those functions that didn't draw them, overriding the default behaviour?

If not, consider this a request to investigate moving said features from engine core to Lua.

Re: Hide the command line, selection box and command menu

Posted: 01 Jun 2012, 16:47
by KDR_11k
You could do it the crazy route and disable selections, merely passing the few commands you want to let the player use through a gadget. I think that's how Air Raid avoids all these issues.

Re: Hide the command line, selection box and command menu

Posted: 01 Jun 2012, 17:35
by jK