diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-25 22:13:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-25 22:13:12 +0300 |
commit | c2b3279615398942adce087119bde9e4fcfd9ab0 (patch) | |
tree | 21b43a51e437f08ef661c7095facd16d0ad72518 | |
parent | fe64e7204c8ab7b91f36c305cce9f82e92792cb9 (diff) | |
download | manaplus-c2b3279615398942adce087119bde9e4fcfd9ab0.tar.gz manaplus-c2b3279615398942adce087119bde9e4fcfd9ab0.tar.bz2 manaplus-c2b3279615398942adce087119bde9e4fcfd9ab0.tar.xz manaplus-c2b3279615398942adce087119bde9e4fcfd9ab0.zip |
Remove command line option --default-cursor and add option --hide-cursor.s20170725
-rw-r--r-- | src/commandline.cpp | 4 | ||||
-rw-r--r-- | src/gui/gui.cpp | 8 | ||||
-rw-r--r-- | src/options.h | 4 | ||||
-rwxr-xr-x | tools/ci/scripts/runtest.sh | 2 |
4 files changed, 11 insertions, 7 deletions
diff --git a/src/commandline.cpp b/src/commandline.cpp index dc939786d..e1f7ebc20 100644 --- a/src/commandline.cpp +++ b/src/commandline.cpp @@ -162,7 +162,7 @@ void parseOptions(const int argc, char *const argv[]) { "renderer", required_argument, nullptr, 'r' }, { "server-type", required_argument, nullptr, 'y' }, { "enable-ipc", no_argument, nullptr, 'I' }, - { "default-cursor", no_argument, nullptr, 'q' }, + { "hide-cursor", no_argument, nullptr, 'q' }, { "error", no_argument, nullptr, 'e' }, { "validate", no_argument, nullptr, 'V' }, { nullptr, 0, nullptr, 0 } @@ -260,7 +260,7 @@ void parseOptions(const int argc, char *const argv[]) options.ipc = true; break; case 'q': - options.defaultCursor = true; + options.hideCursor = true; break; case 'e': options.error = true; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 28eef21dd..c27aeec35 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -258,8 +258,7 @@ void Gui::postInit(Graphics *const graphics) Widget::setGlobalFont(mGuiFont); // Initialize mouse cursor and listen for changes to the option - setUseCustomCursor(config.getBoolValue("customcursor") && - !settings.options.defaultCursor); + setUseCustomCursor(config.getBoolValue("customcursor")); setDoubleClick(config.getBoolValue("doubleClick")); config.addListener("customcursor", mConfigListener); config.addListener("doubleClick", mConfigListener); @@ -554,6 +553,11 @@ void Gui::videoResized() const void Gui::setUseCustomCursor(const bool customCursor) { + if (settings.options.hideCursor) + { + SDL::showCursor(false); + return; + } if (customCursor != mCustomCursor) { mCustomCursor = customCursor; diff --git a/src/options.h b/src/options.h index ae7e57d24..9bfd405ac 100644 --- a/src/options.h +++ b/src/options.h @@ -65,7 +65,7 @@ struct Options final safeMode(false), testMode(false), ipc(false), - defaultCursor(false), + hideCursor(false), error(false), validate(false) {} @@ -97,7 +97,7 @@ struct Options final bool safeMode; bool testMode; bool ipc; - bool defaultCursor; + bool hideCursor; bool error; bool validate; }; diff --git a/tools/ci/scripts/runtest.sh b/tools/ci/scripts/runtest.sh index b4df47da5..d8149bd8f 100755 --- a/tools/ci/scripts/runtest.sh +++ b/tools/ci/scripts/runtest.sh @@ -50,7 +50,7 @@ function wait_for_servers_list { } function run { - ./src/manaplus --default-cursor --enable-ipc --renderer=0 >logs/run.log 2>&1 & + ./src/manaplus --hide-cursor --enable-ipc --renderer=0 >logs/run.log 2>&1 & export PID=$! sleep 20s echo "pause after run" |