forked from Perchik71/Creation-Kit-Platform-Extended
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FO4 and SSE: - AllowSaveESM patch unavailable vc mode; SF: - Added patch quotes support for CLI;
- Loading branch information
Showing
13 changed files
with
231 additions
and
75 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
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
104 changes: 104 additions & 0 deletions
104
Creation Kit Platform Extended Core/Patches/SF/FixQuoteCmdLineSF.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,104 @@ | ||
// 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 "FixQuoteCmdLineSF.h" | ||
#include "Editor API/BSString.h" | ||
|
||
namespace CreationKitPlatformExtended | ||
{ | ||
namespace Patches | ||
{ | ||
namespace Starfield | ||
{ | ||
FixQuoteCmdLinePatch::FixQuoteCmdLinePatch() : Module(GlobalEnginePtr) | ||
{} | ||
|
||
bool FixQuoteCmdLinePatch::HasOption() const | ||
{ | ||
return false; | ||
} | ||
|
||
bool FixQuoteCmdLinePatch::HasCanRuntimeDisabled() const | ||
{ | ||
return false; | ||
} | ||
|
||
const char* FixQuoteCmdLinePatch::GetOptionName() const | ||
{ | ||
return nullptr; | ||
} | ||
|
||
const char* FixQuoteCmdLinePatch::GetName() const | ||
{ | ||
return "Fixed quote to cmdline"; | ||
} | ||
|
||
bool FixQuoteCmdLinePatch::HasDependencies() const | ||
{ | ||
return false; | ||
} | ||
|
||
Array<String> FixQuoteCmdLinePatch::GetDependencies() const | ||
{ | ||
return {}; | ||
} | ||
|
||
bool FixQuoteCmdLinePatch::QueryFromPlatform(EDITOR_EXECUTABLE_TYPE eEditorCurrentVersion, | ||
const char* lpcstrPlatformRuntimeVersion) const | ||
{ | ||
return eEditorCurrentVersion >= EDITOR_EXECUTABLE_TYPE::EDITOR_STARFIELD_1_14_70_0; | ||
} | ||
|
||
bool FixQuoteCmdLinePatch::Activate(const Relocator* lpRelocator, | ||
const RelocationDatabaseItem* lpRelocationDatabaseItem) | ||
{ | ||
if (lpRelocationDatabaseItem->Version() == 1) | ||
{ | ||
for (uint32_t i = 0; i < lpRelocationDatabaseItem->Count(); i++) | ||
lpRelocator->DetourCall(_RELDATA_RAV(i), (uintptr_t)&sub); | ||
|
||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
bool FixQuoteCmdLinePatch::Shutdown(const Relocator* lpRelocator, | ||
const RelocationDatabaseItem* lpRelocationDatabaseItem) | ||
{ | ||
return false; | ||
} | ||
|
||
char* FixQuoteCmdLinePatch::sub(char* str, const char* delim, char** next_token) | ||
{ | ||
if (str) { | ||
while (*str == ' ') { | ||
if (*str == '\0') | ||
return nullptr; | ||
str++; | ||
} | ||
if (*str == '\"') | ||
return strtok_s(++str, "\"", next_token); | ||
else | ||
return strtok_s(str, " ", next_token); | ||
} | ||
else if (next_token && *next_token) { | ||
if (strchr(*next_token, '\"')) { | ||
char* lpRes = strtok_s(nullptr, "\"", next_token); | ||
|
||
if (lpRes && !Utils::Trim(lpRes).length()) | ||
lpRes = strtok_s(nullptr, "\"", next_token); | ||
|
||
return lpRes; | ||
} | ||
else | ||
return strtok_s(nullptr, " ", next_token); | ||
} | ||
else | ||
return strtok_s(str, delim, next_token); | ||
} | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
Creation Kit Platform Extended Core/Patches/SF/FixQuoteCmdLineSF.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,44 @@ | ||
// 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 Starfield | ||
{ | ||
using namespace CreationKitPlatformExtended::Core; | ||
|
||
class FixQuoteCmdLinePatch : public Module | ||
{ | ||
public: | ||
FixQuoteCmdLinePatch(); | ||
|
||
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 char* sub(char* str, const char* delim, char** next_token); | ||
static void sub2(char* lpCmdLine, char* arg2); | ||
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: | ||
FixQuoteCmdLinePatch(const FixQuoteCmdLinePatch&) = default; | ||
FixQuoteCmdLinePatch& operator=(const FixQuoteCmdLinePatch&) = default; | ||
}; | ||
} | ||
} | ||
} |
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
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.
Binary file modified
BIN
+652 Bytes
(100%)
Database/SF/1_14_70_0/CreationKitPlatformExtended_SF_1_14_70_0.database
Binary file not shown.
Oops, something went wrong.