-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FO4: - Fixed GetCrime: 7 element is always nullptr
- Loading branch information
Showing
11 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
Creation Kit Platform Extended Core/Patches/FO4/CrashConditionItemGetCrime.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
// 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 "Editor API/EditorUI.h" | ||
#include "CrashConditionItemGetCrime.h" | ||
|
||
namespace CreationKitPlatformExtended | ||
{ | ||
namespace Patches | ||
{ | ||
namespace Fallout4 | ||
{ | ||
class GameSettingCollection | ||
{ | ||
public: | ||
// format: <name>\x0<value> | ||
char* Data; | ||
}; | ||
|
||
template<typename T> | ||
class SettingT | ||
{ | ||
public: | ||
virtual ~SettingT() = default; | ||
|
||
char* Name; | ||
GameSettingCollection Option; | ||
}; | ||
|
||
SettingT<GameSettingCollection>** pointer_CrashConditionItemGetCrimePatch_data = nullptr; | ||
|
||
CrashConditionItemGetCrimePatch::CrashConditionItemGetCrimePatch() : Module(GlobalEnginePtr) | ||
{} | ||
|
||
bool CrashConditionItemGetCrimePatch::HasOption() const | ||
{ | ||
return false; | ||
} | ||
|
||
bool CrashConditionItemGetCrimePatch::HasCanRuntimeDisabled() const | ||
{ | ||
return false; | ||
} | ||
|
||
const char* CrashConditionItemGetCrimePatch::GetOptionName() const | ||
{ | ||
return nullptr; | ||
} | ||
|
||
const char* CrashConditionItemGetCrimePatch::GetName() const | ||
{ | ||
return "Crash Condition Item GetCrime"; | ||
} | ||
|
||
bool CrashConditionItemGetCrimePatch::HasDependencies() const | ||
{ | ||
return false; | ||
} | ||
|
||
Array<String> CrashConditionItemGetCrimePatch::GetDependencies() const | ||
{ | ||
return {}; | ||
} | ||
|
||
bool CrashConditionItemGetCrimePatch::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 CrashConditionItemGetCrimePatch::Activate(const Relocator* lpRelocator, | ||
const RelocationDatabaseItem* lpRelocationDatabaseItem) | ||
{ | ||
if (lpRelocationDatabaseItem->Version() == 1) | ||
{ | ||
// Strangely, there are 6 elements in the array in memory, when Beth is forced to pass exactly 7 | ||
// 7 element is always nullptr | ||
|
||
lpRelocator->DetourJump(_RELDATA_RAV(0), (uintptr_t)&sub); | ||
pointer_CrashConditionItemGetCrimePatch_data = (SettingT<GameSettingCollection>**)_RELDATA_ADDR(1); | ||
|
||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
bool CrashConditionItemGetCrimePatch::Shutdown(const Relocator* lpRelocator, | ||
const RelocationDatabaseItem* lpRelocationDatabaseItem) | ||
{ | ||
return false; | ||
} | ||
|
||
void CrashConditionItemGetCrimePatch::sub(HWND hCombobox) | ||
{ | ||
if (!hCombobox) return; | ||
|
||
EditorAPI::EditorUI::HKSendMessageA(hCombobox, CB_RESETCONTENT, 0, 0); | ||
EditorAPI::EditorUI::ComboBoxInsertItemDeferred(hCombobox, " ANY ", nullptr, 1); | ||
|
||
auto Array = pointer_CrashConditionItemGetCrimePatch_data; | ||
if (!Array) return; | ||
|
||
uint32_t index = 0; | ||
do { | ||
if (auto Setting = Array[index]; Setting) | ||
EditorAPI::EditorUI::ComboBoxInsertItemDeferred(hCombobox, Setting->Name, (void*)index, 1); | ||
} while (++index < 7); | ||
} | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
Creation Kit Platform Extended Core/Patches/FO4/CrashConditionItemGetCrime.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// 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 CrashConditionItemGetCrimePatch : public Module | ||
{ | ||
public: | ||
CrashConditionItemGetCrimePatch(); | ||
|
||
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; | ||
|
||
static void sub(HWND hCombobox); | ||
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: | ||
CrashConditionItemGetCrimePatch(const CrashConditionItemGetCrimePatch&) = default; | ||
CrashConditionItemGetCrimePatch& operator=(const CrashConditionItemGetCrimePatch&) = default; | ||
}; | ||
} | ||
} | ||
} |
Binary file modified
BIN
+0 Bytes
(100%)
Creation Kit Platform Extended Core/Version/build_version.txt
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Creation Kit Platform Extended Core/Version/resource_version2.h
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Crash Condition Item GetCrime | ||
1 | ||
extended | ||
6454C0 0 v0_4885C90F84????????554883EC2048895C2430 | ||
4546B10 0 <nope> |
Binary file modified
BIN
+130 Bytes
(100%)
Database/FO4/1_10_162_0/CreationKitPlatformExtended_FO4_1_10_162.database
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Crash Condition Item GetCrime | ||
1 | ||
extended | ||
6E4590 0 4885C90F84????????554883EC2048895C24304533C948897424384533C0BA4B01000048897C2440488BE9FF15???????? | ||
3AE2888 0 <nope> |
Binary file modified
BIN
+187 Bytes
(100%)
Database/FO4/1_10_982_3/CreationKitPlatformExtended_FO4_1_10_982_3.database
Binary file not shown.