RemedyBG integration plugin

This commit is contained in:
Krzosa Karol
2026-01-10 14:03:00 +01:00
parent e575569d8a
commit 05d5de4b7d
3 changed files with 2265 additions and 7 deletions

View File

@@ -1112,6 +1112,12 @@ String Coro_CloseAllEx(mco_coro *co) {
void Coro_Quit(mco_coro *co) { void Coro_Quit(mco_coro *co) {
String res = Coro_CloseAllEx(co); String res = Coro_CloseAllEx(co);
if (res != "Cancel") { if (res != "Cancel") {
For (GlobalHooks) {
if (it.kind == HookKind_AppQuit) {
ProfileScopeEx(it.name);
it.function({});
}
}
AppIsRunning = false; AppIsRunning = false;
} }
} }
@@ -1120,9 +1126,15 @@ void CMD_Quit(HookParam param) {
CoRemove("Coro_Quit"); CoRemove("Coro_Quit");
CoData *data = CoAdd(Coro_Quit); CoData *data = CoAdd(Coro_Quit);
CoResume(data); CoResume(data);
} RegisterHook(CMD_Quit, HookKind_AppQuit, "", "Ask user which files he would like to save and exit"); } RegisterCommand(CMD_Quit, "", "Ask user which files he would like to save and exit");
void CMD_QuitWithoutSaving(HookParam param) { void CMD_QuitWithoutSaving(HookParam param) {
For (GlobalHooks) {
if (it.kind == HookKind_AppQuit) {
ProfileScopeEx(it.name);
it.function({});
}
}
AppIsRunning = false; AppIsRunning = false;
} RegisterCommand(CMD_QuitWithoutSaving, "", "Self explanatory"); } RegisterCommand(CMD_QuitWithoutSaving, "", "Self explanatory");

File diff suppressed because it is too large Load Diff

View File

@@ -34,6 +34,8 @@
#include "draw.cpp" #include "draw.cpp"
#include "test/tests.cpp" #include "test/tests.cpp"
#include "remedybg_plugin.cpp"
#if OS_WASM #if OS_WASM
EM_JS(void, JS_SetMouseCursor, (const char *cursor_str), { EM_JS(void, JS_SetMouseCursor, (const char *cursor_str), {
document.getElementById("canvas").style.cursor = UTF8ToString(cursor_str); document.getElementById("canvas").style.cursor = UTF8ToString(cursor_str);
@@ -425,12 +427,7 @@ void OnCommand(Event event) {
} }
if (event.kind == EVENT_QUIT) { if (event.kind == EVENT_QUIT) {
For (GlobalHooks) { CMD_Quit({});
if (it.kind == HookKind_AppQuit) {
ProfileScopeEx(it.name);
it.function({});
}
}
} }
IF_DEBUG(AssertRanges(main.view->carets)); IF_DEBUG(AssertRanges(main.view->carets));