New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Campaigns menu overhaul #5358
Campaigns menu overhaul #5358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty nice.
One think that immediately stands out to me is that Modifications section. It should be aligned with the left window edge. |
Perhaps the combat descriptions can be moved to a linked help page instead. |
CC: issue wesnoth#4543 (N.B. This is a monolithic mega-commit because of a bunch of experimental phase changes that necessitated constant changes to both engine code and UI WML.) This redesigns the campaign selection dialog implementing a campaign-defined background image that changes depending on the selected campaign, specified by the [campaign] background= attribute; adding a menu button for selecting the RNG mechanism in use (default RNG vs. predictable RNG a.k.a. "save random seed"); and finally, adding a menu button for selecting the campaign difficulty without having to go through the campaign difficulty selection dialog. A huge amount of changes to the UI WML were required for this to say the least. This also adds the following new widget definitions: * toggle_button: listbox_header_centered, listbox_header_bg, listbox_header_centered_bg * panel: panel_listbox_bg, campaign_menu_bg As a side effect, two private methods in gui2::dialogs::campaign_selection() are no longer const-qualified. No idea why they were const-qualified in the first place, but it interferred with some of the new code in a major way.
This removes the use_prng Advanced Preferences option and replaces it with a new possible value for randomness in the game classification class, "biased". It also changes the enumeration label for it in the GUI2 campaign dialog. It also makes it so the synced RNG is automatically used with this option as well as the existing deterministic randomness option ("save random seed").
This brings back laurels for the difficulty menu. Because I really don't want to break into menu_button's implementations details just yet, this is a bit of a hack using the BLIT IPF instead of stacked_widget. To make up for it, this version uses the three different difficulty laurels depending on the difficulty being displayed, instead of always using the standard laurel.
d2c7b36
to
42ee3b1
Compare
I thought about this, but that would mean adding a new help page and hoping for people to click on a somewhat unrelated element in the dialog (a new Help button) to figure out what the option does. On the other hand, it turns out that tooltips do work with dropdown menu items as one would expect them to do without any issues: |
The opacity used here for the fill colour is identical to the one used in the image file.
It's more elegant in context than "dates".
This makes the row actually take up its full horizontal space and spaces out the columns very slightly while still allowing them to be usable at 800x600. It also replaces the overlong detailed descriptions for the options in the Combat menu with tooltips holding the same contents.
@nemaara Once this is merged, can you take a look as far as adding backgrounds for the mainline campaigns? |
After consulting with @Pentarctagon and @Vultraz, we've decided to merge as-is. The PR is still here for @gfgtdf's reference if he becomes able to review the engine changes at a later time. |
I dislike the description of the Biased RNG. It seems to imply that the regular RNG doesn't obey the true probabilities, even though it doesn't actually say that. I'm not sure how to word it better though. |
Now that this has been merged, I have two comments.
|
This overhauls the game's Campaigns menu following some of the directions previously suggested in issue #4543.
Requesting reviews from @Vultraz for the UI layout and code changes, @gfgtdf for the engine changes, and @Pentarctagon and @nemaara for the core changes to the single-player campaign UI flow.
User interface changes
WML changes
background=<image path>
is added to top-level[campaign]
to allow specifying a custom background image for the main panel. In the absence of this, a default image is used (currentlystory/landscape-battlefield_nohumans.jpg
).random_mode=
attribute in game classification has a new possible value,biased
, which selects the predictable RNG as with the Save random seed option before but also enables the RNG bias logic in the attack engine (previously the experimental PRNG option). The logic in theattack
constructor may now be slightly redundant since it shouldn't be possible forrandom_mode
to bebiased
andrandomness::generator->is_networked()
to return true (@gfgtdf may want to confirm this).toggle_button
widgets gain new definitions:listbox_header_centered
(unused),listbox_header_bg
(unused),listbox_header_centered_bg
(used by this PR for the campaign list header row).panel
widgets gain new definitions:panel_listbox_bg
(used by this PR for the campaign list header row),campaign_menu_bg
(used by this PR for the main campaign menu panel).Known issues
[difficulty]
WML as well as the description in order for the labels to make sense (e.g. for HttT, the difficulty labels would be the rather meaningless "Fighter", "Commander", "Lord" otherwise). The problem arises from the possibility of[difficulty]
descriptions using Pango markup that will look plain wrong on the menu button proper's label. We don't seem to have a function to unescape markup entities and strip Pango markup at the moment, so this is left unsolved in the PR for the time being.first_scenario
. I would greatly appreciate some input on this particular point for this PR and others.campaign_menu_bg
definition forpanel
). I don't feel we can do anything about this short of adding shadows or (preferably) outlines to the text.multi_page
remembers the scrollbar position for each page and I can't quite decide if this is desirable behaviour or not.Reference/test material
Original Experimental PRNG option patch
See commit 3f06813 and the forum thread, both by Dave.
Background image test patch
See https://gist.github.com/shikadiqueen/e66d433d9ee0d6dd4915f986d6658c38.