Charles Dang 063aa9b199 Hotkeys: refactored how hotkey_commands are stored and managed (WML hotkeys only)
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.
2022-05-26 02:43:15 -04:00
2022-04-05 10:34:19 +10:00
2022-05-11 09:18:14 -05:00
2022-05-15 17:29:35 +03:00
2022-05-22 11:07:44 +02:00
2022-05-12 08:46:15 -05:00
2020-11-19 16:49:32 -03:00
2022-03-09 15:01:37 -06:00
2022-03-09 15:01:37 -06:00
2022-05-22 10:45:17 -05:00
2022-05-15 09:43:37 -05:00
2021-11-28 14:26:02 -06:00
2022-05-03 20:36:00 -05:00
2022-03-12 13:47:46 -06:00

License: GPL v2

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:

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:

https://wiki.wesnoth.org/Create

Description
韦诺之战
Readme 9 GiB
Languages
INI 51.6%
C++ 35.9%
Lua 5.7%
Python 4.3%
Emacs Lisp 1%
Other 1.1%