mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-28 09:58:15 +00:00
Add optional side filter to [scroll]
This commit is contained in:
parent
f3d777360c
commit
4cde487458
@ -118,6 +118,7 @@ Version 1.11.6+dev:
|
||||
* Allow numerical values for SideWML "controller" attribute.
|
||||
* Allow WML menu items to use hotkeys alongside/instead of the menu.
|
||||
* Really added sighted events for ambushing units.
|
||||
* [scroll] now takes an optional side filter.
|
||||
* Units:
|
||||
* Gave the Death Knight proper skeletal resistances, as well as submerge.
|
||||
* User interface:
|
||||
|
@ -1815,9 +1815,13 @@ WML_HANDLER_FUNCTION(role, /*event_info*/, cfg)
|
||||
|
||||
WML_HANDLER_FUNCTION(scroll, /*event_info*/, cfg)
|
||||
{
|
||||
game_display &screen = *resources::screen;
|
||||
screen.scroll(cfg["x"], cfg["y"], true);
|
||||
screen.draw(true,true);
|
||||
const std::vector<int> side_list = get_sides_vector(cfg);
|
||||
if ((cfg["side"].empty() && !cfg.has_child("filter_side")) ||
|
||||
std::find(side_list.begin(), side_list.end(), resources::controller->current_side()) != side_list.end()) {
|
||||
game_display &screen = *resources::screen;
|
||||
screen.scroll(cfg["x"], cfg["y"], true);
|
||||
screen.draw(true,true);
|
||||
}
|
||||
}
|
||||
|
||||
/// Experimental data persistence
|
||||
|
Loading…
x
Reference in New Issue
Block a user