mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-17 22:39:52 +00:00
patch #558: Adds an option to adv. prefs to enable/disable mouse scrolling
This commit is contained in:
parent
f26ce19980
commit
7392b890cc
@ -31,6 +31,7 @@ Version 1.1.4+svn:
|
||||
* new or improved sounds: holy magic, thorns, pincers
|
||||
* miscellaneous
|
||||
* added a generic scenario music macro and table of contents to utils.cfg
|
||||
* added an advanced preference to disable mouse scrolling
|
||||
* graphics
|
||||
* new attack animations: Curse, Drake Claws, Human Crossbow, Human Throwing Dagger,
|
||||
Ink, Orcish Bow, Orcish Crossbow, Orcish Spear, Slam, Tentacle, Thunderstick,
|
||||
|
@ -44,6 +44,13 @@ type=boolean
|
||||
default=yes
|
||||
[/advanced_preference]
|
||||
|
||||
[advanced_preference]
|
||||
field=mouse_scrolling
|
||||
name=_"Mouse Scrolling"
|
||||
type=boolean
|
||||
default=yes
|
||||
[/advanced_preference]
|
||||
|
||||
[game_config]
|
||||
base_income=2
|
||||
village_income=1
|
||||
|
@ -599,7 +599,7 @@ void play_controller::play_slice()
|
||||
SDL_GetMouseState(&mousex,&mousey);
|
||||
tooltips::process(mousex, mousey);
|
||||
|
||||
const int scroll_threshold = 5;
|
||||
const int scroll_threshold = (preferences::mouse_scroll_disabled()) ? 0 : 5;
|
||||
|
||||
if(key[SDLK_UP] || mousey < scroll_threshold)
|
||||
gui_->scroll(0,-preferences::scroll_speed());
|
||||
|
@ -762,6 +762,13 @@ bool show_floating_labels()
|
||||
return prefs["floating_labels"] != "no";
|
||||
}
|
||||
|
||||
bool mouse_scroll_disabled()
|
||||
{
|
||||
//enabled by default
|
||||
return prefs["mouse_scrolling"] == "no";
|
||||
}
|
||||
|
||||
|
||||
void set_show_floating_labels(bool value)
|
||||
{
|
||||
prefs["floating_labels"] = value ? "yes" : "no";
|
||||
|
@ -199,6 +199,7 @@ namespace preferences {
|
||||
void set_chat_lines(int lines);
|
||||
|
||||
bool compress_saves();
|
||||
bool mouse_scroll_disabled();
|
||||
|
||||
std::set<std::string> &encountered_units();
|
||||
std::set<std::string> &encountered_terrains();
|
||||
|
Loading…
x
Reference in New Issue
Block a user