From 03a41da4df055981ceff5ee599879ad89eea6716 Mon Sep 17 00:00:00 2001 From: ZakatTeamI2P Date: Mon, 4 May 2026 12:46:41 +0400 Subject: [PATCH] Xui --- CMakeLists.txt | 2 +- journal/unix/journal.py | 10 +++++++++- scripts/Game_Party.rb | 2 +- src/main.cpp | 13 ++++++++----- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 183b06b..89dc53f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,7 +285,7 @@ source_group("Binding Source" FILES ${BINDING_SOURCE} ${BINDING_HEADERS}) ## Setup main executable ## -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) add_executable(${PROJECT_NAME} MACOSX_BUNDLE WIN32 ${MAIN_HEADERS} diff --git a/journal/unix/journal.py b/journal/unix/journal.py index 0b65984..694a296 100644 --- a/journal/unix/journal.py +++ b/journal/unix/journal.py @@ -27,7 +27,15 @@ left_close = False if sys.platform == 'darwin': left_close = True try: base_path = sys._MEIPASS -except AttributeError: base_path = os.path.abspath('.') +except AttributeError: + if os.path.exists(os.getenv('HOME') + "/.cache/sunshine-path.cache"): + with open(os.getenv('HOME') + "/.cache/sunshine-path.cache", "r", encoding="utf-8") as f: + for i, line in enumerate(f): + if i == 1: + base_path = line.strip() + break + else: + base_path = os.path.abspath('.') class PipeThread(QThread): def __init__(self, *args, **kwargs): diff --git a/scripts/Game_Party.rb b/scripts/Game_Party.rb index 9d30b63..79f4db6 100644 --- a/scripts/Game_Party.rb +++ b/scripts/Game_Party.rb @@ -352,7 +352,7 @@ class Game_Party return nil end # Spin the roulette, choose an actor - return roulette[rand(roulette.size)] + return roulette[Random.rand(roulette.size)] end #-------------------------------------------------------------------------- # * Random Selection of Target Actor (HP 0) diff --git a/src/main.cpp b/src/main.cpp index 734929c..bfac740 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -36,6 +36,10 @@ #include #include #include +#include +#include +#include +#include #include "sharedstate.h" #include "eventthread.h" @@ -178,10 +182,9 @@ static void setupWindowIcon(const Config &conf, SDL_Window *win){ // mainly doing this so journal app knows where to load images from static void setGamePathInRegistry() { - #if defined WIN32 // this logic is currently windows specific - const char* dataDir = SDL_GetBasePath(); + char* dataDir = SDL_GetBasePath(); if (dataDir){ HKEY key; long keyOpenError = RegOpenKey(HKEY_CURRENT_USER, TEXT("Software\\OneShot\\"), &key); @@ -192,7 +195,8 @@ static void setGamePathInRegistry() { if (keyCreateError != ERROR_SUCCESS){ showInitError("Unable to create key in registry."); - }else { + } + else { keyOpenError = ERROR_SUCCESS; } } @@ -207,12 +211,11 @@ static void setGamePathInRegistry() { } RegCloseKey(key); } - SDL_free((void*)dataDir); + SDL_free(dataDir); } #endif //TODO handle this for Linux/Mac } - int main(int argc, char *argv[]){ SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); SDL_SetHint(SDL_HINT_APP_ID, "OneshotSunshine");