Skip to content

Commit 4c68999

Browse files
committed
Update script with SKSE version check and update DLL
In addition to DLL changes, the MenuScript was updated to version check SKSE.
1 parent 4015c48 commit 4c68999

File tree

6 files changed

+56
-18
lines changed

6 files changed

+56
-18
lines changed

DLL Source/J42_ARR_plugin.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
<ProjectGuid>{0091BF4A-C88C-4BB2-A429-3DF4F43C8232}</ProjectGuid>
1515
<Keyword>Win32Proj</Keyword>
1616
<RootNamespace>J42_ARR_plugin</RootNamespace>
17-
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
17+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1818
</PropertyGroup>
1919
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2020
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
2121
<ConfigurationType>DynamicLibrary</ConfigurationType>
2222
<UseDebugLibraries>true</UseDebugLibraries>
23-
<PlatformToolset>v141</PlatformToolset>
23+
<PlatformToolset>v142</PlatformToolset>
2424
<CharacterSet>MultiByte</CharacterSet>
2525
<UseIntelMKL>No</UseIntelMKL>
2626
<UseILP64Interfaces>false</UseILP64Interfaces>
2727
</PropertyGroup>
2828
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
2929
<ConfigurationType>DynamicLibrary</ConfigurationType>
3030
<UseDebugLibraries>false</UseDebugLibraries>
31-
<PlatformToolset>v140</PlatformToolset>
31+
<PlatformToolset>v142</PlatformToolset>
3232
<WholeProgramOptimization>false</WholeProgramOptimization>
3333
<CharacterSet>MultiByte</CharacterSet>
3434
<UseIntelMKL>No</UseIntelMKL>

DLL Source/main.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,18 @@ const UInt8 kDamageResistInject2Bytes[] = {
215215
0xc0, 0x44, 0x0f, 0x2f, 0xc1, 0x72, 0x04, 0x44, 0x0f, 0x28, 0xc1
216216
};
217217
*/
218+
/* Version 1.5.80
218219
const RelocAddr<uintptr_t> kDamageResistInject2Address(0x00624FA2);
219220
const UInt8 kDamageResistInject2Bytes[] = {
220221
0xf3, 0x0f, 0x10, 0x0d, 0x32, 0xd0, 0xf1, 0x00, 0xf3, 0x44, 0x0f, 0x58,
221222
0xc0, 0x44, 0x0f, 0x2f, 0xc1, 0x72, 0x04, 0x44, 0x0f, 0x28, 0xc1
222223
};
224+
*/
225+
const RelocAddr<uintptr_t> kDamageResistInject2Address(0x00624FA2);
226+
const UInt8 kDamageResistInject2Bytes[] = {
227+
0xf3, 0x0f, 0x10, 0x0d, 0x22, 0xd0, 0xf1, 0x00, 0xf3, 0x44, 0x0f, 0x58,
228+
0xc0, 0x44, 0x0f, 0x2f, 0xc1, 0x72, 0x04, 0x44, 0x0f, 0x28, 0xc1
229+
};
223230

224231
const UInt8 kAsm8Nop = 0x90;
225232
const UInt16 kAsm16Nop = 0x9090;
@@ -378,7 +385,7 @@ extern "C" {
378385
// populate info structure
379386
info->infoVersion = PluginInfo::kInfoVersion;
380387
info->name = "J42_ARR_plugin";
381-
info->version = 20006;
388+
info->version = 20007;
382389

383390
// store plugin handle so we can identify ourselves later
384391
g_pluginHandle = skse->GetPluginHandle();
@@ -394,7 +401,8 @@ extern "C" {
394401
//else if (skse->runtimeVersion != RUNTIME_VERSION_1_5_53)
395402
//else if (skse->runtimeVersion != RUNTIME_VERSION_1_5_62)
396403
//else if (skse->runtimeVersion != RUNTIME_VERSION_1_5_73)
397-
else if (skse->runtimeVersion != RUNTIME_VERSION_1_5_80)
404+
//else if (skse->runtimeVersion != RUNTIME_VERSION_1_5_80)
405+
else if (skse->runtimeVersion != RUNTIME_VERSION_1_5_97)
398406
{
399407
_ERROR("Unsupported runtime version %08X.", skse->runtimeVersion);
400408

ReadMe.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ Requirements:
178178
--------
179179
Changes:
180180
--------
181+
2.0.7 (SE only)
182+
- Updated for SKSE 2.0.17 / Runtime 1.5.97
183+
- Changed display of Damage Taken text on options screen to percentage instead of decimals.
184+
- Thanks to SSyl for the assistance!
185+
181186
2.0.6 (SE only)
182187
- Updated for SKSE 2.0.16 / Runtime 1.5.80
183188
- Thanks to SSyl for the assistance!

SKSE/Plugins/J42_ARR_plugin.dll

-10.5 KB
Binary file not shown.

scripts/J42_ARR_MenuScript.pex

1.67 KB
Binary file not shown.

source/scripts/J42_ARR_MenuScript.psc

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,36 @@ string version
2323
string[] modes
2424
string[] formulas
2525

26+
; Supported SKSE64 Version.
27+
Int ARRSKSE64Version = 20017
28+
2629
Int Function GetVersion()
2730
;99999 == 9.99.99
28-
return 20006
31+
return 20007
2932
EndFunction
3033

34+
Event OnInit() ; This event will run once, when the script is initialized
35+
OnGameReload()
36+
EndEvent
37+
38+
Event OnGameReload()
39+
if (SKSE.GetVersionRelease() == 0)
40+
debug.Notification(ModName+": SKSE64 is not running. Mod will not work!")
41+
debug.Trace(self+": SKSE not detected")
42+
return
43+
44+
elseIf (SKSE.GetVersion() * 10000 + SKSE.GetVersionMinor() * 100 + SKSE.GetVersionBeta() != ARRSKSE64Version)
45+
debug.Notification(ModName+": Mod will not work correctly!")
46+
debug.MessageBox("Armor Rating Redux will not work correctly!\nWrong SKSE64 version:" \
47+
+"\nRequired version: " + ARRSKSE64Version/10000+"."+(ARRSKSE64Version/100)%100+"."+ARRSKSE64Version%100 \
48+
+"\nDetected version: "+SKSE.GetVersion()+"."+SKSE.GetVersionMinor()+"."+SKSE.GetVersionBeta())
49+
debug.Trace(self+": Wrong SKSE64 version. Armor Rating Redux will not work correctly! Required version: 2.0.17 Detected version:" + SKSE.GetVersion() + "." + SKSE.GetVersionMinor() + "." + SKSE.GetVersionBeta())
50+
51+
return
52+
endif
53+
54+
EndEvent
55+
3156
Event OnVersionUpdate(Int ver)
3257
version = ver/10000+"."+(ver/100)%100+"."+ver%100
3358
debug.Notification(ModName+": Version "+version)
@@ -121,18 +146,18 @@ Event OnPageReset(string page)
121146
;right side
122147
SetCursorPosition(1)
123148
AddHeaderOption("$J42_ARR_Title_DamageTaken")
124-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+50+"}",J42_ARR_MainQuest.Calculate(50), "{5}", OPTION_FLAG_DISABLED)
125-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+100+"}",J42_ARR_MainQuest.Calculate(100), "{5}", OPTION_FLAG_DISABLED)
126-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+200+"}",J42_ARR_MainQuest.Calculate(200), "{5}", OPTION_FLAG_DISABLED)
127-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+300+"}",J42_ARR_MainQuest.Calculate(300), "{5}", OPTION_FLAG_DISABLED)
128-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+400+"}",J42_ARR_MainQuest.Calculate(400), "{5}", OPTION_FLAG_DISABLED)
129-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+500+"}",J42_ARR_MainQuest.Calculate(500), "{5}", OPTION_FLAG_DISABLED)
130-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+667+"}",J42_ARR_MainQuest.Calculate(667), "{5}", OPTION_FLAG_DISABLED)
131-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+800+"}",J42_ARR_MainQuest.Calculate(800), "{5}", OPTION_FLAG_DISABLED)
132-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+1000+"}",J42_ARR_MainQuest.Calculate(1000), "{5}", OPTION_FLAG_DISABLED)
133-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+1500+"}",J42_ARR_MainQuest.Calculate(1500), "{5}", OPTION_FLAG_DISABLED)
134-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+2000+"}",J42_ARR_MainQuest.Calculate(2000), "{5}", OPTION_FLAG_DISABLED)
135-
AddSliderOption("$J42_ARR_Info_At_X_AR{"+5000+"}",J42_ARR_MainQuest.Calculate(5000), "{5}", OPTION_FLAG_DISABLED)
149+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+50+"}",J42_ARR_MainQuest.Calculate(50)*100, "{2}%", OPTION_FLAG_DISABLED)
150+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+100+"}",J42_ARR_MainQuest.Calculate(100)*100, "{2}%", OPTION_FLAG_DISABLED)
151+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+200+"}",J42_ARR_MainQuest.Calculate(200)*100, "{2}%", OPTION_FLAG_DISABLED)
152+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+300+"}",J42_ARR_MainQuest.Calculate(300)*100, "{2}%", OPTION_FLAG_DISABLED)
153+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+400+"}",J42_ARR_MainQuest.Calculate(400)*100, "{2}%", OPTION_FLAG_DISABLED)
154+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+500+"}",J42_ARR_MainQuest.Calculate(500)*100, "{2}%", OPTION_FLAG_DISABLED)
155+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+667+"}",J42_ARR_MainQuest.Calculate(667)*100, "{2}%", OPTION_FLAG_DISABLED)
156+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+800+"}",J42_ARR_MainQuest.Calculate(800)*100, "{2}%", OPTION_FLAG_DISABLED)
157+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+1000+"}",J42_ARR_MainQuest.Calculate(1000)*100, "{2}%", OPTION_FLAG_DISABLED)
158+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+1500+"}",J42_ARR_MainQuest.Calculate(1500)*100, "{2}%", OPTION_FLAG_DISABLED)
159+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+2000+"}",J42_ARR_MainQuest.Calculate(2000)*100, "{2}%", OPTION_FLAG_DISABLED)
160+
AddSliderOption("$J42_ARR_Info_At_X_AR{"+5000+"}",J42_ARR_MainQuest.Calculate(5000)*100, "{2}%", OPTION_FLAG_DISABLED)
136161
Endif
137162

138163
EndEvent

0 commit comments

Comments
 (0)