Daniel Santos 2578e9e2ef
Add lua mouse button event handler (#7952)
* Add lua mouse button event handler that can be consumed.
* Fix middle-mouse down/click not getting sent to lua

This is a flexible event handler mechanism to allow for more advanced
add-on features. It does not allow the add-on to consume the value
however, so there's no mechanism for the add-on to requrest the default
action not be executed.

We would normally deal separately with mouse down, up and click, with
the later being an event where the mouse has gone both down and up on
the same UI component. However, Wesnoth's code seems to allow a mouse up
on many UI components to serve as a click, so this implementation
follows that behavior.

This addresses issue #7949

The mouse handling code needs an overhaul, so this patch works with it
in it's current state in the best possible way. The revised code
attempts to restrict clicks to those events where a mouse went both down
and up on the same map tile. It is able to do this with the right mouse
button as well as X1 and X2, but must work as existing click events are
treated for now.

This means that "left click" is managed via the `left_click()` function
which occurrs at mouse down, "right click" via `right_mouse_up()` when
the right mouse button comes up, and the middle button's click behavior
is coded directly into mouse_handler_base::mouse_press() (so no function
is called) and "clicks" when the button comes down. The new
`on_mouse_button()` code will allow the mod developer to consume any
click event, preventing the default behavior, and also receive event
callbacks for up and down events, although the return value is ignored
for these calls and left and middle click occur on mouse down.
2023-10-17 00:08:00 -04:00
2023-10-02 19:43:24 -05:00
2023-09-16 22:43:09 -05:00
2023-08-20 19:45:47 -05:00
2023-10-14 10:43:11 +02:00
2023-09-16 22:42:30 -05:00
2023-08-20 19:45:47 -05:00
2023-10-10 12:20:23 -05:00
2023-09-19 22:50:08 -05:00
2023-08-20 19:45:47 -05:00
2023-09-19 22:50:08 -05:00

License: GPL v2

Branch CI status
Master CI
1.16 CI

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, search for the key to immortality, or take part 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

Mastodon: https://fosstodon.org/@wesnoth

Steam forums: https://steamcommunity.com/app/599390/discussions/

Features

  • A variety of different campaigns, each with their own tactical challenges, emotionally charged story, and multiple difficulty levels.
  • A detailed world and storytelling with hundreds of sprites, animations, and characters.
  • Many different unit skills and traits across several factions.
  • A map editor with multiple tools, hundreds types of terrain, and the ability for you to save and share maps with others. Create your own scenarios/battles for near infinite replayability.
  • Highly moddable, allowing a wide array of community created map packs, eras, and entire campaigns.
  • Online and local multiplayer gameplay to play with friends, strangers, or against the AI.
  • Changeable settings for base gameplay, with nearly limitless options for different hotkey configurations.
  • Beautifully composed playlist that captures the era and grandiosity of this lore-filled high-fantasy world.

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:

  • Simple tasks in C++.
  • The Lua and WML used for content scripting.
  • Python used by various external tools.
  • Even 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 in updating existing unit sprites or creating animations should take a look at the Art Contributions 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 Software in the Public Interest, 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

screenshot_main_menu scrreenshot_isars_cross screenshot_campaign_menu screenshot_map

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