Skip to content

Commit

Permalink
[CKPE]
Browse files Browse the repository at this point in the history
SF:
- give opportunity to save application settings before exiting;
  • Loading branch information
Perchik71 committed Dec 1, 2024
1 parent 0168747 commit b3c4003
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
12 changes: 11 additions & 1 deletion Creation Kit Platform Extended Core/Patches/QuitHandlerPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,24 @@ namespace CreationKitPlatformExtended
bool QuitHandlerPatch::Activate(const Relocator* lpRelocator,
const RelocationDatabaseItem* lpRelocationDatabaseItem)
{
if (lpRelocationDatabaseItem->Version() == 1)
auto versionPatch = lpRelocationDatabaseItem->Version();

if (versionPatch == 1)
{
for (uint32_t nId = 0; nId < lpRelocationDatabaseItem->Count(); nId++)
lpRelocator->DetourCall(_RELDATA_RAV(nId),
(uintptr_t)&CreationKitPlatformExtended::Utils::Quit);

return true;
}
else if (versionPatch == 2)
{
lpRelocator->DetourCall(_RELDATA_RAV(0), (uintptr_t)&CreationKitPlatformExtended::Utils::Quit);
lpRelocator->DetourCall(_RELDATA_RAV(1), (uintptr_t)&CreationKitPlatformExtended::Utils::Quit);

// Remove useless stuff destroy and free resources
lpRelocator->PatchNop(_RELDATA_RAV(2), 0x3FC);
}

return false;
}
Expand Down
Binary file modified Creation Kit Platform Extended Core/Version/build_version.txt
Binary file not shown.
Binary file modified Creation Kit Platform Extended Core/Version/resource_version2.h
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion Database/SF/1_14_74_0/QuitHandler.relb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Quit Handler
1
2
extended
1982630 0 48895C24??48897424??574883EC??488BD9488D05????????488901488D05????????488941??33F64839B1????????74??
19B51E1 0 <nope>
19B4CE3 0 <nope>
2 changes: 1 addition & 1 deletion Stuffs/SF/CreationKitPlatformExtended.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bVersionControlMergeWorkaround=false ; [Experimental] Workaround for version con
bINICache=true ; Abandoning outdated "profile" functions, using the cache, for fast reading and saving options.
bDisableAssertions=false ; Remove assertion message popups (not recommended).
bGenerateCrashdumps=true ; Generate a dump in the game folder when the CK crashes.
bUnicode=true ; Translates UTF8 to ANSI when opening the plugin and back when saving.
bUnicode=false ; Translates UTF8 to ANSI when opening the plugin and back when saving.
bSkipTopicInfoValidation=true ; Speed up initial plugin load by skipping topic info validation, it doesn't matter if forms validation is disabled (recommended - fix crashes).
bAllowSaveESM=true ; Allow saving master files directly & setting them as the active file in the Data File dialog. This will destroy version control information.
bAllowMasterESP=true ; Allow ESP files to act as master files while saving.
Expand Down

0 comments on commit b3c4003

Please sign in to comment.