mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 21:39:57 +00:00
Xui
This commit is contained in:
parent
e29a3c366c
commit
03a41da4df
4 changed files with 19 additions and 8 deletions
|
|
@ -285,7 +285,7 @@ source_group("Binding Source" FILES ${BINDING_SOURCE} ${BINDING_HEADERS})
|
||||||
|
|
||||||
## Setup main executable ##
|
## Setup main executable ##
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} MACOSX_BUNDLE WIN32
|
add_executable(${PROJECT_NAME} MACOSX_BUNDLE WIN32
|
||||||
${MAIN_HEADERS}
|
${MAIN_HEADERS}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,15 @@ left_close = False
|
||||||
if sys.platform == 'darwin': left_close = True
|
if sys.platform == 'darwin': left_close = True
|
||||||
|
|
||||||
try: base_path = sys._MEIPASS
|
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):
|
class PipeThread(QThread):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
|
||||||
|
|
@ -352,7 +352,7 @@ class Game_Party
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
# Spin the roulette, choose an actor
|
# Spin the roulette, choose an actor
|
||||||
return roulette[rand(roulette.size)]
|
return roulette[Random.rand(roulette.size)]
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Random Selection of Target Actor (HP 0)
|
# * Random Selection of Target Actor (HP 0)
|
||||||
|
|
|
||||||
13
src/main.cpp
13
src/main.cpp
|
|
@ -36,6 +36,10 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
#include "sharedstate.h"
|
#include "sharedstate.h"
|
||||||
#include "eventthread.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
|
// mainly doing this so journal app knows where to load images from
|
||||||
static void setGamePathInRegistry() {
|
static void setGamePathInRegistry() {
|
||||||
|
|
||||||
#if defined WIN32
|
#if defined WIN32
|
||||||
// this logic is currently windows specific
|
// this logic is currently windows specific
|
||||||
const char* dataDir = SDL_GetBasePath();
|
char* dataDir = SDL_GetBasePath();
|
||||||
if (dataDir){
|
if (dataDir){
|
||||||
HKEY key;
|
HKEY key;
|
||||||
long keyOpenError = RegOpenKey(HKEY_CURRENT_USER, TEXT("Software\\OneShot\\"), &key);
|
long keyOpenError = RegOpenKey(HKEY_CURRENT_USER, TEXT("Software\\OneShot\\"), &key);
|
||||||
|
|
@ -192,7 +195,8 @@ static void setGamePathInRegistry() {
|
||||||
|
|
||||||
if (keyCreateError != ERROR_SUCCESS){
|
if (keyCreateError != ERROR_SUCCESS){
|
||||||
showInitError("Unable to create key in registry.");
|
showInitError("Unable to create key in registry.");
|
||||||
}else {
|
}
|
||||||
|
else {
|
||||||
keyOpenError = ERROR_SUCCESS;
|
keyOpenError = ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -207,12 +211,11 @@ static void setGamePathInRegistry() {
|
||||||
}
|
}
|
||||||
RegCloseKey(key);
|
RegCloseKey(key);
|
||||||
}
|
}
|
||||||
SDL_free((void*)dataDir);
|
SDL_free(dataDir);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
//TODO handle this for Linux/Mac
|
//TODO handle this for Linux/Mac
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]){
|
int main(int argc, char *argv[]){
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
|
||||||
SDL_SetHint(SDL_HINT_APP_ID, "OneshotSunshine");
|
SDL_SetHint(SDL_HINT_APP_ID, "OneshotSunshine");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue