The main problem was that the previous calculation was based on the 'caution' aspect. While that is not technically wrong, caution is also used for other purposes and there are mainline (and presumably UMC) scenarios that use large values for caution. In those cases, units retreated that were barely injured. This, again, might even be desirable for some use cases, but it needs to be decoupled from the other uses of caution. Thus, the new 'retreat_factor' aspect is used now.
In addition, the calculation is now based on a unit's maximum hitpoints, rather than its level.
Re-add the popup that appears when "Load" is pressed on the title screen if
there are no files, but now check for files from previous versions too.
Improve handling of switching from a version with files to a version without
files, disabling buttons on the load dialog when there are no files in the
current directory. Versions with no files will still be shown in the drop-down.
This adds a todo about the error path at the start of evaluate_summary_string,
this path is reached by creating empty files in the save dir. The dialog's state
is reasonable, so it seemed a low priority and I don't want to introduce new
bugs by refactoring this path now.
Deleting all files now doesn't automatically close the dialog.
As of PR #4963, the engine ignores all global tags defined by add-ons that are not active, that is, that are not used in the current game. Whether an add-on counts as active is determined based on a list of possible tags with add-on ids. The [test] tag is not included in this list, resulting in test scenarios in add-ons not working any more.
Still a lot of work left to do, but this initial commit focuses on
bringing the UI layout on par with mainline standards.
Notable remaining layout issues:
* Training pages don't have a proper caption.
* The Items page (previously Artifacts, relabeled Items for consistency
with the rest of the help text) has individual items grow the list
horizontally out of the page's bounds, resulting in a horizontal
scrollbar on the item list right now, or one on the whole window if
anything is done to prevent the former. There is currently no simple
way to fix this since labels in listboxes and treeviews grow
unchecked, rendering `wrap = true` moot.
* The Factions page seems to be designed to display a list of factions
but this doesn't seem to be used or working right now?
* The Settings page has some evidence of this having been user-made
content. We probably want to do away with some of it in mainline.
Maybe.
* The Feedback page screams UMC all over. It is also a bit useless
without gfgtdf around right now...
* Lots of questionable English or UI language around still.
* I don't like tree views.
Something that people occasionally miss is that several hotkey actions
double as menu items throughout the UI. Menu items have this particular
quality to them that requires them to be as succinct as possible to make
their meaning apparent without requiring excessive reading and parsing
from users/players. Furthermore, in a UI like ours with large elements
everywhere, we want to avoid excessively wordy elements that can become
ten times as long when translated into foreign languages.
Commit c42bf114249dcef5241327ca92214cf155ff89e8 replaced the Preferences
label with a unnecessarily longer version despite it being pretty
standard among most applications for it to be a single word (either
Preferences or Options or Settings). This commit reverts that.
Clear Chat and Errors (also from the aforementioned commit) is relabeled
Clear Chat rather than Clear Messages so it's clearer that it applies to
chat messages in particular and not anything else. On that note, the
fact that game diagnostics share real estate and infrastructure with
chat is really unfortunate but there's not much that can be done about
it at the moment. At least it is visually obvious that this is the case.
It's also rarely relevant (and most people won't think of entering
"error" into the hotkey filter before reporting the error somewhere).
View Chat Log is relabeled Chat Log since no other option deals with the
Chat *Log* in particular.
Scenario Objectives is relabeled Objectives because there really isn't
anything else that has objectives we can look at in the whole game.
Enter User Command is relabeled Enter Command so as to not sound
superfluous.
Additionally, the Quit to Main Menu action is relabeled just Quit to
Menu, which is closer to what the option actually does in MP games (quit
to lobby) without being inaccurate in either SP or MP (closes#2744).