Skip to content

Commit

Permalink
Add TESTopicInfoEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Jun 16, 2024
1 parent 5cdde1d commit e2996a5
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,7 @@ set(SOURCES
include/RE/Q/QuestEvents.h
include/RE/Q/QuestObjectiveStates.h
include/RE/Q/QuestStatus.h
include/RE/R/REFREventCallbacks.h
include/RE/R/RaceSexCamera.h
include/RE/R/RaceSexMenu.h
include/RE/R/RaceSexMenuEvent.h
Expand Down Expand Up @@ -1575,6 +1576,7 @@ set(SOURCES
include/RE/T/TESTexture1024.h
include/RE/T/TESTopic.h
include/RE/T/TESTopicInfo.h
include/RE/T/TESTopicInfoEvent.h
include/RE/T/TESTrackedStatsEvent.h
include/RE/T/TESUniqueIDChangeEvent.h
include/RE/T/TESValueForm.h
Expand Down
4 changes: 2 additions & 2 deletions include/RE/D/DialogueItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace RE
class DialogueItem : public BSIntrusiveRefCounted
{
public:
DialogueItem(TESQuest* a_quest, TESTopic* a_topic, TESTopicInfo* a_topicInfo, Actor* a_speaker)
DialogueItem(TESQuest* a_quest, TESTopic* a_topic, TESTopicInfo* a_topicInfo, TESObjectREFR* a_speaker)
{
Ctor(a_quest, a_topic, a_topicInfo, a_speaker);
}
Expand All @@ -60,7 +60,7 @@ namespace RE
ExtraSayToTopicInfo* extraData{ nullptr }; // 40

private:
DialogueItem* Ctor(TESQuest* a_quest, TESTopic* a_topic, TESTopicInfo* a_topicInfo, Actor* a_speaker)
DialogueItem* Ctor(TESQuest* a_quest, TESTopic* a_topic, TESTopicInfo* a_topicInfo, TESObjectREFR* a_speaker)
{
using func_t = decltype(&DialogueItem::Ctor);
REL::Relocation<func_t> func{ RELOCATION_ID(34413, 35220) };
Expand Down
27 changes: 27 additions & 0 deletions include/RE/R/REFREventCallbacks.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once

#include "RE/B/BSIntrusiveRefCounted.h"

namespace RE
{
class BSStorage;

namespace REFREventCallbacks
{
class IEventCallback : public BSIntrusiveRefCounted
{
public:
inline static constexpr auto RTTI = RTTI_REFREventCallbacks__IEventCallback;
inline static constexpr auto VTABLE = VTABLE_REFREventCallbacks__IEventCallback;

virtual ~IEventCallback(); // 00

// add
virtual void operator()() = 0; // 01
virtual bool Save(BSStorage& a_storage); // 02
virtual const BSFixedString* GetType() = 0; // 03
virtual bool Load(const BSStorage& a_storage); // 04
};
static_assert(sizeof(IEventCallback) == 0x10);
}
}
2 changes: 2 additions & 0 deletions include/RE/Skyrim.h
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,7 @@
#include "RE/Q/QuestEvents.h"
#include "RE/Q/QuestObjectiveStates.h"
#include "RE/Q/QuestStatus.h"
#include "RE/R/REFREventCallbacks.h"
#include "RE/R/RaceSexCamera.h"
#include "RE/R/RaceSexMenu.h"
#include "RE/R/RaceSexMenuEvent.h"
Expand Down Expand Up @@ -1572,6 +1573,7 @@
#include "RE/T/TESTexture1024.h"
#include "RE/T/TESTopic.h"
#include "RE/T/TESTopicInfo.h"
#include "RE/T/TESTopicInfoEvent.h"
#include "RE/T/TESTrackedStatsEvent.h"
#include "RE/T/TESUniqueIDChangeEvent.h"
#include "RE/T/TESValueForm.h"
Expand Down
2 changes: 1 addition & 1 deletion include/RE/T/TESTopicInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace RE
bool BelongsInGroup(FORM* a_form, bool a_allowParentGroups, bool a_currentOnly) override; // 30
void CreateGroupData(FORM* a_form, FORM_GROUP* a_group) override; // 31

DialogueItem GetDialogueData(Actor* a_speaker);
DialogueItem GetDialogueData(TESObjectREFR* a_speaker);

// members
TESTopic* parentTopic; // 20
Expand Down
32 changes: 32 additions & 0 deletions include/RE/T/TESTopicInfoEvent.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#pragma once

#include "RE/B/BSTSmartPointer.h"
#include "RE/N/NiSmartPointer.h"

namespace RE
{
class TESObjectREFR;

namespace REFREventCallbacks
{
class IEventCallback;
}

struct TESTopicInfoEvent
{
public:
enum class TopicInfoEventType
{
kTopicBegin = 0,
kTopicEnd
};

// members
BSTSmartPointer<REFREventCallbacks::IEventCallback> callback; // 00
NiPointer<TESObjectREFR> speakerRef; // 08
FormID topicInfoFormID; // 10
stl::enumeration<TopicInfoEventType, std::uint32_t> type; // 14
std::uint16_t stage; // 18
};
static_assert(sizeof(TESTopicInfoEvent) == 0x20);
}
3 changes: 1 addition & 2 deletions src/RE/T/TESTopicInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ namespace RE
return static_cast<float>(timeUntilReset);
}

DialogueItem TESTopicInfo::GetDialogueData(Actor* a_speaker)
DialogueItem TESTopicInfo::GetDialogueData(TESObjectREFR* a_speaker)
{
return { parentTopic->ownerQuest, parentTopic, this, a_speaker };
}

}

0 comments on commit e2996a5

Please sign in to comment.