
This encompasses two closely related changes. First, we now store hotkey_commands in a map instead of a vector with accompanying index map. Most code did not rely on the command container being contiguous, and since the commonly used get_hotkey_command was already performing a lookup in the index map, there wasn't much need to use a separate container. Associative storage makes the most sense here. The one place that did rely on the command container being contiguous was remove_wml_hotkey. I realized, however, that it would be much cleaner to eliminate the manual bookkeeping. To this end, I added a new wml_hotkey_record RAII class. It registers a hotkey_command when created and removes it on destruction. Using a map for the commands made this even easier, since it doesn't invalidate other iterators or require other commands to be moved to keep the container contiguous. In addition, removing the secondary index map means we no longer need to recreate that every time a wml hotkey is removed! Switching to this RAII-based system means delete_all_wml_hotkeys could also be removed, since all WML hotkeys should now be handled by wml_hotkey_record and clean themselves up on destruction. clear_hotkey_commands was also removed, since it was both misleading and now unnecessary. It only cleared the index map, not the actual list of hotkey_commands! Given that init_hotkey_commands actually set up the command list, this was doubly confusing.
About
The Battle for Wesnoth is an Open Source, turn-based tactical strategy game with a high fantasy theme, featuring both singleplayer and online/hotseat multiplayer combat. Fight a desperate battle to reclaim the throne of Wesnoth, or take hand in any number of other adventures.
Community
The official Battle for Wesnoth Forums: https://forums.wesnoth.org/
Discord: https://discord.gg/battleforwesnoth
IRC: https://wiki.wesnoth.org/Support#IRC
Twitter: https://twitter.com/Wesnoth
Steam forums: https://steamcommunity.com/app/599390/discussions/
Installing
Wesnoth can be played on Windows, macOS, and Linux, and can be installed using:
- Steam (all)
- itch.io (Windows and macOS)
- The macOS App Store
- standalone installers on SourceForge (Windows and macOS)
- Flatpak (Linux)
Additionally, Wesnoth is available for iOS and Android.
To build the game from source, see INSTALL for instructions.
Contributing
Wesnoth is most in need of skilled C++ developers (C++14 and later), however there are things that nearly anyone can help with from simpler tasks in C++, the Lua and WML used for content scripting, Python used by various external tools, and even things like play testing and giving feedback on updated campaigns. Additionally, Wesnoth lacks art for a variety of unit animations - anyone who would be interested in lending a hand updating existing unit sprites or creating animations should take a look at the Art Forum as well as contact our current art director.
See also: CONTRIBUTING
For any questions, the best place to start is to simply join Wesnoth's forums, Discord, or IRC and start asking!
Donations
Donations can be sent via Liberapay as well as when downloading through itch.io. All money donated is used to pay for project expenses such as server rent and art commissions, and is very much appreciated.
License
All source code is licensed under the GNU GPL v2+. Most art and music is also licensed under the GNU GPL v2+, however new contributions are now licensed under the Creative Commons BY-SA v4.0. For more detailed information on Wesnoth's licensing, see the wiki:
https://wiki.wesnoth.org/Wesnoth:Copyrights
More Information
For extensive documentation about all aspects of the game, see the official Battle for Wesnoth web site:
https://www.wesnoth.org/ https://wiki.wesnoth.org/
A (translated) description of how to play the game can be found in doc/manual/manual.*.html, or online at:
https://wiki.wesnoth.org/WesnothManual
For information on creating your own maps, scenarios, and other content, see: