diff options
author | cpasjuste <cpasjuste@gmail.com> | 2020-04-29 11:49:01 +0200 |
---|---|---|
committer | cpasjuste <cpasjuste@gmail.com> | 2020-04-29 11:49:01 +0200 |
commit | 9336a924065553d94732941900375385284c47ee (patch) | |
tree | a766f3851e210bd155ab1eb23aee7b383d57c217 | |
parent | 63fd641252dd035e51730fa2172f6faea0d5f756 (diff) | |
download | ManaVerse-9336a924065553d94732941900375385284c47ee.tar.gz ManaVerse-9336a924065553d94732941900375385284c47ee.tar.bz2 ManaVerse-9336a924065553d94732941900375385284c47ee.tar.xz ManaVerse-9336a924065553d94732941900375385284c47ee.zip |
switch: fix software keyboard validation event, fix paths
-rw-r--r-- | src/dirs.cpp | 4 | ||||
-rw-r--r-- | src/fs/paths.cpp | 6 | ||||
-rw-r--r-- | src/gui/sdlinput.cpp | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/dirs.cpp b/src/dirs.cpp index 26c0032d9..e33407fff 100644 --- a/src/dirs.cpp +++ b/src/dirs.cpp @@ -359,6 +359,8 @@ void Dirs::initLocalDataDir() "local"); #elif defined __native_client__ settings.localDataDir = pathJoin(_nacl_dir, "local"); +#elif defined __SWITCH__ + settings.localDataDir = pathJoin(VirtFs::getUserDir(),"local"); #else // __APPLE__ settings.localDataDir = pathJoin(VirtFs::getUserDir(), @@ -421,6 +423,8 @@ void Dirs::initConfigDir() "config"); #elif defined __native_client__ settings.configDir = pathJoin(_nacl_dir, "config"); +#elif defined __SWITCH__ + settings.configDir = pathJoin(VirtFs::getUserDir(), "config"); #else // __APPLE__ settings.configDir = pathJoin(VirtFs::getUserDir(), diff --git a/src/fs/paths.cpp b/src/fs/paths.cpp index 036020fce..1e76f249d 100644 --- a/src/fs/paths.cpp +++ b/src/fs/paths.cpp @@ -257,13 +257,12 @@ std::string getHomePath() #else // defined(UNITTESTS) && defined(UNITESTSDIR) #ifdef WIN32 return getSpecialFolderLocation(CSIDL_LOCAL_APPDATA); +#elif __SWITCH__ + return VirtFs::getBaseDir(); #else const char *path = getenv("HOME"); if (path == nullptr) { -#ifdef __SWITCH__ - return "/switch/manaplus"; -#else const uid_t uid = getuid(); const struct passwd *const pw = getpwuid(uid); if (pw != nullptr && @@ -273,7 +272,6 @@ std::string getHomePath() } if (path == nullptr) return dirSeparator; -#endif } std::string dir = path; if (findLast(dir, std::string(dirSeparator)) == false) diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index b6fabd8a5..c4c7c9741 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -139,7 +139,7 @@ void SDLInput::pushInput(const SDL_Event &event) MouseInput mouseInput; #ifdef __SWITCH__ - // send an escape/cancel key on keyboard dismiss event + // send an enter/select key on keyboard dismiss event bool visible = SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE; if(visible) { @@ -147,7 +147,7 @@ void SDLInput::pushInput(const SDL_Event &event) } else if(!keyboardClosed) { - simulateKey(KeyValue::ESCAPE, InputAction::GUI_CANCEL); + simulateKey(KeyValue::ENTER, InputAction::GUI_SELECT2); keyboardClosed = true; } #endif |