Page 1 of 1

Buildmenu on/off

Posted: 01 Sep 2009, 16:21
by Regret
Just like there is /console 0, there should be a way to turn off build/ordermenu using a console command.

Also it should only disable the drawing of the buildmenu and not change anything about the icons.

Re: Buildmenu on/off

Posted: 03 Sep 2009, 13:14
by Neddie
+1

Re: Buildmenu on/off

Posted: 03 Sep 2009, 14:21
by jK
already possible to hide it -> redundant request

Re: Buildmenu on/off

Posted: 03 Sep 2009, 14:23
by Regret
jK wrote:already possible to hide it -> redundant request
It's already possible to do almost everything in lua -> almost everything is a redundant request?

It is possible to disable the menu only in a silly hackish way. And every other default spring ui element has a console command to on/off.

Re: Buildmenu on/off

Posted: 03 Sep 2009, 14:28
by jK
and your gui is completely ignoring that interface -> when you want to replace the buildmenu you have to touch that code no matter what, you just don't want to spend a minute on it -> your problem and not the one of the engine

Re: Buildmenu on/off

Posted: 03 Sep 2009, 14:30
by Regret
jK wrote:and your gui is completely ignoring that interface -> when you want to replace the buildmenu you have to touch that code no matter what, you just don't want to spend a minute on it -> your problem and not the one of the engine
?????????????????

What the fuck are you talking about? What does having the ability to turn buildmenu on/off with a console command has to do with my UI?

I already managed to disable it in my UI and it works the way I want. I am requesting it because it is the only element in spring UI that can't be disabled ingame and that has to be hacked around.

Re: Buildmenu on/off

Posted: 03 Sep 2009, 20:22
by Argh
1. You can hide buildmenu items, or anything else you want, through Spring.EditUnitCmdDesc()

See P.U.R.E.'s source code (specifically, Tiercontrol.lua) for an example use case, specifically showing / hiding some icons like you want.

2. If you want to do anything fancier than hide it or disable it, then you need to sit down and alter Layout.lua and write a custom version.

Re: Buildmenu on/off

Posted: 03 Sep 2009, 20:30
by Regret
Argh wrote:1. You can hide buildmenu items, or anything else you want, through Spring.EditUnitCmdDesc()

See P.U.R.E.'s source code (specifically, Tiercontrol.lua) for an example use case, specifically showing / hiding some icons like you want.

2. If you want to do anything fancier than hide it or disable it, then you need to sit down and alter Layout.lua and write a custom version.
How is that related to anything? I already said this is not about my UI or what I am doing in my UI, can you please get your head out of your ass.

I said console command to hide ingame, just like you can hide any other thing.

Re: Buildmenu on/off

Posted: 03 Sep 2009, 21:13
by Argh
Showing other elements of your UI while F5 behavior is in effect is easy. Why do you want to just hide the buildmenu, and not the whole default UI?

Re: Buildmenu on/off

Posted: 03 Sep 2009, 21:32
by Regret
Argh wrote:Showing other elements of your UI while F5 behavior is in effect is easy. Why do you want to just hide the buildmenu, and not the whole default UI?
Why want to hide just the resource bars with /resbar 0, why just the info display with /info 0, why just the tooltip with /tooltip 0?

Re: Buildmenu on/off

Posted: 03 Sep 2009, 21:49
by Argh
OK, so you just want to selectively drop the panel?

Here's a solution for you.

Spring.SendCommands({"ctrlpanel hidden_panel.txt"})

Where hidden_panel.txt:

Code: Select all

////////////////////////////////////////////////////////////////////////////////
//
//  Spring Control Panel Configuration
//

outlinefont          1
// dropShadows       1
// useOptionLEDs     1
textureAlpha       1.0
frameAlpha         0.0  // use the GUI alpha if < 0.0
selectGaps           0
selectThrough        1

// newAttackMode     1  // enable attack by area selection
// attackRect        1  // use a rectangular selection
// invColorSelect    1  // use color inversion instead of tinting
frontByEnds          1  // use endpoints to create movement fronts


////////////////////////////////////////////////////////////////////////////////
//
//  5X5 specific placement
//

xIcons         5
yIcons         5
prevPageSlot  auto
deadIconSlot   auto
nextPageSlot   auto
xIconSize      0.045
yIconSize      0.06

textBorder     0.0000
iconBorder     0.0000
frameBorder    0.0000

xPos           5.0
yPos           5.0
xSelectionPos  0.018
ySelectionPos  0.115


////////////////////////////////////////////////////////////////////////////////
It's not as perfect as turning it off at the engine would be, performance-wise, but it's certainly hidden at that point. I'm sure there are other ways to do it, but that's simple and easy, and can be done in a Widget.

To reverse it, just do the same command, using the current ctrlpanel.txt file, in case that wasn't obvious.