Skip to content

Commit 7395145

Browse files
committed
renamed scripts to have capital case names and added Has_Version function
1 parent 55348f8 commit 7395145

10 files changed

Lines changed: 38 additions & 5 deletions

File tree

SKSE/Plugins/doticu_skypal.dll

2.5 KB
Binary file not shown.

Scripts/skypal.pex

80 Bytes
Binary file not shown.

Scripts/skypal_bases.pex

-7 Bytes
Binary file not shown.

Scripts/skypal_references.pex

-7 Bytes
Binary file not shown.

Source/Plugins/doticu_skypal/include/doticu_skypal/main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ namespace doticu_skypal {
3939

4040
public:
4141
static Bool_t Has_DLL();
42+
static Bool_t Has_Version(Int_t major, Int_t minor, Int_t patch, String_t mode = "==");
4243

4344
public:
4445
static Float_t Microseconds();

Source/Plugins/doticu_skypal/src/consts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace doticu_skypal {
1212

1313
const Version_t<u16> Consts_t::Skyrim::Required_Version() { DEFINE_VERSION(u16, 1, 5, 97, 0); }
1414

15-
const Version_t<u16> Consts_t::SKSE::Minimum_Version() { DEFINE_VERSION(u16, 2, 0, 17, 0); }
15+
const Version_t<u16> Consts_t::SKSE::Minimum_Version() { DEFINE_VERSION(u16, 2, 0, 17); }
1616

1717
const Version_t<u16> Consts_t::Skylib::Current_Version() { DEFINE_VERSION(u16, 1, 0, 0); }
1818

Source/Plugins/doticu_skypal/src/main.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ namespace doticu_skypal {
102102

103103
STATIC("Has_DLL", false, Bool_t, Has_DLL);
104104

105+
STATIC("Has_Version", false, Bool_t, Has_Version, Int_t, Int_t, Int_t, String_t);
106+
105107
STATIC("Microseconds", false, Float_t, Microseconds);
106108
STATIC("Milliseconds", false, Float_t, Milliseconds);
107109
STATIC("Seconds", false, Float_t, Seconds);
@@ -148,6 +150,27 @@ namespace doticu_skypal {
148150
return true;
149151
}
150152

153+
Bool_t Main_t::Has_Version(Int_t major, Int_t minor, Int_t patch, String_t mode)
154+
{
155+
Version_t<u16> version(major, minor, patch);
156+
157+
if (CString_t::Is_Same("==", mode, true)) {
158+
return Consts_t::Skylib::Current_Version() == version;
159+
} else if (CString_t::Is_Same("!=", mode, true)) {
160+
return Consts_t::Skylib::Current_Version() != version;
161+
} else if (CString_t::Is_Same("<", mode, true)) {
162+
return Consts_t::Skylib::Current_Version() < version;
163+
} else if (CString_t::Is_Same(">", mode, true)) {
164+
return Consts_t::Skylib::Current_Version() > version;
165+
} else if (CString_t::Is_Same("<=", mode, true)) {
166+
return Consts_t::Skylib::Current_Version() <= version;
167+
} else if (CString_t::Is_Same(">=", mode, true)) {
168+
return Consts_t::Skylib::Current_Version() >= version;
169+
} else {
170+
return Consts_t::Skylib::Current_Version() == version;
171+
}
172+
}
173+
151174
Float_t Main_t::Microseconds()
152175
{
153176
return static_cast<Float_t>(OS_t::Microseconds());

Source/Scripts/skypal.psc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
; Copyright © 2020 r-neal-kelly, aka doticu
22

3-
Scriptname skypal hidden
3+
Scriptname SkyPal hidden
44

5-
; Use this to check that the .dll is available
5+
; Use this to check if the user installed the plugin correctly
66
bool function Has_DLL() native global
77

8+
; if (mode == "=="): Tests if the dll version matches args exactly
9+
; if (mode == "!="): Tests if the dll version does not match args exactly
10+
; if (mode == "<"): Tests if the dll version is less than args
11+
; if (mode == ">"): Tests if the dll version is greater than args
12+
; if (mode == "<="): Tests if the dll version is less than or equal to args
13+
; if (mode == ">="): Tests if the dll version is greater than or equal to args
14+
; if (mode == invalid): Passes the default mode listed in the signature.
15+
bool function Has_Version(int major, int minor, int patch, string mode = "==") native global
16+
817
; These can be used for performance timers.
918
float function Microseconds() native global
1019
float function Milliseconds() native global

Source/Scripts/skypal_bases.psc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; Copyright © 2020 r-neal-kelly, aka doticu
22

3-
Scriptname skypal_bases hidden
3+
Scriptname SkyPal_Bases hidden
44

55
;/
66
Converters:

Source/Scripts/skypal_references.psc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; Copyright © 2020 r-neal-kelly, aka doticu
22

3-
Scriptname skypal_references hidden
3+
Scriptname SkyPal_References hidden
44

55
;/
66
Getters:

0 commit comments

Comments
 (0)