Compare commits
2 Commits
6de83fb79c
...
281f2a4f66
| Author | SHA1 | Date | |
|---|---|---|---|
| 281f2a4f66 | |||
| c2e1fd1c72 |
@ -1 +1 @@
|
|||||||
version = 2.1.3
|
version = 2.1.4
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -2,12 +2,17 @@ option(ENABLE_VCPKG OFF)
|
|||||||
cmake_minimum_required(VERSION 3.21)
|
cmake_minimum_required(VERSION 3.21)
|
||||||
message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
|
message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
|
||||||
|
|
||||||
|
# Get current version
|
||||||
|
file(READ "${CMAKE_SOURCE_DIR}/../../SKSE/Plugins/EnderalVersion.ini" CONFIG_CONTENT)
|
||||||
|
string(REGEX MATCH "version[ \t]*=[ \t]*([0-9.]+)" _ ${CONFIG_CONTENT})
|
||||||
|
set(VERSION_NUMBER "${CMAKE_MATCH_1}")
|
||||||
|
|
||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
## Define project
|
## Define project
|
||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
project(
|
project(
|
||||||
EnderalSE
|
EnderalSE
|
||||||
VERSION 2.1.4
|
VERSION ${VERSION_NUMBER}
|
||||||
DESCRIPTION "Enderal SE DLL"
|
DESCRIPTION "Enderal SE DLL"
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
@ -20,7 +25,7 @@ configure_file(
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
#include(GNUInstallDirs)
|
#include(GNUInstallDirs)
|
||||||
|
|
||||||
file(
|
file(
|
||||||
@ -78,7 +83,6 @@ FetchContent_MakeAvailable(simpleini)
|
|||||||
INCLUDE_DIRECTORIES(${simpleini_SOURCE_DIR})
|
INCLUDE_DIRECTORIES(${simpleini_SOURCE_DIR})
|
||||||
|
|
||||||
# rapidcsv
|
# rapidcsv
|
||||||
set(RAPIDCSV_INCLUDE_DIRS ${rapidcsv_SOURCE_DIR}/src)
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
rapidcsv
|
rapidcsv
|
||||||
URL "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.87.tar.gz"
|
URL "https://github.com/d99kris/rapidcsv/archive/refs/tags/v8.87.tar.gz"
|
||||||
|
|||||||
@ -41,6 +41,28 @@ namespace Papyrus::PapyrusFunctions
|
|||||||
return NewGameCount();
|
return NewGameCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline std::string GetEnderalVersion(RE::StaticFunctionTag*)
|
||||||
|
{
|
||||||
|
const auto pluginVersion = SKSE::PluginDeclaration::GetSingleton()->GetVersion();
|
||||||
|
std::string versionStr;
|
||||||
|
|
||||||
|
if (pluginVersion.build() > 0) {
|
||||||
|
versionStr = std::format("{}.{}.{}.{}", pluginVersion.major(), pluginVersion.minor(), pluginVersion.patch(), pluginVersion.build());
|
||||||
|
} else {
|
||||||
|
versionStr = std::format("{}.{}.{}", pluginVersion.major(), pluginVersion.minor(), pluginVersion.patch());
|
||||||
|
}
|
||||||
|
|
||||||
|
return versionStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline std::uint32_t GetEnderalVersionInt(RE::StaticFunctionTag*)
|
||||||
|
{
|
||||||
|
const auto pluginVersion = SKSE::PluginDeclaration::GetSingleton()->GetVersion();
|
||||||
|
std::string versionStr = std::format("{}{}{}{}", pluginVersion.major(), pluginVersion.minor(), pluginVersion.patch(), pluginVersion.build());
|
||||||
|
|
||||||
|
return std::stoi(versionStr);
|
||||||
|
}
|
||||||
|
|
||||||
inline RE::TESObjectREFR* GetCurrentContainer(RE::StaticFunctionTag*)
|
inline RE::TESObjectREFR* GetCurrentContainer(RE::StaticFunctionTag*)
|
||||||
{
|
{
|
||||||
const auto handle = RE::ContainerMenu::GetTargetRefHandle();
|
const auto handle = RE::ContainerMenu::GetTargetRefHandle();
|
||||||
@ -155,6 +177,10 @@ namespace Papyrus::PapyrusFunctions
|
|||||||
logger::info("{}", "Registered CreatePotion"sv);
|
logger::info("{}", "Registered CreatePotion"sv);
|
||||||
BIND(GetNewGameCount);
|
BIND(GetNewGameCount);
|
||||||
logger::info("{}", "Registered GetNewGameCount"sv);
|
logger::info("{}", "Registered GetNewGameCount"sv);
|
||||||
|
BIND(GetEnderalVersion);
|
||||||
|
logger::info("{}", "Registered GetEnderalVersion"sv);
|
||||||
|
BIND(GetEnderalVersionInt);
|
||||||
|
logger::info("{}", "Registered GetEnderalVersionInt"sv);
|
||||||
BIND(GetCurrentContainer);
|
BIND(GetCurrentContainer);
|
||||||
logger::info("{}", "Registered GetCurrentContainer"sv);
|
logger::info("{}", "Registered GetCurrentContainer"sv);
|
||||||
BIND(GetPlayerFollowers);
|
BIND(GetPlayerFollowers);
|
||||||
|
|||||||
@ -26,23 +26,16 @@ inline uint8_t NewGameCount(bool increment = false)
|
|||||||
|
|
||||||
inline void CheckIncompatibleMods()
|
inline void CheckIncompatibleMods()
|
||||||
{
|
{
|
||||||
bool bPrinted = false;
|
const auto pluginVersion = SKSE::PluginDeclaration::GetSingleton()->GetVersion();
|
||||||
if (std::filesystem::exists("Data\\SKSE\\Plugins\\EnderalVersion.ini")) {
|
std::string versionStr;
|
||||||
CSimpleIniA ini;
|
|
||||||
ini.SetUnicode(false);
|
if (pluginVersion.build() > 0) {
|
||||||
ini.SetMultiKey(false);
|
versionStr = std::format("{}.{}.{}.{}", pluginVersion.major(), pluginVersion.minor(), pluginVersion.patch(), pluginVersion.build());
|
||||||
ini.LoadFile("Data/SKSE/Plugins/EnderalVersion.ini");
|
} else {
|
||||||
const char* version = ini.GetValue("", "version", "2.0.x");
|
versionStr = std::format("{}.{}.{}", pluginVersion.major(), pluginVersion.minor(), pluginVersion.patch());
|
||||||
std::regex version_expr("^[\\d\\.]+$");
|
|
||||||
if (std::regex_match(version, version_expr)) {
|
|
||||||
RE::ConsoleLog::GetSingleton()->Print(std::format("Loaded SureAI's Enderal: Forgotten Stories | Special Edition v{} by Eddoursul and contributors", version).c_str());
|
|
||||||
bPrinted = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bPrinted) {
|
RE::ConsoleLog::GetSingleton()->Print(std::format("Loaded SureAI's Enderal: Forgotten Stories | Special Edition v{} by Eddoursul and contributors", versionStr).c_str());
|
||||||
RE::ConsoleLog::GetSingleton()->Print("Loaded SureAI's Enderal: Forgotten Stories | Special Edition v2.0.x by Eddoursul and contributors");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RE::BSResourceNiBinaryStream("scripts/_00e_questfunctions.pex").good() || RE::BSResourceNiBinaryStream("scripts/_00e_game_skillmenusc.pex").good() || RE::TESDataHandler::GetSingleton()->LookupForm<RE::TESQuest>(0x10AA2, "Skyrim.esm"))
|
if (RE::BSResourceNiBinaryStream("scripts/_00e_questfunctions.pex").good() || RE::BSResourceNiBinaryStream("scripts/_00e_game_skillmenusc.pex").good() || RE::TESDataHandler::GetSingleton()->LookupForm<RE::TESQuest>(0x10AA2, "Skyrim.esm"))
|
||||||
{
|
{
|
||||||
@ -107,7 +100,8 @@ inline void CheckScriptVersions()
|
|||||||
|
|
||||||
std::map<std::string, short> scripts;
|
std::map<std::string, short> scripts;
|
||||||
scripts["_00e_a2_eyeofthestormsc"] = 1;
|
scripts["_00e_a2_eyeofthestormsc"] = 1;
|
||||||
scripts["EnderalFunctions"] = 1;
|
scripts["_00E_EnderalVersion"] = 1;
|
||||||
|
scripts["EnderalFunctions"] = 2;
|
||||||
scripts["_00E_PlayerFunctions"] = 2;
|
scripts["_00E_PlayerFunctions"] = 2;
|
||||||
scripts["_00E_PlayerSetUpScript"] = 1;
|
scripts["_00E_PlayerSetUpScript"] = 1;
|
||||||
scripts["_00E_EngineBugfixAlias"] = 2;
|
scripts["_00E_EngineBugfixAlias"] = 2;
|
||||||
|
|||||||
@ -3,19 +3,12 @@ Scriptname _00E_EnderalVersion extends ReferenceAlias Hidden
|
|||||||
|
|
||||||
int iPatchVersion
|
int iPatchVersion
|
||||||
|
|
||||||
; Do not make comparisons with GetVersionFull(), versions are not float numbers, use GetVersion().
|
int function _GetScriptVersion() Global
|
||||||
float function _GetVersionFull() global
|
return 1
|
||||||
; ABCD.E
|
endFunction
|
||||||
; A - engine version (1 - LE, 2 - SE)
|
|
||||||
; B - backward-incompatible update
|
|
||||||
; C - backward-compatible update
|
|
||||||
; D - hotfix
|
|
||||||
; E - build
|
|
||||||
return 2130.0
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
int function GetVersion() global
|
int function GetVersion() global
|
||||||
return Math.Floor(_GetVersionFull())
|
return EnderalFunctions.GetEnderalVersionInt()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
Event OnInit()
|
Event OnInit()
|
||||||
@ -27,8 +20,6 @@ EndEvent
|
|||||||
Event OnPlayerLoadGame()
|
Event OnPlayerLoadGame()
|
||||||
|
|
||||||
if iPatchVersion < GetVersion()
|
if iPatchVersion < GetVersion()
|
||||||
;Utility.Wait(0.1) ; wait for menu mode to end
|
|
||||||
;
|
|
||||||
iPatchVersion = GetVersion()
|
iPatchVersion = GetVersion()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
Scriptname EnderalFunctions Hidden
|
Scriptname EnderalFunctions Hidden
|
||||||
|
|
||||||
int function _GetScriptVersion() Global
|
int function _GetScriptVersion() Global
|
||||||
return 1
|
return 2
|
||||||
endFunction
|
endFunction
|
||||||
|
|
||||||
float function CalculateContentStrength(ObjectReference container) native global
|
float function CalculateContentStrength(ObjectReference container) native global
|
||||||
@ -12,6 +12,10 @@ ObjectReference function GetCurrentContainer() native global
|
|||||||
|
|
||||||
int function GetNewGameCount() native global
|
int function GetNewGameCount() native global
|
||||||
|
|
||||||
|
string function GetEnderalVersion() native global
|
||||||
|
|
||||||
|
int function GetEnderalVersionInt() native global
|
||||||
|
|
||||||
Actor[] function GetPlayerFollowers() native global
|
Actor[] function GetPlayerFollowers() native global
|
||||||
|
|
||||||
String Function GetAutosaveName(int index) native global
|
String Function GetAutosaveName(int index) native global
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user