Commit graph

557 commits

Author SHA1 Message Date
Toom
cac16cbdf1
add tooltip to [unit_vision] (#9191)
closes #7636
re #6021
re #5575
2024-08-18 17:00:06 -05:00
Iris Morelle
3a8c7303e7
editor: Implement a Show Tool Information toggle option
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.
2024-08-01 13:17:05 -04:00
Subhraman Sarkar
103b80ff01
Editor enhancements (#8903)
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)
2024-06-29 21:56:54 +05:30
Marcus Örnås
d3b3c8c07a Add a "Teleport Unit (Debug!)" option to debug menu
Fixes #5649
2024-04-18 18:24:56 -05:00
Subhraman Sarkar
0b646dec8a New Unit Type Editor UI in Scenario Editor 2024-03-26 13:23:38 -05:00
doofus-01
450ab7959b minor cleanup of theme font macro 2024-03-10 14:07:13 -04:00
Subhraman Sarkar
18086e78ae
Hotkeys (#8249)
Shortcut keys for map editor
2024-01-20 19:32:31 -06:00
AugustVesterbacka
3127629f59
Mousing over a village shows the owner side in the UI (#7920)
Added village owner flag and side icon to terrain info field
2023-10-15 14:51:48 +02:00
Pentarctagon
10997c39a3
Start giving the editor add-on level functionality. (#7719)
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.
2023-07-19 15:00:14 -05:00
gfgtdf
bf63ff3e9b seperate menu for quick replays 2023-06-03 15:56:01 +02:00
Celtic Minstrel
3c4c1c27f8 Add achievements to the in-game menu 2023-04-29 18:14:19 -04:00
Steve Cotton
80ce5e2a23 Delete an out-of-date comment in data/themes/default.cfg
The level isn't to the right of the alignment any more, the
workaround that the comment refers was removed in ca2eec45b9.
2023-02-08 09:01:52 +01:00
Tommy
90224728c1 Fix "def" label width in default theme
Fixes #6872
2022-07-15 13:38:51 +12:00
Tommy
cf4c265fc3 Fix wmlindent complaint. 2022-06-17 03:31:10 +12:00
Tommy
8380e018f5 Fix low-res themes during replay.
This was mentioned as a comment in #5620.
2022-06-17 03:02:38 +12:00
Tommy
9615236ae0 Fix low-res editor themes.
Fixes #5620.
2022-06-17 02:04:42 +12:00
Tommy
91fd53ac45 Fix "End Turn" button placement on low-res themes.
Fixes #6544.

I am not sure how this was even remotely working as it was.
2022-06-17 02:04:42 +12:00
Gunter Labes
ce9981e537 editor: Add "Map Screenshot" item to menu 2021-12-21 16:54:39 +01:00
Steve Cotton
b8400b5b72 ui: Fix 800x600 theme's sidebar tooltips
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)
2021-11-24 00:38:49 +01:00
Celtic Minstrel
0c42cdc038
Enable translation mark validation by the schema (#5800)
- 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.
2021-06-14 23:59:52 -04:00
Iris Morelle
fd37a05ffe ui: Claim back unused space from the 800 px minimap theme
This allows the minimap widget to be 2 pixels wider, and frees up 7
pixels of vertical space for the rest of the sidebar
2021-03-24 04:23:25 -03:00
Iris Morelle
5f462c6064 ui: Remove orphaned references to the zoom slider 2021-03-24 04:05:18 -03:00
Iris Morelle
73e5bff25c ui: Remove unused zoom slider portion of the minimap panel
This allows us to claim back 10px for the rest of the sidebar.
2021-03-24 04:05:18 -03:00
Iris Morelle
e7d1a5dc8a ui: Handle the battery/countdown report switcheroo differently
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.
2021-03-18 20:27:57 -03:00
Iris Morelle
2c540ccfce ui: Anchor the Observers icon to the sidebar, going right to left
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
2021-03-18 20:27:57 -03:00
Iris Morelle
0d3517e7aa ui: Fix bad x position for the theme UI battery status on low resolutions 2021-03-17 23:40:29 -03:00
Iris Morelle
7713437085 ui: Reduce font size for the ToD counter
*Should* generally fix counters like 14/15 getting ellipsized. There was
no real reason for it to be so large to begin with.
2021-03-17 20:20:56 -03:00
Iris Morelle
ffbc7ebc57 ui: Rearrange and resize the unit vision and XP labels slightly
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
2021-03-17 19:43:47 -03:00
Iris Morelle
579610498a ui: Reduce unit HP/XP/MP/Def font sizes and line heights on 1024x600
Fixes the unit name overlapping the MP and defense reports.

CC #5575
2021-03-17 04:34:24 -03:00
Iris Morelle
97ece89aeb ui: Fix font and box sizes for unit defense labels on the sidebar
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.
2021-03-17 04:21:43 -03:00
Iris Morelle
c611128112 ui: Rearrange Menu menu items more logically
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.
2021-03-14 20:16:13 -03:00
Pentarctagon
c8666a8a41 Remove the editor option to assign a recruit list to a unit.
The UI implementation of this is bad enough that I consider its presence to actively a detriment to anyone trying to use the editor.
2020-12-15 23:41:55 -06:00
Pentarctagon
f39bd33899 Remove a few bits of never implemented editor features.
The sound source tool in particular, since showing a button to players whose only function is to tell them it's not implemented makes no sense.
2020-11-03 15:30:57 -06:00
Celtic Minstrel
fab490cf60 Add ThemeWML and HelpWML to the schema
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.
2020-10-24 15:04:46 -04:00
Glen Whitney
6d935302a7 Update editor cfg file to reflect earlier changes in scaling
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.
2020-10-10 20:53:19 -07:00
Glen Whitney
2e6a043c1a Fix issue #4909. 2020-05-22 13:33:18 -05:00
Iris Morelle
f4ca974cd1 Disambiguate uses of the Play button label
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]
2019-11-10 23:43:05 -03:00
Charles Dang
e718d1e472 Removed Classic theme
[ci skip]
2019-11-04 17:07:36 +11:00
Charles Dang
baec45fc53 Fixed turn display at ridiculously tiny res
[ci skip]
2019-10-18 15:30:21 +11:00
Charles Dang
cb35e6885f Ensure enough space to display turn numbers in the hundreds
[ci skip]
2019-10-18 15:30:18 +11:00
josteph
416c0f2734 Editor: Fix palette size
Issue #2618.
2019-10-16 05:11:13 +00:00
Wedge009
798bae668c Add zoom options to context menu.
Resolves #1213

(Alternatively could go in main menu (from the top-bar) but I feel it's crowded enough already (unless we have nested menus available).)
2019-10-16 15:27:49 +11:00
josteph
b4e977555b themes: Remove the brief top bar tooltips
These are the tooltips of the images. Mousing over the figures next to
the images shows a more verbose tooltip.

For #1068/#1060
2019-09-14 12:44:24 +00:00
Wedge009
e2c20e5563 Restore defence modifier display in side-bar
Fixes #3693, based on 47bd5ade.

[ci skip]
2019-09-07 22:50:02 +10:00
josteph
08352d2ab4 theme: Add optional argument to REPLAY_THEME for the benefit of user-defined themes
See #4184
2019-08-10 20:09:36 +00:00
Steve Cotton
862e482895 Add a hint about not save-loading, and link to it from the "Back to ..." menu 2019-08-03 20:05:27 +02:00
josteph
e4cb8efc03 Theme: Remove the empty replay-label from the replay theme. 2019-02-24 17:11:57 +00:00
jostephd
40fbb6dc43
Merge pull request #3731 from jostephd/sidebar-changes
Several sidebar changes
2019-01-07 21:05:39 +00:00
Jyrki Vesterinen
2753b6617b Fix issues with classic theme 2018-11-26 20:10:07 +02:00
Jyrki Vesterinen
e9a6b95fd8 Better implementation of placing the clock (resolves #3582) 2018-11-18 19:52:24 +02:00