diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-11 21:12:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-11 21:56:22 +0300 |
commit | 7cf130e2deb98987925a6682203a4773988daaf9 (patch) | |
tree | cf37a87e4fdc5220f0c95cc93c78fa8d6e01daa9 | |
parent | a75d8e305b43e2797bfd93cd481868d858712146 (diff) | |
download | manaverse-7cf130e2deb98987925a6682203a4773988daaf9.tar.gz manaverse-7cf130e2deb98987925a6682203a4773988daaf9.tar.bz2 manaverse-7cf130e2deb98987925a6682203a4773988daaf9.tar.xz manaverse-7cf130e2deb98987925a6682203a4773988daaf9.zip |
Add command line option for use default sdl cursor.
-rw-r--r-- | src/commandline.cpp | 5 | ||||
-rw-r--r-- | src/gui/gui.cpp | 3 | ||||
-rw-r--r-- | src/options.h | 4 | ||||
-rwxr-xr-x | tools/ci/scripts/runtest.sh | 2 |
4 files changed, 11 insertions, 3 deletions
diff --git a/src/commandline.cpp b/src/commandline.cpp index 1a7ad7dba..562726a1e 100644 --- a/src/commandline.cpp +++ b/src/commandline.cpp @@ -158,6 +158,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' }, { nullptr, 0, nullptr, 0 } }; @@ -251,6 +252,10 @@ void parseOptions(const int argc, char *const argv[]) break; case 'I': options.ipc = true; + break; + case 'q': + options.defaultCursor = true; + break; default: break; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 227b0c463..60ce059ea 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -257,7 +257,8 @@ void Gui::postInit(Graphics *const graphics) Widget::setGlobalFont(mGuiFont); // Initialize mouse cursor and listen for changes to the option - setUseCustomCursor(config.getBoolValue("customcursor")); + setUseCustomCursor(config.getBoolValue("customcursor") && + !settings.options.defaultCursor); setDoubleClick(config.getBoolValue("doubleClick")); config.addListener("customcursor", mConfigListener); config.addListener("doubleClick", mConfigListener); diff --git a/src/options.h b/src/options.h index d0ee5c34b..82839482b 100644 --- a/src/options.h +++ b/src/options.h @@ -64,7 +64,8 @@ struct Options final noOpenGL(false), safeMode(false), testMode(false), - ipc(false) + ipc(false), + defaultCursor(false) {} A_DELETE_COPY(Options) @@ -94,6 +95,7 @@ struct Options final bool safeMode; bool testMode; bool ipc; + bool defaultCursor; }; #endif // OPTIONS_H diff --git a/tools/ci/scripts/runtest.sh b/tools/ci/scripts/runtest.sh index 2758d2cb1..902022f71 100755 --- a/tools/ci/scripts/runtest.sh +++ b/tools/ci/scripts/runtest.sh @@ -17,7 +17,7 @@ function check_is_run { } function run { - ./src/manaplus --enable-ipc --renderer=0 >logs/run.log 2>&1 & + ./src/manaplus --default-cursor --enable-ipc --renderer=0 >logs/run.log 2>&1 & export PID=$! sleep 12s } |