Skip to content

Commit afa3c94

Browse files
committed
Rename revert_mouse to invert_mouse
That is more conventional and correct as "revert" could mean "undo"
1 parent 933201a commit afa3c94

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

libs/s25main/Settings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void Settings::LoadDefaults()
138138
// interface
139139
// {
140140
interface.autosave_interval = 0;
141-
interface.revert_mouse = false;
141+
interface.invert_mouse = false;
142142
// }
143143

144144
// addons
@@ -295,7 +295,7 @@ void Settings::Load()
295295
// interface
296296
// {
297297
interface.autosave_interval = iniInterface->getIntValue("autosave_interval");
298-
interface.revert_mouse = iniInterface->getBoolValue("revert_mouse");
298+
interface.invert_mouse = iniInterface->getValue("invert_mouse", false);
299299
// }
300300

301301
// addons
@@ -451,7 +451,7 @@ void Settings::Save()
451451
// interface
452452
// {
453453
iniInterface->setValue("autosave_interval", interface.autosave_interval);
454-
iniInterface->setValue("revert_mouse", interface.revert_mouse);
454+
iniInterface->setValue("invert_mouse", interface.invert_mouse);
455455
// }
456456

457457
// addons

libs/s25main/Settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class Settings : public Singleton<Settings, SingletonPolicies::WithLongevity>
104104
struct
105105
{
106106
unsigned autosave_interval;
107-
bool revert_mouse;
107+
bool invert_mouse;
108108
} interface;
109109

110110
struct

libs/s25main/desktops/dskGameInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ bool dskGameInterface::Msg_MouseMove(const MouseCoords& mc)
691691

692692
int acceleration = SETTINGS.global.smartCursor ? 2 : 3;
693693

694-
if(SETTINGS.interface.revert_mouse)
694+
if(SETTINGS.interface.invert_mouse)
695695
acceleration = -acceleration;
696696

697697
gwv.MoveBy((mc.GetPos() - startScrollPt) * acceleration);

libs/s25main/desktops/dskOptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ dskOptions::dskOptions() : Desktop(LOADER.GetImageN("setup013", 0))
247247
_("When scrolling the map with the mouse move the camera."));
248248
invertScroll->AddTextButton(ID_btOn, curPos + ctrlOffset2, ctrlSize, TextureColor::Grey, _("Inverted"), NormalFont,
249249
_("When scrolling the map with the mouse move the map."));
250-
invertScroll->SetSelection(SETTINGS.interface.revert_mouse);
250+
invertScroll->SetSelection(SETTINGS.interface.invert_mouse);
251251
curPos.y += 30;
252252

253253
groupAllgemein->AddText(ID_txtSmartCursor, curPos, _("Smart Cursor"), COLOR_YELLOW, FontStyle{}, NormalFont);

libs/s25main/ingameWindows/iwObservate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ bool iwObservate::Msg_MouseMove(const MouseCoords& mc)
231231
{
232232
int acceleration = SETTINGS.global.smartCursor ? 2 : 3;
233233

234-
if(SETTINGS.interface.revert_mouse)
234+
if(SETTINGS.interface.invert_mouse)
235235
acceleration = -acceleration;
236236

237237
view->MoveBy((mc.GetPos() - scrollOrigin) * acceleration);

libs/s25main/ingameWindows/iwSettings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ iwSettings::iwSettings()
6262

6363
AddCheckBox(ID_cbInvertMouse, DrawPoint(15, 124), Extent(150, 26), TextureColor::Grey, _("Invert mouse"),
6464
NormalFont, false)
65-
->setChecked(SETTINGS.interface.revert_mouse);
65+
->setChecked(SETTINGS.interface.invert_mouse);
6666
AddCheckBox(ID_cbStatisticScale, DrawPoint(200, 124), Extent(150, 26), TextureColor::Grey, _("Statistics Scale"),
6767
NormalFont, false)
6868
->setChecked(SETTINGS.ingame.scale_statistics);
@@ -105,7 +105,7 @@ void iwSettings::Msg_CheckboxChange(const unsigned ctrl_id, const bool checked)
105105
{
106106
switch(ctrl_id)
107107
{
108-
case ID_cbInvertMouse: SETTINGS.interface.revert_mouse = checked; break;
108+
case ID_cbInvertMouse: SETTINGS.interface.invert_mouse = checked; break;
109109
case ID_cbStatisticScale: SETTINGS.ingame.scale_statistics = checked; break;
110110
}
111111
}

tests/s25Main/integration/testDskGameInterface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void checkNotScrolling(const GameWorldView& view, Cursor cursor = Cursor::Hand)
6767
BOOST_FIXTURE_TEST_CASE(Scrolling, GameInterfaceFixture)
6868
{
6969
const int acceleration = 2;
70-
SETTINGS.interface.revert_mouse = false;
70+
SETTINGS.interface.invert_mouse = false;
7171

7272
Position startPos(10, 15);
7373
MouseCoords mouse(startPos, false, true);
@@ -95,7 +95,7 @@ BOOST_FIXTURE_TEST_CASE(Scrolling, GameInterfaceFixture)
9595

9696
// Inverted scrolling
9797
{
98-
SETTINGS.interface.revert_mouse = true;
98+
SETTINGS.interface.invert_mouse = true;
9999
WINDOWMANAGER.Msg_RightDown(mouse);
100100
startPos = mouse.pos;
101101
BOOST_TEST_REQUIRE(WINDOWMANAGER.GetCursor() == Cursor::Scroll);
@@ -106,7 +106,7 @@ BOOST_FIXTURE_TEST_CASE(Scrolling, GameInterfaceFixture)
106106
BOOST_TEST_REQUIRE(view->GetOffset() == pos - acceleration * Position(4, 3));
107107
mouse.rdown = false;
108108
WINDOWMANAGER.Msg_RightUp(mouse);
109-
SETTINGS.interface.revert_mouse = false;
109+
SETTINGS.interface.invert_mouse = false;
110110
}
111111

112112
// Opening a window does not cancel scrolling

0 commit comments

Comments
 (0)