diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 83e6d9cf..944de9ae 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -2944,8 +2944,20 @@ bool Steam_Init(){ return false; } -int main() +int main(char**args,const int argn) { + debugLogger.open("debug.log"); + LOG(std::format("Found {} args",argn)); + bool usingSteam=true; + + for(int i=0;i argv[] + char * arg = (char *)&((*argv)[*argc + 1]); + for (int i = 0; i < *argc; i++) + { + (*argv)[i] = arg; + arg += WideCharToMultiByte( CP_UTF8, 0, wargv[i], -1, arg, n, NULL, NULL ) + 1; + } + (*argv)[*argc] = NULL; +} + #ifndef _DEBUG #ifdef _WIN32 int CALLBACK WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){ - main(); + int argc; + char ** argv; + get_command_line_args( &argc, &argv ); + + for(int n = 0;n < argc;n++) + printf( " %d : %s\n", n, argv[n] ); + main(argv,argc); + free( argv ); } #endif #endif @@ -3938,7 +3985,7 @@ void AiL::UpdateDiscordStatus(std::string levelName,std::string className){ } SteamFriends()->SetRichPresence("steam_display","#Status"); }else{ - if("steam_api"_B&&Steam_Init()){ + if(steamAPIEnabled&&Steam_Init()){ retry=true; LOG("Steam API Initialized successfully!"); } @@ -4297,4 +4344,8 @@ void AiL::SetWindSpeed(vf2d newWindSpd){ } const vf2d&AiL::GetWindSpeed()const{ return windSpd; +} + +void AiL::UsingSteamAPI(const bool usingSteam){ + steamAPIEnabled=usingSteam; } \ No newline at end of file diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index e48d36cf..8aed3ad0 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -209,6 +209,7 @@ private: SteamKeyboardCallbackHandler*steamKeyboardCallbackListener=nullptr; SteamStatsReceivedHandler*steamStatsReceivedHandlerListener=nullptr; std::optionalbossIndicatorPos{}; + bool steamAPIEnabled{true}; Overlay hudOverlay{"pixel.png",BLANK}; public: AiL(); @@ -220,6 +221,7 @@ public: void GetAnyMousePress(int32_t mouseButton)override final; void GetAnyMouseHeld(int32_t mouseButton)override final; void GetAnyMouseRelease(int32_t mouseButton)override final; + void UsingSteamAPI(const bool usingSteam); public: geom2d::rectNO_COLLISION={{0.f,0.f,},{0.f,0.f}}; TileTransformedView view; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 988e94d4..86841082 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 3 -#define VERSION_BUILD 9509 +#define VERSION_BUILD 9510 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/distribute.sh b/distribute.sh index cc23bafd..155454f4 100755 --- a/distribute.sh +++ b/distribute.sh @@ -23,4 +23,10 @@ cp -R bin release rm release/*.pdb touch release/runGame.sh -echo "bin/AdventuresInLestoria" > release/runGame.sh \ No newline at end of file +echo "#!/bin/bash +if [ `bin/AdventuresInLestoria | wc -l` == 0 ]; then + echo \"Failed to Load through Steam Restarting without Steam API!\" + bin/AdventuresInLestoria nosteam +else + echo \"Success!\" +fi" > release/runGame.sh \ No newline at end of file diff --git a/runGame - NO STEAM.bat b/runGame - NO STEAM.bat new file mode 100644 index 00000000..49853c8a --- /dev/null +++ b/runGame - NO STEAM.bat @@ -0,0 +1,3 @@ +cd "Adventures in Lestoria" +"..\x64\Release\Adventures in Lestoria.exe" nosteam +set /p DUMMY=Hit ENTER to exit... \ No newline at end of file diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 85f73e10..4165358a 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ