Skip to content

Commit

Permalink
[CKPE]
Browse files Browse the repository at this point in the history
- Upd. plugins api
  • Loading branch information
Perchik71 committed Jan 22, 2025
1 parent b40df8b commit 6b65cb9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Creation Kit Platform Extended Core/Core/Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "Editor API/SSE/TESDataHandler.h"
#include "Editor API/FO4/TESDataHandler.h"
#include "Editor API/SF/TESDataHandler.h"

namespace CreationKitPlatformExtended
{
Expand Down Expand Up @@ -176,6 +177,8 @@ namespace CreationKitPlatformExtended
DataHandler = new EditorAPI::SkyrimSpectialEdition::TESDataHandler_CKPEIntf;
else if (editorVer <= EDITOR_EXECUTABLE_TYPE::EDITOR_FALLOUT_C4_LAST)
DataHandler = new EditorAPI::Fallout4::TESDataHandler_CKPEIntf;
else if (editorVer <= EDITOR_EXECUTABLE_TYPE::EDITOR_STARFIELD_LAST)
DataHandler = new EditorAPI::Starfield::TESDataHandler_CKPEIntf;

DataTAG Data =
{
Expand Down Expand Up @@ -212,6 +215,8 @@ namespace CreationKitPlatformExtended
delete (EditorAPI::SkyrimSpectialEdition::TESDataHandler_CKPEIntf*)DataHandler;
else if (editorVer <= EDITOR_EXECUTABLE_TYPE::EDITOR_FALLOUT_C4_LAST)
delete (EditorAPI::Fallout4::TESDataHandler_CKPEIntf*)DataHandler;
else if (editorVer <= EDITOR_EXECUTABLE_TYPE::EDITOR_STARFIELD_LAST)
delete (EditorAPI::Starfield::TESDataHandler_CKPEIntf*)DataHandler;
}

return bRet;
Expand Down
2 changes: 1 addition & 1 deletion Plug-ins/MyFirstPlugin/CKPE/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <concurrent_vector.h>
#include <concurrent_unordered_map.h>

#include "vmm.h"
#include "Voltek.MemoryManager.h"
#include "Types.h"

#define PROPERTY(read_func, write_func) __declspec(property(get = read_func, put = write_func))
Expand Down
20 changes: 16 additions & 4 deletions Plug-ins/MyFirstPlugin/CKPE/PluginAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,17 @@ namespace CreationKitPlatformExtended
EDITOR_SKYRIM_SE_1_5_3,
EDITOR_SKYRIM_SE_1_5_73,
EDITOR_SKYRIM_SE_1_6_438,
EDITOR_SKYRIM_SE_1_6_1130 = EDITOR_SKYRIM_SE_1_6_438 + 1,
EDITOR_SKYRIM_SE_LAST = EDITOR_SKYRIM_SE_1_6_1130,
EDITOR_SKYRIM_SE_1_6_1130,
EDITOR_SKYRIM_SE_1_6_1378_1,
EDITOR_SKYRIM_SE_LAST = EDITOR_SKYRIM_SE_1_6_1378_1,
EDITOR_FALLOUT_C4_1_10_162_0,
EDITOR_FALLOUT_C4_LAST = EDITOR_FALLOUT_C4_1_10_162_0
EDITOR_FALLOUT_C4_1_10_943_1,
EDITOR_FALLOUT_C4_1_10_982_3,
EDITOR_FALLOUT_C4_LAST = EDITOR_FALLOUT_C4_1_10_982_3,
EDITOR_STARFIELD_1_13_61_0,
EDITOR_STARFIELD_1_14_70_0,
EDITOR_STARFIELD_1_14_74_0,
EDITOR_STARFIELD_LAST = EDITOR_STARFIELD_1_14_74_0,
};

typedef int32_t IResult;
Expand All @@ -56,14 +63,19 @@ namespace CreationKitPlatformExtended

static inline bool __stdcall IsEditorFallout4(EDITOR_EXECUTABLE_TYPE editor)
{
return editor <= EDITOR_EXECUTABLE_TYPE::EDITOR_FALLOUT_C4_LAST;
return (editor >= EDITOR_EXECUTABLE_TYPE::EDITOR_FALLOUT_C4_1_10_162_0) && (editor <= EDITOR_EXECUTABLE_TYPE::EDITOR_FALLOUT_C4_LAST);
}

static inline bool __stdcall IsEditorSkyrimSpecialEdition(EDITOR_EXECUTABLE_TYPE editor)
{
return editor <= EDITOR_EXECUTABLE_TYPE::EDITOR_SKYRIM_SE_LAST;
}

static inline bool __stdcall IsEditorStarfield(EDITOR_EXECUTABLE_TYPE editor)
{
return (editor >= EDITOR_EXECUTABLE_TYPE::EDITOR_STARFIELD_1_13_61_0) && (editor <= EDITOR_EXECUTABLE_TYPE::EDITOR_STARFIELD_LAST);
}

static inline bool __stdcall CheckRuntimePlatformVersion(const char* platform_ver,
uint32_t major_rv, uint32_t minor_rv, uint32_t bug_fixes, uint32_t build)
{
Expand Down
File renamed without changes.

0 comments on commit 6b65cb9

Please sign in to comment.