I decided to go with a modular approach, where both in-game and editor UI dialogs inherit
from a single base class, a pointer of which is owned by the display class. That can be
used for common functionality that needs be shared by all in-game dialogs.
Right now the new UI is just static. It works with most stuff, but not key presses. Working
on that...
The old floating textbox was extremely entwined with the controller_base, play_controller, and menu_handler
classes. controller_base::have_keyboard_focus essentially controlled whether some events were executed based
on whether the floating textbox was open or not. Additionally, those events weren't even reached if a UI dialog
was open at all.
The new design features a singleton console class that can be called from anywhere, not just the game. I've also
decoupled the execution object from play_controller. The relevant functions in menu_handler are now passed to
the console as callbacks.
To work around map events such as clicking not being available if the console was open, I removed the exclusionary
is-in-dialog check from controller_base::handle_event and instead exit early out certain types of events using
controller_base::have_keyboard_focus. As mentioned in the accompanying comment, this isn't the best solution, but
it will do for now.
The new console also isn't fully feature-comparable with the old GUI1 one. The following are still missing:
* The checkbox, for use when sending messages.
* Tab completion.
* A crash occurs when existing the app if a game was exited with the console open.
I'm leaving the old floating_textbox code around for now for reference.
Originally was going to do this as workaround for the background tiling over the borders,
but I fixed the root cause of that instead. Still, this just makes more sense.
This entirely refactors surface blitting out of the canvas. Instead, each canvas owns a texture. This texture
is completely redrawn any time the canvas if marked dirty, else the result is cached and drawn to the screen
each draw cycle.
All windows are now redrawn every draw cycle. The use of the cached canvas textures means there's no noticeable
performance difference (likely a performance gain, actually) from using surface blitting.
There's still some code to clean up and a few things to fix.
* Added textdomain closure missing from 267510ea076ce317d323da54bb81ccd255b93284
* Avoid use of invalidate_layout by having an em dash in the size field prior to
saving. That's needed since GUI2 doesn't expand the label's canvas if its text
is initially empty.
* Use a better button definition for the View button.
* Grouped Save and Close buttons together
I'm going to merge this, possibly for git-illiteracy reasons, but if this causes problems, it doesn't have to permanently taint the stable branch. We can fix it later.
- Fix the rabbit AI
- Enable invoke_synced_command to also call (some) built-in commands
and give an error message in the case of an unknown command
- Remove some unnecessary implementation details
Objectives: note that the death of Galtrid is a losing condition
Reinforcements: In multiplayer, Landar's L3 troops that join on turn 9
now join his side, instead of trying to join side 13 (and ending up on
Kalenz' side).
Dialog: the following conversation happened on both turn 1 and turn 9.
Having 6 repeated messages in a row gave a strong sense of deja vu,
and I thought that a bug had repeated an event. This commit cuts the
repetition.
* Elf: "Kalenz! We come to fight beside you!"
* Kalenz: "Where is the rest of the elvish army? ...
* Elf: "The Great Council has decided it was too risky ...
* Landar: "That is well! If the Ka’lian is too fearful or blind ...
* Cleodil: "It is not well that we have become so divided as this."
* Kalenz: "No, it is not. But ...
- Grant Marauder the mountain movement+defense of the Raider
- Reduce Raider hills defense to match the Marauder
(avoiding reduction on level-up)
- Adjust Marauder resistances
* Initial pass at sun singer animations
* adding sun-shyde and generalizing fire animations
* sun-singer healing anim, and change of default image
* mystic healing animation, and move mystic images to sub-directory
* harmonized sprite file naming scheme for sun-shyde with sun-singer
In particular, this allows the player to choose the filename before saving,
including the extension. If support for target format is present, Wesnoth
honors the extension and saves the screenshot in that format.
I also changed the default screenshot format back to PNG due to quality
issues JPEG has with pixel art. See discussion in pull request #2655.
This commit doesn't introduce any string changes. I used existing strings
for everything (sometimes having to take them from another textdomain).
fixes#1649 . ai.synced_command could easily be used to implement all types of
undeteced cheats so it was removed. As a replacement this commit adds a
[custom_command] synced command that just calls
wesnoth.game_events.on_synced_command which calls a lua handler that
must first be set.
[ci skip]
Fixes map borders drawing over certain editor overlays. Not sure why UMC editor overlays
weren't affected...
Should also preempt other such issues, since we always want borders to draw on top of
everything.