Skip to content

Commit

Permalink
v1.0.3.20
Browse files Browse the repository at this point in the history
  • Loading branch information
steve02081504 committed May 7, 2023
1 parent 13b1a33 commit b2f7198
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
8 changes: 5 additions & 3 deletions src/GhostStuff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
void reload_shiori_of_baseware() {
linker.SEND({{L"ID", ghost_uid},
{L"Script", L"\\![reload,shiori]"}});
shioristaus = unloaded;//wait for UpdateGhostModulestate
shiorimode = load_by_baseware;
}

void unload_shiori_of_baseware() {
linker.SEND({{L"ID", ghost_uid},
{L"Script", L"\\![unload,shiori]"}});
shioristaus = unloaded;
if(shioristaus != critical)
shioristaus = unloaded;
shiorimode = not_in_loading;
}

Expand Down Expand Up @@ -58,7 +60,8 @@ void UpdateGhostModulestate() {
}
}
else if(shioristate.empty()) {
shioristaus = unloaded;
if(shioristaus != critical)
shioristaus = unloaded;
shiorimode = not_in_loading;
}
}
Expand All @@ -70,7 +73,6 @@ bool ExecLoad(void) {
SetWindowText(hEdit, L"");
SetFontShapeInit(F_DEFAULT);


shiori.SetTo(dllpath.c_str());
// load 失敗したらdllパスは空にする
if(!shiori.All_OK()) {
Expand Down
4 changes: 2 additions & 2 deletions src/header_files/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define VERSION_NUM1 1
#define VERSION_NUM2 0
#define VERSION_NUM3 3
#define VERSION_NUM4 19
#define CONSTRUCTION_TIMES 52
#define VERSION_NUM4 20
#define CONSTRUCTION_TIMES 53

#define STRINGIZER_HELPER(a) #a
#define STRINGIZER(a) STRINGIZER_HELPER(a)
Expand Down
29 changes: 19 additions & 10 deletions src/tama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
else {
if(linker.was_linked_to_ghost()) {
if(shioristaus == unloaded)
reload_shiori_of_baseware();
if(shioristaus != critical) {
UpdateGhostModulestate();
if(shioristaus == running){
auto info = linker.NOTYFY({{L"Event", L"tama.ShioriReloadRequest"}});
switch(info.get_code()) {
case -1: //ssp exit
Expand All @@ -411,8 +410,19 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
reload_shiori_of_baseware();
}
}
else
ExecReload();
else{
reload_shiori_of_baseware();
do {
Sleep(500);
UpdateGhostModulestate();
if(shioristaus == critical) {
unload_shiori_of_baseware();
dllpath = ghost_shiori;
ExecLoad();
break;
}
} while(shioristaus == unloaded);
}
}
}
break;
Expand All @@ -427,9 +437,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
else {
if(linker.was_linked_to_ghost()) {
if(shioristaus == unloaded)
unload_shiori_of_baseware();
if(shioristaus != critical) {
UpdateGhostModulestate();
if(shioristaus == running) {
auto info = linker.NOTYFY({{L"Event", L"tama.ShioriUnloadRequest"}});
switch(info.get_code()) {
case -1: //ssp exit
Expand All @@ -443,8 +452,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
unload_shiori_of_baseware();
}
}
else
ExecUnload();
else//unloaded or critical
unload_shiori_of_baseware();
}
}
break;
Expand Down

0 comments on commit b2f7198

Please sign in to comment.