Add-ons: checks for any that exist in the chosen other version but not in the current version.
Preferences: adds attributes that don't exist from the chosen other version's preferences that aren't in the current version's preferences. for attributes that exist in both, use the attributes from the file that was modified most recently.
Credentials: move if the credentials file doesn't exist.
Fixes#7936
* Moved the Show All Languages checkbox from the main body to the
bottom left of the dialog to save space and make it more obviously
connected to the listbox.
* Changed the Show All Languages checkbox label to reduce the word
count a tiny bit.
* Added text regarding translation percentages representing core
textdomains only.
* Added a link to gettext.wesnoth.org.
While it sounds like a great idea on paper, in practice having the
language column have the same height on all rows causes issues because
of at least one entry having an unusually tall label because of
non-Latin characters involved in it.
[label] does not support setting the vertical alignment of text — only
the vertical alignment of the widget itself can be set. This doesn't
help in this case because the widget is always as tall as its row —
it's the text's positioning that needs adjusting.
It turns out to be a better look to have all text be vertically
centered by not letting the label's height be dictated by the row's,
and let the layout engine center the label if needed for any reason.
This overhaul introduces a GUI option to show all languages regardless
of their completion threshold, as well as a side panel including a
general explanation of community translations and how players can
potentially contribute to them, plus a link to the main translations
page on the wiki.
A few points to make here:
* The URL points to the main page on purpose, since it's meant to be
a catch-all for all languages regardless of which one the player
has got selected or configured (those are two different things at
the moment).
* There's an issue where when showing all translations, some of the
non-Latin translation names cause the baseline of the language
name labels to end up entirely misaligned with the completion
labels. I am not entirely sure how to fix this right now.
* Showing all translations alters the dialog's layout permanently. I
believe there's no way out of this with the current GUI API.
* We use the stock text colouring function used for unit defence
values. This might not be entirely ideal because they are all very
green for translation stats above the minimum threshold, so there's
basically no variance by default until all translations are shown
together.
* An idea could be to add a link to the gettext.wesnoth.org stats
page in the dialog.
This version uses SDL_GetTicks() as a monotonic source to avoid the
previous version's pitfalls, namely the fact that the game's framerate
may not necessarily be a constant, and in particular, the old code
assumed a completely different framerate than what we ended up with
after the texture-based rendering changes in 1.17.x, resulting in an
almost-unnoticeable text fade due to the update() function being
called WAY more often than before.
Note that the reliance on SDL_GetTicks() means the timings break
at some point after 49 days of game runtime, exactly once. This
should result in a visible "jitter" effect if the 32-bits ticks value
wraps around in the middle of a fade sequence, but other than that
it's not that big of a deal to warrant requiring SDL 2.0.18+ for the
64-bit version.
(cherry picked from commit db30ca53ae)
Fixes the following bugs :
Stop scroll_text from growing infinitely and instead show the
scrollbars when the text dimensions exceed the default size of
the underlying multiline_text in some dialogs (such as edit_pbl,
the pbl publishing editor).
Allow horizontal_grow/vertical_grow to work correctly. Currently,
the widget stops vertically growing due to absence of
max_height=0, again in some specific dialogs.
selected schedule will write to utils/schedule.cfg on scenario save
HOTKEY_EDITOR_CUSTOM_TODS is disabled unless user loads scenario
custom_tod:Preview button and associated callback added.
editor:translatable attributes now written with leading underscore
editor:support for multiple custom time schedules
* Duplicated text
* Favour generic term 'file manager' over Microsoft terminology.
* Clarify language code use.
* Replace inconsistent spelling of 'add-on'.
The key word of course being "start". This PR changes the editor by default to work at the add-on level instead of in its own separate scenarios and maps directories. The goal is to make the editor more useful generally, but also specifically to make it much easier for players to distribute content they create using the editor:
* When they click the Editor button on the main menu, they will first be prompted to choose an add-on (or mainline), or to create a new add-on.
* When saved, if the scenario cfg is in the format previously generated by the editor, it will be converted to the new format and to use the [multiplayer] tag, the map_file attribute, and have the map data saved to a separate .map file.
* Relatedly, the editor now knows how to handle scenarios with the map_file attribute at all (which yes, does mean that currently wesnoth's editor doesn't know how to load its own mainline scenarios from their cfg).
* When opening the file chooser dialog, it now defaults to their selected add-on's directory.
If they choose to create a new add-on, then the editor creates for them:
* a basic but functional _main.cfg.
* an empty achievements.cfg (at this point mostly just so they might see it at some point and realize achievements exist, but ideally an achievements editor dialog could be created eventually).
* an empty _server.pbl file.
* a proper add-on directory structure containing the standard set of folders (maps/, scenarios/, units/, utils/, images/, etc).
Additionally, as an initial proof of concept for actually using this new add-on level functionality, a new Add-ons dropdown has been added to the editor's top bar, with a pbl editor option. This allows populating the blank _server.pbl file as well as editing an existing _server.pbl. There is also an option to change the add-on's ID, which will update the add-on's folder name and _main.cfg.
Misc other changes:
* The ability to add a recruit list to a side has been added back as a text box on the edit side dialog. While admittedly this doesn't allow players to select units from within the editor itself, it does set the actual side's recruit list (rather than a specific unit's extra_recruits), will show the user what the current recruit list for the side is (which the previously removed implementation didn't show anywhere), and correctly sets the faction as Custom so that the recruit list is used.
* When saving an old-style editor scenario, everything that can be triggered via [event] is either moved to a start event with a specific id attribute. Exceptions to this are [time], [side], and [side][village]. This is done so that the editor can know (for the most part) what things are actually its own to safely replace. As such, aside from the three previously mentioned tags plus the start event, any other WML added to a scenario by a UMC author is preserved rather than being overwritten - the editor no longer replaces the entire contents of the scenario file.
* The editor no longer writes out cfg files missing the top level scenario tag. If it doesn't find one or this is the first save of a new scenario it defaults to [multiplayer], but otherwise it will properly handle finding [test] or [scenario] as well.
* Requires that map files have the .map extension and scenario files have the .cfg extension. Also it assumes that .map files do actually only have map data in them and the .cfg files do actually have valid WML in them. I understand that this is not a limitation it had previously, but I don't think this is an unreasonable thing to require.
* Addresses part of #7667 by just not using regex for figuring out the map_data attribute value.
Additionally, it is not possible to change the currently selected add-on without going back to the main menu, clicking the editor button, and choosing a different add-on. This is intentional - I don't want to deal with having multiple add-ons open at the same time. If someone feels really strongly otherwise, then they can implement that themselves later.
* Resolution options now use "Window size" instead since it is more
accurate to the current implementation of fullscreen
* Theme becomes "Interface theme" to make its meaning clearer in the
absence of additional built-in themes
* "Automatic pixel scale multiplier" just becomes "Automatic scale"
since the rest can be inferred from the context of the option being
located right under the Pixel scale multiplier slider
This regroups some of the display options together in more logical
blocks:
- Limit FPS and VSync with Resolution and Pixel scale multiplier
- Theme and Show floating labels/team colors/grid
- Animated map and Animated water
- Show unit idle/standing animations
(Unwieldy diff because of all the grid reshuffling)
* Make the label more compact for translations ("Log File" instead of
"Open Log File")
* Make the tooltip slightly more specific about the file's identity
* Relocate the button to the bottom row to use real estate better
In commit fc7c87b765 someone missed the
logic surrounding the Open Log File button's setup that should've been
made not Windows-specific anymore.
This commit enables the Open Log File button back whenever Wesnoth has
a log file open for the current session. It also removes a few more
leftovers of the old Windows-specific UI layout path.