Page MenuHomeWildfire Games

New UI for gamesetup options
ClosedPublic

Authored by bb on Nov 11 2017, 6:29 PM.

Details

Summary

The current more options window is too small. Also adding more options to it won't work. Thus we need to get more space for the options (f.e. with #4014). With this patch we remove the more option window and create a hide-able tabbed panel with all options (so the map options a re included there too). The hotkey and scroll features from rP20644 are used.
Also it is possible to have multiple columns of options, and that is automated, so if the options do not fit in one column, two columns will be created and filled with options.
When there are multiple columns in MP, the chat window can get so small it gets ugly, thus hiding the window when the space gets too small.

A problem still is that dropdowns very low in the screen are unusable, since the options are invisible.
Possibly the extended tag in the gamedescription need to be removed following this patch.
Also possibly the panel could be hidden on init in MP and showed in SP.

Related forum discussion: https://wildfiregames.com/forum/index.php?/topic/22957-game-setup-rooms-aka-games-creation-room-ui-overhaul/

Visual as of 7 jan 2018:

Test Plan

Agree that the current space is to small and this is a solution
Agree on the used hotkeys
Check grammar in strings
Check for annoying magical numbers

Resize screen so multiple column appear and the chat window vanishes, and resize back to we get back to normal
Test everything is OK at min res

Like the new UI :)

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
bb added a comment.Jan 4 2018, 3:46 PM

"can": yes, but should that happen? The game description contains most of the information settable in the options, and form so a nice summary of the chosen values. So with putting it under a tab it would be mostly invisible for the players, thus not much seen, kinda takes the point away from having the summary.

On making the tabs less wide, there have been some suggestions for adding a few more buttons for various things to the gamesetup (like a button to view a lobby dialog), these buttons could be placed to the right of the tab buttons and so making the tabs less wide. But as we didn't have any of these buttons yet, I took full wide for the buttons.

elexis added a comment.Jan 4 2018, 7:00 PM

Given that we are likely going to add an Options button to the gamesetup opening the options, should we rename the options here to settings in accordance with g_GameAttributes.settings?

Couldn't test yet. Wondering if we need scrolling (some waiting time before being able to set a setting might become annoying when having to wait often).
(A recent screenshot in the summary might help getting more comments)

binaries/data/mods/public/gui/gamesetup/gamesetup.js
415

General == Miscellaneous. I guess it's hard to get it right with regards to the GUI space.
treasures, trigger difficulty -> map option?
num players, pop cap, starting resources -> player options?
ceasefire, locked teams, last man standing -> player options? diplomacy options? Player & Diplomacy options?

420

singular

1114

" " -> "\n"
Also mimo says D1180 is a must-have, so should likely get that in.

1160

Easier to keep track of object if they have the same name in JS and XML, i.e let foo = Engine.GetGUIObjectByName("foo");

1164

Is there some mnemonic for the abstract for the abstract equality comparison test https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 or should we always use a strict comparison === when testing against falsy values? (same below)

1188

Can that be replaced with a chatPanel hidden test? I.e. testing what we want to test for by definition, rather than the coincidentally equal value.
In general it would be better to move this part to the g_MiscControls if possible

1773

(how I love these hardcodings)

1932

Equivalent code you said? :-)

2052–2055

You mean showing disabled checkboxes to non-controllers? Maybe there hadn't been an accoridng sprite at the time. Anyway out of scope.

binaries/data/mods/public/gui/gamesetup/gamesetup.xml
48

"options size fitting to"?

258

How do you mean? They shouldn't have the same position to begin with?

gentz: +1 map description much better readable in great tab page

gentz added a comment.EditedJan 5 2018, 1:37 AM

Maybe have it so that the summary is by default at where the options go right now and then have the options take its position when their tabs are presses? Honestly, I've never actually read the map description cause I've found it easier to glance at the map settings.

bb marked 6 inline comments as done.Jan 7 2018, 2:23 AM
In D1027#48439, @gentz wrote:

Maybe have it so that the summary is by default at where the options go right now and then have the options take its position when their tabs are presses? Honestly, I've never actually read the map description cause I've found it easier to glance at the map settings.

The description might be debatable, but just the space of the description is not enough for the options. Besides knowing what the setted values are the gamedescription also servers the purpose to give a little more lengthy description of what the value exactly means (showing all values and not the substract which we do now, is possible ofc)

In D1027#48424, @elexis wrote:

Given that we are likely going to add an Options button to the gamesetup opening the options, should we rename the options here to settings in accordance with g_GameAttributes.settings?

done in whole gamesetup

Couldn't test yet. Wondering if we need scrolling (some waiting time before being able to set a setting might become annoying when having to wait often).

a decision for later I guess

binaries/data/mods/public/gui/gamesetup/gamesetup.js
415

general != misc
Making a player tab absorbing the number of players above and popcap and startingres. treasures, trigger => map. rest => misc

1114

Can always be changed when/if doing D1180

1188

The whole check should be removed, checking for hidden won't work as the panel can be hidden due to the small size

1773

well the first line is actually a current bug, only unnoticed since when changing the map the more options window is closed, second line is a bit unfortunate

1932

(Yes I had plans to merge them together, but that will take a nice main-menu rewrite and so meh-ed it for now)

binaries/data/mods/public/gui/gamesetup/gamesetup.xml
258

The problem is that we want the dropdowns and checkboxes to be hidden when they are under the tabs, thus re-added the background in the corner, however the dropdowns and checkboxes show on top of them, thus added those z values to force the hiding. And the corner overlaps the whole corner (otherwise a user could notice it) thus it is also under those buttons.

bb updated this revision to Diff 5156.Jan 7 2018, 2:23 AM
bb marked 3 inline comments as done.

rename option=> setting

Vulcan added a comment.Jan 7 2018, 3:48 AM
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/gui/common/tab_buttons.js
|  61| »   »   g_TabCategorySelected·=·direction·>·0·?·-1·:·0
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
Vulcan added a comment.Jan 7 2018, 6:19 AM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
bb edited the summary of this revision. (Show Details)Jan 7 2018, 6:12 PM
bb edited the test plan for this revision. (Show Details)
bb added inline comments.
binaries/data/mods/public/gui/gamesetup/gamesetup.js
379–382

nukable

1113

spelling error

bb updated this revision to Diff 5166.Jan 7 2018, 6:14 PM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/gui/common/tab_buttons.js
|  61| »   »   g_TabCategorySelected·=·direction·>·0·?·-1·:·0
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
bb added inline comments.Jan 9 2018, 10:57 PM
binaries/data/mods/public/gui/common/tab_buttons.js
61 ↗(On Diff #5166)

semicolon by vulcan

works good. little bug with tips

I suggest having first tab "Description" and showing the small map description window in a bigger tab page with the map description as default.

Maybe later then can also come there a tab for "Players List" with kick and mute options for host/players. and evetualy very important pings showing. This would be great

bb added a comment.Jan 10 2018, 12:50 PM

I suggest having first tab "Description" and showing the small map description window in a bigger tab page with the map description as default.

Don't like having the description under a tab since:

  1. We get unused and unusable gui space on the current position
  2. A player would just glance the options and never use the description, so it would be better to nuke that altogether, so we loose the longer descriptions of the settings.
  3. It is not trivial to the player that the one tab doesn't contain options but a summary, when all other tabs contain options.
  4. A new player doesn't know what all the options exactly mean, and now (s)he needs to go to another tab in order to find out (remember it took a while even for the experienced players to find the ingame objectives dialog).

A possibility would be to bring the player settings under a tab too, and move all options there, but then the line of focus for the player is broken, o not liking that either.

Maybe later then can also come there a tab for "Players List" with kick and mute options for host/players. and evetualy very important pings showing. This would be great

Adding such a tab indeed is possible

yea true maybe we need first more tabs before space gets to little for map description.
This Players List Tab would be awesome. Not sure how much work it will be. Maybe @elexis already got some ideas for pings showing etc.. i will also look then into this. maybe first this patch ready. ofc

bb added inline comments.Jan 10 2018, 3:34 PM
binaries/data/mods/public/gui/common/tab_buttons.js
61 ↗(On Diff #5166)

this bugged actually, needs to be move to the onPress function

bb updated this revision to Diff 5216.Jan 10 2018, 8:36 PM

fix spTips

ffffffff added inline comments.Jan 16 2018, 3:29 AM
binaries/data/mods/public/gui/gamesetup/gamesetup.js
403

add "nomad", for current sync

1158

no explanation to dt? (maybe difftime)?

1196

;


more options dialog dies
make fast review gamesetup tabs

And needs an update for D817. Feel free to use a "Lobby" button rather than the icon if it suits better.
Indeed needs to get this in soon and move on to the combine victory condition diff.
Sure the latter can't be committed separately meanwhile?

binaries/data/mods/mod/gui/common/modern/sprites.xml
486

Why is it called corner bottom right if its a background?

Those copies are hurtful, would be better to avoid them in some elegant way. For instance splitting the existing sprite into two sprites maybe or reusing the existing sprite somehow. Shouldn't sacrifice essential visual appearance however.

binaries/data/mods/public/gui/common/tab_buttons.js
60 ↗(On Diff #5216)

Is the if-statement unavoidable?

binaries/data/mods/public/gui/gamesetup/gamesetup.js
1158

(configDB entry would be nice I suppose, to save some time)

2104

string context or comment

bb updated this revision to Diff 5384.Jan 20 2018, 12:20 AM
bb marked 5 inline comments as done.
In D1027#49945, @elexis wrote:

Sure the latter can't be committed separately meanwhile?

Combine victory needs a rebase aswell, and I don't think I have enough time to get that through for A23 upcomming weeks, also having that patch, without this one leads to size problems on minres, thus I did vote for getting this one in, and see how far we get on the combine victory conditions.

binaries/data/mods/mod/gui/common/modern/sprites.xml
486

Since it is only the bottom right corner of the background

In theory we could make all 4 the corners as separate sprites and have a sprite merging those and adding the title window, but in practise sprites doesn't allow including another sprite, thus we need to either allow that or make some style merging the sprites already and use that in all current occasions, however calling both out of scope for now.

binaries/data/mods/public/gui/common/tab_buttons.js
60 ↗(On Diff #5216)

no

binaries/data/mods/public/gui/gamesetup/gamesetup.js
365

typo

1158

maybe to much of a physicist to not understand dt, so just added the comment

1158

As in a config item for the speed (a slider), or for on/off (checkbox)?

Tested . I like what I see. Must-have.

  • Button width should be equal to gamedescription info width minus width of actually displayed lobby icons.
  • The argument about the additional GUI space being taken potentially resulting in an annoying amount of time consumed by the frequent animation when switching between reading chat and adapting settings to the chat seems only relevant to 1024x.

I still think having it optional might become useful. Maybe it's not as problematic.

  • Number of Players setting requires 2 lines, the top pixels are cut off. Should add a vertical offset.
  • Order
    • Nomad is a map setting (the most relevant boolean probably)
    • Cheats are a player setting, right?
    • Rated Game, Teams Locked, Ceasefire and Victory Conditions could be bundled under "Game Type"?
    • Leaves only gamespeed, could be moved to Map?
  • Maybe some backdrop for the new panel.
binaries/data/mods/mod/gui/common/modern/sprites.xml
486

sad but true

binaries/data/mods/public/gui/common/tab_buttons.js
64 ↗(On Diff #5384)

I meant the condition actually, i.e. if the special case for undefined is avoidable, i.e. always have a tab selected but having the hidden state in a separate variable. Not sure if it improves this line.
You can write it as an if-statement if that looks better too.

binaries/data/mods/public/gui/gamesetup/gamesetup.js
1153

I don't like this function. It's name is extremely vague, sounds like it could do anything and nothing. From the naming it could be used everywhere. Just inline it (with a fat arrow or not)

1200

Don't add a second place that define state-dependent logic to determine the visibility of the SP tips. It should be set in g_MiscControls and you can call the function in that object if needed.

1290

sounds right. GUI order != init order.

1395

let childCount = settingsPanel.children.filter(child => child.hidden).length?

Maybe even a reduce call to merge more stuff?

bb marked 3 inline comments as done.Jan 20 2018, 11:25 PM
In D1027#50176, @elexis wrote:
  • The argument about the additional GUI space being taken potentially resulting in an annoying amount of time consumed by the frequent animation when switching between reading chat and adapting settings to the chat seems only relevant to 1024x.

https://code.wildfiregames.com/D1027?id=5216#inline-23686 ?

I still think having it optional might become useful. Maybe it's not as problematic.

  • Nomad is a map setting (the most relevant boolean probably)

Saw it as a "player starting phase" setting (like a player can start in nomad < normal< town< city), but as for now could be under map too
(notice we can mix the checkboxes and dropdowns however)

  • Rated Game, Teams Locked, Ceasefire and Victory Conditions could be bundled under "Game Type"?

Keep in mind we want to expand the victory conditions into 6 checkboxes, which together won't fit on 1 column in min res (trying to avoid it where possible, and having backup support when no other solution)

  • Leaves only gamespeed, could be moved to Map?

Rather put it under gameType then

  • Maybe some backdrop for the new panel.

You mean the tab buttons?

binaries/data/mods/public/gui/common/tab_buttons.js
64 ↗(On Diff #5384)

Could work if we have the hotkey moving the tab on based on the last selected tab, but don't like that since imo when no tab is selected the hotkeys should move to the lower/upper tab, and with that behaviour we need some check here (could be another variable, but doesn't change the existence of a check) and storing the tab index when it actually doesn't exist seems useless to me, so putted undefined in since that comes more closer to the visual.

no strong opinion on if/ternary

binaries/data/mods/public/gui/gamesetup/gamesetup.js
1153

yup inline

1395

missing negation

I just prefer well-defined tabs, "Miscellaneous" isn't. Ceasefire, ceasefire, lastManStanding are diplomacy settings. Dunno how that could be bundled best. Also can add the Misc tab as is if we can get combining victory conditions.

backdrop > the entire panel, or whatever

putted -> put

bb updated this revision to Diff 5391.Jan 20 2018, 11:51 PM
bb marked 2 inline comments as done.
bb added inline comments.Jan 20 2018, 11:54 PM
binaries/data/config/default.cfg
343

maybe Enable/Disable settings panel sliding

elexis accepted this revision.Jan 21 2018, 12:20 AM

Last version tested was good from the player perspective, besides the order. Now the order is good too. Before committing:

  • variable reference error spTips
  • config global should be inlined so that the option can change after init
  • SPtips.hidden unification not really achieved, but not important now

Thanks for the patch, an important milestone in the gamesetup era.

binaries/data/mods/public/gui/gamesetup/gamesetup.xml
204

z values set manually = dubious

binaries/data/mods/public/gui/options/options.json
367 ↗(On Diff #5391)

when opening or closing it

This revision is now accepted and ready to land.Jan 21 2018, 12:20 AM
bb added a comment.Jan 21 2018, 12:29 AM
In D1027#50196, @elexis wrote:
  • variable reference error spTips

also settingsPanel

binaries/data/mods/public/gui/options/options.json
367 ↗(On Diff #5391)

and resizing

bb added inline comments.Jan 21 2018, 1:30 PM
binaries/data/mods/public/gui/gamesetup/gamesetup.js
1151

missing {number} and cap

This revision was automatically updated to reflect the committed changes.
elexis added inline comments.Jan 11 2020, 3:29 AM
binaries/data/mods/public/gui/gamesetup/gamesetup.js
1147

Decoupled this from initGUIObjects in D2483.

1188

Decoupled chatPanel from settingTabs code in D2483.

1773

Decoupled biome, TriggerDifficulties and SettingTabsPanel in D2483.