Skip to content

Commit 1809be1

Browse files
committed
feat: PipboyValue
1 parent 4bc16c9 commit 1809be1

2 files changed

Lines changed: 31 additions & 27 deletions

File tree

include/RE/P/PipboyPrimitiveValue.h

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,33 @@ namespace RE
1212
public PipboyValue
1313
{
1414
public:
15-
virtual ~PipboyPrimitiveValue() {} // 00
15+
static constexpr auto RTTI{ RTTI::PipboyPrimitiveValue_unsignedint_ };
16+
static constexpr auto VTABLE{ VTABLE::PipboyPrimitiveValue_unsignedint_ };
17+
18+
PipboyPrimitiveValue(std::uint32_t a_value, PipboyValue* a_parent) :
19+
PipboyValue(a_parent), m_value(a_value)
20+
{}
1621

1722
// override
1823
virtual void CleanDirtyToGame() override {} // 00
1924
virtual void Serialize([[maybe_unused]] Json::Value* a_json) override {} // 01
2025
virtual void SerializeChanges([[maybe_unused]] BSBinarySerializer& a_serializer, [[maybe_unused]] bool a_fullSerialization) override {} // 03
2126
virtual SERIALIZATION_DATA_TYPE GetType() override { return SERIALIZATION_DATA_TYPE::kUint32; }
2227

23-
PipboyPrimitiveValue(std::uint32_t a_value, PipboyValue* a_parentValue) :
24-
PipboyValue(a_parentValue), value(a_value) {}
25-
26-
void ctor(std::uint32_t a_value, PipboyValue* a_parentValue)
28+
void ctor(std::uint32_t a_value, PipboyValue* a_parent)
2729
{
2830
using func_t = decltype(&PipboyPrimitiveValue<std::uint32_t>::ctor);
2931
static REL::Relocation<func_t> func{ ID::PipboyPrimitiveValue::uint32::ctor };
30-
func(this, a_value, a_parentValue);
32+
func(this, a_value, a_parent);
3133
}
3234

3335
operator std::uint32_t() const
3436
{
35-
return value;
37+
return m_value;
3638
}
3739

3840
// members
39-
std::uint32_t value; // 18
41+
std::uint32_t m_value; // 0x18
4042
};
4143
static_assert(sizeof(PipboyPrimitiveValue<std::uint32_t>) == 0x20);
4244

@@ -45,31 +47,33 @@ namespace RE
4547
public PipboyValue
4648
{
4749
public:
48-
virtual ~PipboyPrimitiveValue() {} // 00
50+
static constexpr auto RTTI{ RTTI::PipboyPrimitiveValue_bool_ };
51+
static constexpr auto VTABLE{ VTABLE::PipboyPrimitiveValue_bool_ };
52+
53+
PipboyPrimitiveValue(bool a_value, PipboyValue* a_parent) :
54+
PipboyValue(a_parent), m_value(a_value)
55+
{}
4956

5057
// override
5158
virtual void CleanDirtyToGame() override {} // 00
5259
virtual void Serialize([[maybe_unused]] Json::Value* a_json) override {} // 01
5360
virtual void SerializeChanges([[maybe_unused]] BSBinarySerializer& a_serializer, [[maybe_unused]] bool a_fullSerialization) override {} // 03
5461
virtual SERIALIZATION_DATA_TYPE GetType() override { return SERIALIZATION_DATA_TYPE::kBool; }
5562

56-
PipboyPrimitiveValue(bool a_value, PipboyValue* a_parentValue) :
57-
PipboyValue(a_parentValue), value(a_value) {}
58-
59-
void ctor(bool a_value, PipboyValue* a_parentValue)
63+
void ctor(bool a_value, PipboyValue* a_parent)
6064
{
6165
using func_t = decltype(&PipboyPrimitiveValue<bool>::ctor);
6266
static REL::Relocation<func_t> func{ ID::PipboyPrimitiveValue::boolean::ctor };
63-
func(this, a_value, a_parentValue);
67+
func(this, a_value, a_parent);
6468
}
6569

6670
operator bool() const
6771
{
68-
return value;
72+
return m_value;
6973
}
7074

7175
// members
72-
bool value; // 18
76+
bool m_value; // 0x18
7377
};
7478
static_assert(sizeof(PipboyPrimitiveValue<bool>) == 0x20);
7579
}

include/RE/P/PipboyValue.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ namespace RE
2828
kObject = 0x8,
2929
};
3030

31+
PipboyValue(PipboyValue* a_parent)
32+
{
33+
ctor(a_parent);
34+
};
35+
3136
virtual ~PipboyValue() = default; // 00
3237

3338
// add
@@ -36,23 +41,18 @@ namespace RE
3641
virtual void SerializeChanges(BSBinarySerializer& a_serializer, bool a_fullSerialize); // 03
3742
virtual SERIALIZATION_DATA_TYPE GetType() = 0; // 04
3843

39-
PipboyValue(PipboyValue* a_parentValue)
40-
{
41-
ctor(a_parentValue);
42-
};
43-
44-
void ctor(PipboyValue* a_parentValue)
44+
void ctor(PipboyValue* a_parent)
4545
{
4646
using func_t = decltype(&PipboyValue::ctor);
4747
static REL::Relocation<func_t> func{ ID::PipboyValue::ctor };
48-
return func(this, a_parentValue);
48+
func(this, a_parent);
4949
}
5050

5151
// members
52-
std::uint32_t id; // 08
53-
bool isDirtyGame; // 0C
54-
bool isDirtyToCompanion; // 0D
55-
PipboyValue* parentValue; // 10
52+
std::uint32_t m_id; // 0x08
53+
bool m_isDirtyGame; // 0x0C
54+
bool m_isDirtyToCompanion; // 0x0D
55+
PipboyValue* m_parent; // 0x10
5656
};
5757
static_assert(sizeof(PipboyValue) == 0x18);
5858
}

0 commit comments

Comments
 (0)