Skip to content

Commit ddc5202

Browse files
committed
feat: misc additions
1 parent 4cf698d commit ddc5202

4 files changed

Lines changed: 31 additions & 1 deletion

File tree

include/RE/IDs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@ namespace RE::ID
18011801
inline constexpr REL::ID AllFormsEditorIDMapLock{ 4796477 };
18021802
inline constexpr REL::ID GetFile{ 2193103 };
18031803
inline constexpr REL::ID GetFormByNumericID{ 2193092 };
1804-
inline constexpr REL::ID GetFormEnumString{ 1529598 };
1804+
inline constexpr REL::ID GetFormEnumString{ 1309967 };
18051805
inline constexpr REL::ID GetFormTypeFromString{ 2193108 };
18061806
inline constexpr REL::ID SetTemporary{ 2193125 };
18071807
}

include/RE/S/SCRIPT_FUNCTION.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ namespace RE
5050
return nullptr;
5151
}
5252

53+
template <std::uint16_t SIZE>
54+
inline void SetParameters(SCRIPT_PARAMETER (&a_params)[SIZE])
55+
{
56+
paramCount = SIZE;
57+
parameters = a_params;
58+
}
59+
60+
void SetParameters();
61+
5362
// members
5463
const char* functionName{ "" }; // 00
5564
const char* shortName{ "" }; // 08

include/RE/T/TESForm.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,17 @@ namespace RE
187187
return form ? form->As<T>() : nullptr;
188188
}
189189

190+
[[nodiscard]] static std::uint32_t GetFormCode(ENUM_FORM_ID a_formType)
191+
{
192+
auto formEnumString = GetFormEnumString();
193+
return formEnumString[std::to_underlying(a_formType)].formCode;
194+
}
195+
196+
[[nodiscard]] std::uint32_t GetFormCode() const
197+
{
198+
return GetFormCode(GetFormType());
199+
}
200+
190201
[[nodiscard]] static std::span<FORM_ENUM_STRING, 159> GetFormEnumString()
191202
{
192203
static REL::Relocation<FORM_ENUM_STRING(*)[159]> functions{ ID::TESForm::GetFormEnumString };

src/RE/S/SCRIPT_FUNCTION.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "RE/S/SCRIPT_FUNCTION.h"
2+
3+
namespace RE
4+
{
5+
void SCRIPT_FUNCTION::SetParameters()
6+
{
7+
paramCount = 0;
8+
parameters = nullptr;
9+
}
10+
}

0 commit comments

Comments
 (0)