Buildmenu on/off

Buildmenu on/off

Requests for features in the spring code.

Moderator: Moderators

Post Reply
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Buildmenu on/off

Post 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.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Buildmenu on/off

Post by Neddie »

+1
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Buildmenu on/off

Post by jK »

already possible to hide it -> redundant request
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: Buildmenu on/off

Post 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.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Buildmenu on/off

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

Re: Buildmenu on/off

Post 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.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Buildmenu on/off

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

Re: Buildmenu on/off

Post 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.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Buildmenu on/off

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

Re: Buildmenu on/off

Post 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?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Buildmenu on/off

Post 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.
Post Reply

Return to “Feature Requests”