This allows permanently hiding the obnoxious help text tooltip that
constantly dances between the top and bottom of the screen depending
on what you're doing in the editor.
Icons provided by babaissarkar.
Map/Scenario Editor
* Rename Load Map to Load Map/Scenario (since it can load both), Edit Scenario to Edit Scenario Settings, Save Map to just Save.
* Rearrange menu order
* Add icon for the preferences menu item (used the preexisting settings.png icon)
* Open folder correctly at Add-on's scenario directory instead of editor/scenarios. (#8910)
* Show Save Scenario As only for Scenarios
* Use the settings.png icon for Preferences menu item
* Add functionality to "Loyal" checkbox (Unit tool -> Place unit -> Right click menu) (#8445)
* Show warning when maps are saved in scenarios folder or vice versa (#8911)
* Unit List moved to Units menu from File menu to reduce some pressure from the latter.
* Status Table menu item disabled since it does nothing. (Should be reenabled once the functionality has been added.)
* Improve reload functionality in Editor (F5). Reload happens directly from memory and no temp files are needed. Also, the undo/redo stacks will be preserved. (#9024)
Time Schedule Editor
* Browse buttons now set wesnoth style paths instead of just pasting the absolute path returned by the file dialog
* Change text boxes from inactive to uneditable.
* Code generation improvements
* Add copyright notice to tod_new_schedule
* Confirmation messages
* Preview buttons for image and sound files and new icons for the preview button (2 sets : preview image and preview sound)
Unit Type Editor
* Confirmation messages
* New icons for the preview button (2 sets : preview image and preview sound)
Add-on menu
* Two new menu entries for (1) opening the Add-on selection dialog, (2) opening the folder corresponding to the Add-on
The open add-on folder option shows a GUI2 file dialog at the add-on's folder which can be used to open any file. If it is a loadable map/scenario it will be opened in the editor, otherwise the OS's default application for that file will be opened.
File Dialog
* Redesigned with new icons
* New Open External button that opens selected file/folder in the platform's default application (independently of what pressing Open would do). This could be used to quickly open a folder or preview the file before actually selecting it.
* Extension checking and filename validation. (See #8911)
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.
Two changes in the theme config for 1024x600, which is inherited by the config
for 800x600. Both are the same line but otherwise only loosely related to each
other; together these fix issue #6264, which was that trigger areas for some
tooltips overlapped.
Reduce the width for the unit's name, thus giving the side-flag and side-number
(which get the remaining horizontal space) enough space to display themselves.
128 pixels wide is the same as the name gets in larger themes, even though
those larger themes use larger font sizes. This means that the side number
doesn't get ellipsed, at least for games with up to 9 sides, with the
side-effect that the tooltip can be displayed when hovering over the flag.
Move the name, and thus the flag and side-number down by 1 pixel, so that they
don't overlap with the tooltip trigger areas for movement points and terrain
defense. The name's location is based on the placement of `unit-box-botleft`;
the theme for larger screen-sizes similarly adds 5 pixels of padding because
the `unit-box` is only 72x72 for the image, and the text areas for movement
points and defense go lower than that.
(cherry picked from commit 0d4854d5ff)
- The t_string type is now a schema built-in type and no longer attempts a regex match.
- You can also specify that non-t_string types may be optionally-translatable; this case supports a regex match on the string (but note that the translation mark is not part of the match).
- Error messages involving keys with very large values ( > 128 characters) will now truncate the value.
- To account for occasional cases where the schema is intentionally violated, the --validate command-line option now automatically defines the SCHEMA_VALIDATION preprocessor define.
A key validates as type t_string if one of the following is true:
- The key is not present
- The key has at least one segment with a translation mark
- The key is blank (an empty string)
Any type other than t_string is not allowed to be translatable by default, unless you specify allow_translatable=yes in the [type] tag.
An optionally-translatable string could also be defined as a union of t_string and some other type.
This fixes the countdown report (a.k.a. clock) using the wrong font size
at small resolutions, as well as taking over the battery report's box
without resizing it and thus running out of horizontal room most of the
time.
This also removes two broken references to "timeout-panel" and
"report_timeout", neither of which being names that actually exist in
this version of the theme.
Supersedes 9e0593d714, which attempted to
fix the issue with the icon displaying at unexpected places by anchoring
it to the battery display from the left instead of staying true to the
intended design.
CC #5575
This makes it so the unit vision label uses a smaller font on smaller
resolutions. It also makes it so it doesn't take space away from the XP
report for all resolutions. Meanwhile, the XP report has more space.
CC #5575
This fixes the "def" label (previously unknown to everybody before the
sdl_ttf_compat API transition!) having the wrong box size and alignment.
This also extends to its accompanying unit defense report, which had the
wrong font size entirely.
This changes the position of Statistics, Status Table and Unit List
according to their respective likelihood of being used and relabels the
Back to submenu to Load Turn and brings it right under Load Game.
The change in theme.cpp is just to make the "title_literal" key be consistently applied as documented. Since the key isn't used in mainline, it should have no effect on actual uses.
Commit 43de778 made all themes scale from their base dimensions rather
than from an arbitrary hard-coded 1024x768 pixel size. As a result, the
800x600 layout for the editor needs its main map explicitly sized --
the 843-pixel width no longer fits in 800x600, and it isn't being scaled
down from 1024. (But once it is explicitly set for the 800x600 layout,
it will scale up for pixel widths between 800 and 1024). This commit
adds such an explicit sizing, analogous to the one found in default.cfg.
Resolves#5193.
This extends to a few other button labels used for replay control. While
checking if commit 46dbbc06c9 was fit for
backporting to 1.14 I found out that "Play" was already in use
exclusively for one of the replay control buttons (which means, no, it
can't be backported). This makes the disambiguation markers absolutely
necessary.
To give a more practical example of why this is a big deal, in Spanish,
"Play" would be translated as "Jugar" in the context of the Campaigns
menu, and "Reproducir" in the context of a replay (or movie). The
Spanish translation in fact already uses the latter in both 1.14 and
master.
[ci skip]