diff --git a/SKSE/Plugins/doticu_skypal.dll b/SKSE/Plugins/doticu_skypal.dll index 8cbf421..8ab1f42 100644 Binary files a/SKSE/Plugins/doticu_skypal.dll and b/SKSE/Plugins/doticu_skypal.dll differ diff --git a/Scripts/skypal.pex b/Scripts/skypal.pex index 76a3ef3..d6e79ff 100644 Binary files a/Scripts/skypal.pex and b/Scripts/skypal.pex differ diff --git a/Scripts/skypal_bases.pex b/Scripts/skypal_bases.pex index 3725bf7..9c8a86f 100644 Binary files a/Scripts/skypal_bases.pex and b/Scripts/skypal_bases.pex differ diff --git a/Scripts/skypal_references.pex b/Scripts/skypal_references.pex index 5dee4aa..3407f03 100644 Binary files a/Scripts/skypal_references.pex and b/Scripts/skypal_references.pex differ diff --git a/Source/Plugins/doticu_skypal/include/doticu_skypal/main.h b/Source/Plugins/doticu_skypal/include/doticu_skypal/main.h index c30729b..aa9de8e 100644 --- a/Source/Plugins/doticu_skypal/include/doticu_skypal/main.h +++ b/Source/Plugins/doticu_skypal/include/doticu_skypal/main.h @@ -39,6 +39,7 @@ namespace doticu_skypal { public: static Bool_t Has_DLL(); + static Bool_t Has_Version(Int_t major, Int_t minor, Int_t patch, String_t mode = "=="); public: static Float_t Microseconds(); diff --git a/Source/Plugins/doticu_skypal/src/consts.cpp b/Source/Plugins/doticu_skypal/src/consts.cpp index 5ad1a6e..9105fac 100644 --- a/Source/Plugins/doticu_skypal/src/consts.cpp +++ b/Source/Plugins/doticu_skypal/src/consts.cpp @@ -12,7 +12,7 @@ namespace doticu_skypal { const Version_t Consts_t::Skyrim::Required_Version() { DEFINE_VERSION(u16, 1, 5, 97, 0); } - const Version_t Consts_t::SKSE::Minimum_Version() { DEFINE_VERSION(u16, 2, 0, 17, 0); } + const Version_t Consts_t::SKSE::Minimum_Version() { DEFINE_VERSION(u16, 2, 0, 17); } const Version_t Consts_t::Skylib::Current_Version() { DEFINE_VERSION(u16, 1, 0, 0); } diff --git a/Source/Plugins/doticu_skypal/src/main.cpp b/Source/Plugins/doticu_skypal/src/main.cpp index 8b1b260..f75204c 100644 --- a/Source/Plugins/doticu_skypal/src/main.cpp +++ b/Source/Plugins/doticu_skypal/src/main.cpp @@ -102,6 +102,8 @@ namespace doticu_skypal { STATIC("Has_DLL", false, Bool_t, Has_DLL); + STATIC("Has_Version", false, Bool_t, Has_Version, Int_t, Int_t, Int_t, String_t); + STATIC("Microseconds", false, Float_t, Microseconds); STATIC("Milliseconds", false, Float_t, Milliseconds); STATIC("Seconds", false, Float_t, Seconds); @@ -148,6 +150,27 @@ namespace doticu_skypal { return true; } + Bool_t Main_t::Has_Version(Int_t major, Int_t minor, Int_t patch, String_t mode) + { + Version_t version(major, minor, patch); + + if (CString_t::Is_Same("==", mode, true)) { + return Consts_t::Skylib::Current_Version() == version; + } else if (CString_t::Is_Same("!=", mode, true)) { + return Consts_t::Skylib::Current_Version() != version; + } else if (CString_t::Is_Same("<", mode, true)) { + return Consts_t::Skylib::Current_Version() < version; + } else if (CString_t::Is_Same(">", mode, true)) { + return Consts_t::Skylib::Current_Version() > version; + } else if (CString_t::Is_Same("<=", mode, true)) { + return Consts_t::Skylib::Current_Version() <= version; + } else if (CString_t::Is_Same(">=", mode, true)) { + return Consts_t::Skylib::Current_Version() >= version; + } else { + return Consts_t::Skylib::Current_Version() == version; + } + } + Float_t Main_t::Microseconds() { return static_cast(OS_t::Microseconds()); diff --git a/Source/Scripts/skypal.psc b/Source/Scripts/skypal.psc index fc11c6d..733079b 100644 --- a/Source/Scripts/skypal.psc +++ b/Source/Scripts/skypal.psc @@ -1,10 +1,19 @@ ; Copyright © 2020 r-neal-kelly, aka doticu -Scriptname skypal hidden +Scriptname SkyPal hidden -; Use this to check that the .dll is available +; Use this to check if the user installed the plugin correctly bool function Has_DLL() native global +; if (mode == "=="): Tests if the dll version matches args exactly +; if (mode == "!="): Tests if the dll version does not match args exactly +; if (mode == "<"): Tests if the dll version is less than args +; if (mode == ">"): Tests if the dll version is greater than args +; if (mode == "<="): Tests if the dll version is less than or equal to args +; if (mode == ">="): Tests if the dll version is greater than or equal to args +; if (mode == invalid): Passes the default mode listed in the signature. +bool function Has_Version(int major, int minor, int patch, string mode = "==") native global + ; These can be used for performance timers. float function Microseconds() native global float function Milliseconds() native global diff --git a/Source/Scripts/skypal_bases.psc b/Source/Scripts/skypal_bases.psc index 6323a1b..2f91e8e 100644 --- a/Source/Scripts/skypal_bases.psc +++ b/Source/Scripts/skypal_bases.psc @@ -1,6 +1,6 @@ ; Copyright © 2020 r-neal-kelly, aka doticu -Scriptname skypal_bases hidden +Scriptname SkyPal_Bases hidden ;/ Converters: diff --git a/Source/Scripts/skypal_references.psc b/Source/Scripts/skypal_references.psc index 8523486..45a9199 100644 --- a/Source/Scripts/skypal_references.psc +++ b/Source/Scripts/skypal_references.psc @@ -1,6 +1,6 @@ ; Copyright © 2020 r-neal-kelly, aka doticu -Scriptname skypal_references hidden +Scriptname SkyPal_References hidden ;/ Getters: