Skip to content

Commit

Permalink
update for 1.62
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Apr 12, 2023
1 parent 6f077c1 commit 39f4aec
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 101 deletions.
88 changes: 0 additions & 88 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
"label": "Lint Installed",
"type": "shell",
"command": "tools\\lint_installed.bat",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -30,14 +22,6 @@
"label": "Lint",
"type": "shell",
"command": "tools\\lint.bat",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -53,14 +37,6 @@
"label": "Build",
"type": "shell",
"command": "tools\\build.bat",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -76,14 +52,6 @@
"label": "Pack",
"type": "shell",
"command": "tools\\pack.bat",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -99,14 +67,6 @@
"label": "Lint/Build",
"type": "shell",
"command": "tools\\build.bat",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -123,14 +83,6 @@
"label": "Install",
"type": "shell",
"command": "tools\\install.bat",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -146,14 +98,6 @@
"label": "Install To Let There Be Flight",
"type": "shell",
"command": "tools\\install_ltbf.bat",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -169,14 +113,6 @@
"label": "Lint/Build/Install",
"type": "shell",
"command": "tools\\install.bat",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -194,14 +130,6 @@
"label": "Run",
"type": "shell",
"command": "\"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Cyberpunk 2077\\bin\\x64\\Cyberpunk2077.exe\"",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -217,14 +145,6 @@
"label": "Lint/Build/Install/Run",
"type": "shell",
"command": "\"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Cyberpunk 2077\\bin\\x64\\Cyberpunk2077.exe\"",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -241,14 +161,6 @@
"label": "Install/Run",
"type": "shell",
"command": "\"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Cyberpunk 2077\\bin\\x64\\Cyberpunk2077.exe\"",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d", "/c"
]
}
},
"presentation": {
"echo": true,
"reveal": "always",
Expand Down
Binary file modified build/red4ext/plugins/mod_settings/mod_settings.dll
Binary file not shown.
9 changes: 5 additions & 4 deletions src/red4ext/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ void __fastcall ProcessModSettings(ScriptData * scriptData) {

// 1.6 RVA: 0x273D50
// 1.61 RVA: 0x274300
// 1.62 RVA: 0x274380
// 1.61hf RVA: 0x274380
// 1.62 RVA: 0x27E1B0
// 48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 20 48 8B D9 E8 99 0B 00 00 48 8D 8B 38 01 00 00 FF 15
void *__fastcall ReleaseScriptData(ScriptData *scriptData);
constexpr uintptr_t ReleaseScriptDataAddr = 0x274380;
constexpr uintptr_t ReleaseScriptDataAddr = 0x27E1B0;
decltype(&ReleaseScriptData) ReleaseScriptData_Original;

void *__fastcall ReleaseScriptData(ScriptData *scriptData) {
Expand All @@ -109,7 +110,7 @@ RED4EXT_C_EXPORT bool RED4EXT_CALL Main(RED4ext::PluginHandle aHandle, RED4ext::
sdk = aSdk;
pluginHandle = aHandle;

aSdk->logger->Info(aHandle, "Starting up Mod Settings v0.0.12");
aSdk->logger->Info(aHandle, "Starting up Mod Settings v0.0.13");
RED4ext::RTTIRegistrator::Add(ModSettings::RegisterTypes, ModSettings::PostRegisterTypes);

while (!aSdk->hooking->Attach(aHandle, RED4EXT_OFFSET_TO_ADDR(ReleaseScriptDataAddr), &ReleaseScriptData,
Expand All @@ -136,7 +137,7 @@ RED4EXT_C_EXPORT bool RED4EXT_CALL Main(RED4ext::PluginHandle aHandle, RED4ext::
RED4EXT_C_EXPORT void RED4EXT_CALL Query(RED4ext::PluginInfo *aInfo) {
aInfo->name = L"Mod Settings";
aInfo->author = L"Jack Humbert";
aInfo->version = RED4EXT_SEMVER(0, 0, 12);
aInfo->version = RED4EXT_SEMVER(0, 0, 13);
aInfo->runtime = RED4EXT_RUNTIME_LATEST;
aInfo->sdk = RED4EXT_SDK_LATEST;
}
Expand Down
8 changes: 4 additions & 4 deletions src/red4ext/ModRuntimeSettingsVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bool __fastcall ModRuntimeSettingsVarBool::IsDefault() {
return value == defaultValue;
}

bool __fastcall ModRuntimeSettingsVarBool::RestoreDefault(char a1) {
bool __fastcall ModRuntimeSettingsVarBool::RestoreDefault(uint8_t a1) {
auto wasDefault = IsDefault();
if (wasDefault)
return !wasDefault;
Expand Down Expand Up @@ -221,7 +221,7 @@ bool __fastcall ModRuntimeSettingsVarFloat::IsDefault() {
return value == defaultValue;
}

bool __fastcall ModRuntimeSettingsVarFloat::RestoreDefault(char a1) {
bool __fastcall ModRuntimeSettingsVarFloat::RestoreDefault(uint8_t a1) {
auto wasDefault = IsDefault();
if (wasDefault)
return !wasDefault;
Expand Down Expand Up @@ -336,7 +336,7 @@ bool __fastcall ModRuntimeSettingsVarInt32::IsDefault() {
return value == defaultValue;
}

bool __fastcall ModRuntimeSettingsVarInt32::RestoreDefault(char a1) {
bool __fastcall ModRuntimeSettingsVarInt32::RestoreDefault(uint8_t a1) {
auto wasDefault = IsDefault();
if (wasDefault)
return !wasDefault;
Expand Down Expand Up @@ -428,7 +428,7 @@ bool __fastcall ModRuntimeSettingsVarEnum::IsDefault() {
return value == defaultValue;
}

bool __fastcall ModRuntimeSettingsVarEnum::RestoreDefault(char a1) {
bool __fastcall ModRuntimeSettingsVarEnum::RestoreDefault(uint8_t a1) {
auto wasDefault = IsDefault();
if (wasDefault)
return !wasDefault;
Expand Down
8 changes: 4 additions & 4 deletions src/red4ext/ModRuntimeSettingsVar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct ModRuntimeSettingsVarBool : public ModRuntimeSettingsVar {
virtual bool __fastcall WasModifiedSinceLastSave() override;
virtual bool __fastcall HasChange() override;
virtual bool __fastcall IsDefault() override;
virtual bool __fastcall RestoreDefault(char a1) override;
virtual bool __fastcall RestoreDefault(uint8_t a1) override;
virtual void __fastcall UpdateValue(void *value) override;
virtual void __fastcall ApplyChange() override;
virtual void __fastcall RevertChange() override;
Expand All @@ -54,7 +54,7 @@ struct ModRuntimeSettingsVarInt32 : public ModRuntimeSettingsVar {
virtual bool __fastcall WasModifiedSinceLastSave() override;
virtual bool __fastcall HasChange() override;
virtual bool __fastcall IsDefault() override;
virtual bool __fastcall RestoreDefault(char a1) override;
virtual bool __fastcall RestoreDefault(uint8_t a1) override;
virtual void __fastcall UpdateValue(void *value) override;
virtual void __fastcall ApplyChange() override;
virtual void __fastcall RevertChange() override;
Expand All @@ -81,7 +81,7 @@ struct ModRuntimeSettingsVarFloat : public ModRuntimeSettingsVar {
virtual bool __fastcall WasModifiedSinceLastSave() override;
virtual bool __fastcall HasChange() override;
virtual bool __fastcall IsDefault() override;
virtual bool __fastcall RestoreDefault(char a1) override;
virtual bool __fastcall RestoreDefault(uint8_t a1) override;
virtual void __fastcall UpdateValue(void *value) override;
virtual void __fastcall ApplyChange() override;
virtual void __fastcall RevertChange() override;
Expand Down Expand Up @@ -137,7 +137,7 @@ struct ModRuntimeSettingsVarEnum : public ModRuntimeSettingsVar {
virtual bool __fastcall WasModifiedSinceLastSave() override;
virtual bool __fastcall HasChange() override;
virtual bool __fastcall IsDefault() override;
virtual bool __fastcall RestoreDefault(char a1) override;
virtual bool __fastcall RestoreDefault(uint8_t a1) override;
virtual void __fastcall UpdateValue(void *value) override;
virtual void __fastcall ApplyChange() override;
virtual void __fastcall RevertChange() override;
Expand Down
2 changes: 1 addition & 1 deletion src/red4ext/mod_settings.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)build\release\bin\*.dll" "$(SolutionDir)..\..\build\red4ext\plugins\mod_settings\"</Command>
<Command>copy /y /d "$(SolutionDir)build\release\bin\*.dll" "$(SolutionDir)..\..\build\red4ext\plugins\mod_settings\"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down

0 comments on commit 39f4aec

Please sign in to comment.