patch #558: Adds an option to adv. prefs to enable/disable mouse scrolling

This commit is contained in:
Patrick Parker 2006-06-07 23:45:30 +00:00
parent f26ce19980
commit 7392b890cc
5 changed files with 17 additions and 1 deletions

View File

@ -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,

View File

@ -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

View File

@ -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());

View File

@ -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";

View File

@ -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();