Skip to content

Commit

Permalink
[CKPE]
Browse files Browse the repository at this point in the history
FO4:
- Skip check forms count Perchik71#72
SF:
- Remove set thread dpi for dialogs
  • Loading branch information
Perchik71 committed Nov 9, 2024
1 parent 4156eaa commit c4649da
Show file tree
Hide file tree
Showing 25 changed files with 545 additions and 51 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,30 +136,30 @@ jobs:

- name: Make Bundle Directory
working-directory: ${{env.GITHUB_WORKSPACE}}
run: New-Item -ItemType Directory -Path "ckpe-sf-${{env.SHORT_SHA}}"
run: New-Item -ItemType Directory -Path "ckpe-sf-master-${{env.SHORT_SHA}}"

- name: Copy Voltek to SF
working-directory: ${{env.GITHUB_WORKSPACE}}
run: Copy-Item -Path x64\Release\Voltek*.dll "ckpe-sf-${{env.SHORT_SHA}}"
run: Copy-Item -Path x64\Release\Voltek*.dll "ckpe-sf-master-${{env.SHORT_SHA}}"

- name: Copy SF Database
working-directory: ${{env.GITHUB_WORKSPACE}}
run: Get-ChildItem -Recurse -Path Database\SF -Include ${{ env.SF_DATABASES }} | ForEach-Object { Copy-Item -Path $_.FullName -Destination (Join-Path "ckpe-sf-${{env.SHORT_SHA}}" $_.Name) -Force }
run: Get-ChildItem -Recurse -Path Database\SF -Include ${{ env.SF_DATABASES }} | ForEach-Object { Copy-Item -Path $_.FullName -Destination (Join-Path "ckpe-sf-master-${{env.SHORT_SHA}}" $_.Name) -Force }

- name: Copy SF Dialog
working-directory: ${{env.GITHUB_WORKSPACE}}
run: Copy-Item -Path Dialogs\SF\*.pak "ckpe-sf-${{env.SHORT_SHA}}"
run: Copy-Item -Path Dialogs\SF\*.pak "ckpe-sf-master-${{env.SHORT_SHA}}"

- name: Copy SF Stuff
working-directory: ${{env.GITHUB_WORKSPACE}}
run: Get-ChildItem -Path .\Stuffs\SF -Recurse | ForEach-Object { Copy-Item -Path $_.FullName -Destination (Join-Path "ckpe-sf-${{env.SHORT_SHA}}" $_.Name) -Force }
run: Get-ChildItem -Path .\Stuffs\SF -Recurse | ForEach-Object { Copy-Item -Path $_.FullName -Destination (Join-Path "ckpe-sf-master-${{env.SHORT_SHA}}" $_.Name) -Force }

- name: Copy SF CKPE
working-directory: ${{env.GITHUB_WORKSPACE}}
run: Get-ChildItem -Recurse -Path ".\x64" -Include "ckpe_loader.exe", "winhttp.dll" | ForEach-Object { Copy-Item -Path $_.FullName -Destination (Join-Path "ckpe-sf-${{env.SHORT_SHA}}" $_.Name) -Force }
run: Get-ChildItem -Recurse -Path ".\x64" -Include "ckpe_loader.exe", "winhttp.dll" | ForEach-Object { Copy-Item -Path $_.FullName -Destination (Join-Path "ckpe-sf-master-${{env.SHORT_SHA}}" $_.Name) -Force }

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ckpe-sf-${{env.SHORT_SHA}}
path: "ckpe-sf-${{env.SHORT_SHA}}"
name: ckpe-sf-master-${{env.SHORT_SHA}}
path: "ckpe-sf-master-${{env.SHORT_SHA}}"
2 changes: 2 additions & 0 deletions Creation Kit Platform Extended Core/Core/EngineFO4Patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "Patches/FO4/ChooseSoundFileF4.h"
#include "Patches/FO4/RunNetworkDisable.h"
#include "Patches/FO4/CrashConditionItemGetCrime.h"
#include "Patches/FO4/DontMatchForms.h"

#include "Patches/Windows/FO4/MainWindowF4.h"
#include "Patches/Windows/FO4/ObjectWindowF4.h"
Expand Down Expand Up @@ -115,6 +116,7 @@ namespace CreationKitPlatformExtended
new Patches::CrashInventoryPatch(),
new Patches::RunNetworkDisablePatch(),
new Patches::CrashConditionItemGetCrimePatch(),
new Patches::DontMatchFormsPatch(),

new Patches::MainWindow(),
new Patches::ObjectWindow(),
Expand Down
6 changes: 6 additions & 0 deletions Creation Kit Platform Extended Core/Core/EngineSFPatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#include "Patches/SF/RTDynamicCastCrash.h"
#include "Patches/SF/OptimizationLoadSF.h"
#include "Patches/SF/RemoveUselessMessagesSF.h"
#include "Patches/SF/RemoveUselessResizeInDialogs.h"
#include "Patches/SF/RemoveThreadDpi.h"
#include "Patches/SF/LoadMaterialsAsync.h"

#include "Patches/Windows/SF/DataWindowSF.h"
#include "Patches/Windows/SF/AboutWindowSF.h"
Expand Down Expand Up @@ -42,6 +45,9 @@ namespace CreationKitPlatformExtended
new Patches::RTDynamicCastCrashPatch(),
new Patches::OptimizationLoadPatch(),
new Patches::RemoveUselessMessagesPatch(),
//new Patches::RemoveUselessResizeInDialogsPatch(),
new Patches::RemoveThreadDpiPatch(),
//new Patches::LoadMaterialsAsyncPatch(),

new Patches::DataWindow(),
new Patches::AboutWindow(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
<ClCompile Include="Patches\FO4\CrashConditionItemGetCrime.cpp" />
<ClCompile Include="Patches\FO4\CrashInventory.cpp" />
<ClCompile Include="Patches\FO4\CreateDDS.cpp" />
<ClCompile Include="Patches\FO4\DontMatchForms.cpp" />
<ClCompile Include="Patches\FO4\EnableGoInSelGame.cpp" />
<ClCompile Include="Patches\FO4\ESLTip.cpp" />
<ClCompile Include="Patches\FO4\FakeMoveLight.cpp" />
Expand Down Expand Up @@ -253,8 +254,11 @@
<ClCompile Include="Patches\QuitHandlerPatch.cpp" />
<ClCompile Include="Patches\RenameCreationKitApp.cpp" />
<ClCompile Include="Patches\RenderWindow60FPS.cpp" />
<ClCompile Include="Patches\SF\LoadMaterialsAsync.cpp" />
<ClCompile Include="Patches\SF\OptimizationLoadSF.cpp" />
<ClCompile Include="Patches\SF\RemoveThreadDpi.cpp" />
<ClCompile Include="Patches\SF\RemoveUselessMessagesSF.cpp" />
<ClCompile Include="Patches\SF\RemoveUselessResizeInDialogs.cpp" />
<ClCompile Include="Patches\SF\ReplaceImgQSplashWnd.cpp" />
<ClCompile Include="Patches\SF\RTDynamicCastCrash.cpp" />
<ClCompile Include="Patches\SF\RunAppWithoutNet.cpp" />
Expand Down Expand Up @@ -606,6 +610,7 @@
<ClInclude Include="Patches\FO4\CrashConditionItemGetCrime.h" />
<ClInclude Include="Patches\FO4\CrashInventory.h" />
<ClInclude Include="Patches\FO4\CreateDDS.h" />
<ClInclude Include="Patches\FO4\DontMatchForms.h" />
<ClInclude Include="Patches\FO4\EnableGoInSelGame.h" />
<ClInclude Include="Patches\FO4\ESLTip.h" />
<ClInclude Include="Patches\FO4\FakeMoveLight.h" />
Expand Down Expand Up @@ -647,8 +652,11 @@
<ClInclude Include="Patches\QuitHandlerPatch.h" />
<ClInclude Include="Patches\RenameCreationKitApp.h" />
<ClInclude Include="Patches\RenderWindow60FPS.h" />
<ClInclude Include="Patches\SF\LoadMaterialsAsync.h" />
<ClInclude Include="Patches\SF\OptimizationLoadSF.h" />
<ClInclude Include="Patches\SF\RemoveThreadDpi.h" />
<ClInclude Include="Patches\SF\RemoveUselessMessagesSF.h" />
<ClInclude Include="Patches\SF\RemoveUselessResizeInDialogs.h" />
<ClInclude Include="Patches\SF\ReplaceImgQSplashWnd.h" />
<ClInclude Include="Patches\SF\RTDynamicCastCrash.h" />
<ClInclude Include="Patches\SF\RunAppWithoutNet.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,18 @@
<ClCompile Include="Patches\FO4\CrashConditionItemGetCrime.cpp">
<Filter>Patches\FO4</Filter>
</ClCompile>
<ClCompile Include="Patches\SF\RemoveUselessResizeInDialogs.cpp">
<Filter>Patches\SF</Filter>
</ClCompile>
<ClCompile Include="Patches\SF\RemoveThreadDpi.cpp">
<Filter>Patches\SF</Filter>
</ClCompile>
<ClCompile Include="Patches\SF\LoadMaterialsAsync.cpp">
<Filter>Patches\SF</Filter>
</ClCompile>
<ClCompile Include="Patches\FO4\DontMatchForms.cpp">
<Filter>Patches\FO4</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="Version">
Expand Down Expand Up @@ -2128,6 +2140,18 @@
<ClInclude Include="Patches\FO4\CrashConditionItemGetCrime.h">
<Filter>Patches\FO4</Filter>
</ClInclude>
<ClInclude Include="Patches\SF\RemoveUselessResizeInDialogs.h">
<Filter>Patches\SF</Filter>
</ClInclude>
<ClInclude Include="Patches\SF\RemoveThreadDpi.h">
<Filter>Patches\SF</Filter>
</ClInclude>
<ClInclude Include="Patches\SF\LoadMaterialsAsync.h">
<Filter>Patches\SF</Filter>
</ClInclude>
<ClInclude Include="Patches\FO4\DontMatchForms.h">
<Filter>Patches\FO4</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Version\resource_version.rc">
Expand Down
74 changes: 74 additions & 0 deletions Creation Kit Platform Extended Core/Patches/FO4/DontMatchForms.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Copyright © 2023-2024 aka perchik71. All rights reserved.
// Contacts: <email:[email protected]>
// License: https://www.gnu.org/licenses/gpl-3.0.html

#include "Core/Engine.h"
#include "DontMatchForms.h"

namespace CreationKitPlatformExtended
{
namespace Patches
{
namespace Fallout4
{
DontMatchFormsPatch::DontMatchFormsPatch() : Module(GlobalEnginePtr)
{}

bool DontMatchFormsPatch::HasOption() const
{
return false;
}

bool DontMatchFormsPatch::HasCanRuntimeDisabled() const
{
return false;
}

const char* DontMatchFormsPatch::GetOptionName() const
{
return nullptr;
}

const char* DontMatchFormsPatch::GetName() const
{
return "Dont Match Forms";
}

bool DontMatchFormsPatch::HasDependencies() const
{
return false;
}

Array<String> DontMatchFormsPatch::GetDependencies() const
{
return {};
}

bool DontMatchFormsPatch::QueryFromPlatform(EDITOR_EXECUTABLE_TYPE eEditorCurrentVersion,
const char* lpcstrPlatformRuntimeVersion) const
{
return (eEditorCurrentVersion <= EDITOR_EXECUTABLE_TYPE::EDITOR_FALLOUT_C4_LAST) &&
(eEditorCurrentVersion != EDITOR_EXECUTABLE_TYPE::EDITOR_FALLOUT_C4_1_10_943_1);
}

bool DontMatchFormsPatch::Activate(const Relocator* lpRelocator,
const RelocationDatabaseItem* lpRelocationDatabaseItem)
{
if (lpRelocationDatabaseItem->Version() == 1)
{
lpRelocator->Patch(_RELDATA_RAV(0), { 0xEB });

return true;
}

return false;
}

bool DontMatchFormsPatch::Shutdown(const Relocator* lpRelocator,
const RelocationDatabaseItem* lpRelocationDatabaseItem)
{
return false;
}
}
}
}
41 changes: 41 additions & 0 deletions Creation Kit Platform Extended Core/Patches/FO4/DontMatchForms.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright © 2023-2024 aka perchik71. All rights reserved.
// Contacts: <email:[email protected]>
// License: https://www.gnu.org/licenses/gpl-3.0.html

#pragma once

#include "Core/Module.h"
#include "Core/Relocator.h"
#include "Core/RelocationDatabase.h"

namespace CreationKitPlatformExtended
{
namespace Patches
{
namespace Fallout4
{
using namespace CreationKitPlatformExtended::Core;

class DontMatchFormsPatch : public Module
{
public:
DontMatchFormsPatch();

virtual bool HasOption() const;
virtual bool HasCanRuntimeDisabled() const;
virtual const char* GetOptionName() const;
virtual const char* GetName() const;
virtual bool HasDependencies() const;
virtual Array<String> GetDependencies() const;
protected:
virtual bool QueryFromPlatform(EDITOR_EXECUTABLE_TYPE eEditorCurrentVersion,
const char* lpcstrPlatformRuntimeVersion) const;
virtual bool Activate(const Relocator* lpRelocator, const RelocationDatabaseItem* lpRelocationDatabaseItem);
virtual bool Shutdown(const Relocator* lpRelocator, const RelocationDatabaseItem* lpRelocationDatabaseItem);
private:
DontMatchFormsPatch(const DontMatchFormsPatch&) = default;
DontMatchFormsPatch& operator=(const DontMatchFormsPatch&) = default;
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace CreationKitPlatformExtended
// In Qt, it would be necessary to give the name of the window initially, for something acceptable
lpRelocator->Patch(_RELDATA_RAV(1), (uint8_t*)"Creation Kit\0", 13);
// Cut a useless entry [Branch: <some>, Version: <CKVer>]
lpRelocator->PatchNop(_RELDATA_RAV(2), 0xA7);
//lpRelocator->PatchNop(_RELDATA_RAV(2), 0xA7);
lpRelocator->PatchNop(_RELDATA_RAV(4), 0x6);
// Cut a useless entry [Admin]
lpRelocator->DetourCall(_RELDATA_RAV(3), &QString::sprintf);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Copyright © 2023-2024 aka perchik71. All rights reserved.
// Contacts: <email:[email protected]>
// License: https://www.gnu.org/licenses/gpl-3.0.html

#include "Core/Engine.h"
#include "LoadMaterialsAsync.h"

namespace CreationKitPlatformExtended
{
namespace Patches
{
namespace Starfield
{
uintptr_t pointer_LoadMaterialsAsyncPatch_sub0 = 0;

LoadMaterialsAsyncPatch::LoadMaterialsAsyncPatch() : Module(GlobalEnginePtr)
{}

bool LoadMaterialsAsyncPatch::HasOption() const
{
return false;
}

bool LoadMaterialsAsyncPatch::HasCanRuntimeDisabled() const
{
return false;
}

const char* LoadMaterialsAsyncPatch::GetOptionName() const
{
return nullptr;
}

const char* LoadMaterialsAsyncPatch::GetName() const
{
return "Load Materials Async";
}

bool LoadMaterialsAsyncPatch::HasDependencies() const
{
return false;
}

Array<String> LoadMaterialsAsyncPatch::GetDependencies() const
{
return {};
}

bool LoadMaterialsAsyncPatch::QueryFromPlatform(EDITOR_EXECUTABLE_TYPE eEditorCurrentVersion,
const char* lpcstrPlatformRuntimeVersion) const
{
return eEditorCurrentVersion >= EDITOR_EXECUTABLE_TYPE::EDITOR_STARFIELD_1_14_70_0;
}

bool LoadMaterialsAsyncPatch::Activate(const Relocator* lpRelocator,
const RelocationDatabaseItem* lpRelocationDatabaseItem)
{
if (lpRelocationDatabaseItem->Version() == 1)
{
pointer_LoadMaterialsAsyncPatch_sub0 = _RELDATA_ADDR(0);
lpRelocator->DetourCall(_RELDATA_RAV(1), (uintptr_t)&sub);

return true;
}

return false;
}

bool LoadMaterialsAsyncPatch::Shutdown(const Relocator* lpRelocator,
const RelocationDatabaseItem* lpRelocationDatabaseItem)
{
return false;
}

void LoadMaterialsAsyncPatch::sub(void* arg1, void* arg2)
{
auto mat_thread = std::thread([](void* arg1, void* arg2) {
fastCall<void>(pointer_LoadMaterialsAsyncPatch_sub0, arg1, arg2);
}, arg1, arg2);

SetThreadPriority(mat_thread.native_handle(), THREAD_PRIORITY_HIGHEST);
mat_thread.join();
}
}
}
}
Loading

0 comments on commit c4649da

Please sign in to comment.