LeviLamina
Loading...
Searching...
No Matches
NpcInteractScreenController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/DeferredTextObject.h"
7#include "mc/client/gui/DirtyFlag.h"
8#include "mc/client/gui/ViewRequest.h"
9#include "mc/client/gui/screens/controllers/ClientInstanceScreenController.h"
10#include "mc/world/actor/npc/action_type/Enum.h"
11#include "mc/world/events/EventResult.h"
12#include "mc/world/events/NpcEventListener.h"
13
14// auto generated forward declare list
15// clang-format off
16class Actor;
18class Player;
19class UIPropertyBag;
20struct ActorUniqueID;
21struct INpcDialogueData;
22struct NpcGUIOffset;
23namespace Json { class Value; }
24// clang-format on
25
27public:
28 // NpcInteractScreenController inner types declare
29 // clang-format off
30 struct NpcActionEditData;
31 // clang-format on
32
33 // NpcInteractScreenController inner types define
34 enum class Section : uchar {
35 Basic = 0,
36 Advanced = 1,
37 MaximizedActionEdit = 2,
38 Student = 3,
39 };
40
41 enum class NpcTextEdit : int {
42 Name = 0,
43 InteractText = 1,
44 ActionButtonName = 2,
45 ActionText = 3,
46 };
47
48 enum class NpcTextErrorStatus : uchar {
49 Empty = 0,
50 ButtonSetUriEmpty = 1,
51 InvalidUri = 2,
52 Valid = 3,
53 };
54
55 struct NpcActionEditData {
56 public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<1, 1, ::npc::_ActionType::Enum> type;
60 ::ll::TypedStorage<8, 104, ::DeferredTextObject> name;
61 ::ll::TypedStorage<8, 104, ::DeferredTextObject> text;
62 ::ll::TypedStorage<1, 1, ::NpcInteractScreenController::NpcTextErrorStatus> state;
63 // NOLINTEND
64
65 public:
66 // prevent constructor by default
67 NpcActionEditData& operator=(NpcActionEditData const&);
68 NpcActionEditData(NpcActionEditData const&);
69 NpcActionEditData();
70
71 public:
72 // member functions
73 // NOLINTBEGIN
74 MCAPI NpcActionEditData(::NpcInteractScreenController::NpcActionEditData&&);
75
76 MCAPI ~NpcActionEditData();
77 // NOLINTEND
78
79 public:
80 // constructor thunks
81 // NOLINTBEGIN
82 MCAPI void* $ctor(::NpcInteractScreenController::NpcActionEditData&&);
83 // NOLINTEND
84
85 public:
86 // destructor thunk
87 // NOLINTBEGIN
88 MCAPI void $dtor();
89 // NOLINTEND
90 };
91
92public:
93 // member variables
94 // NOLINTBEGIN
95 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
96 ::ll::TypedStorage<1, 1, ::NpcInteractScreenController::Section> mVisibleSection;
97 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::INpcDialogueData>> mDialogueData;
98 ::ll::TypedStorage<1, 1, bool> mShouldRefresh;
99 ::ll::TypedStorage<1, 1, bool> mHasActionWarning;
100 ::ll::TypedStorage<1, 1, bool> mSaveToServer;
101 ::ll::TypedStorage<4, 4, int> mMaxSkinsPerRow;
102 ::ll::TypedStorage<4, 4, int> mStartSkinIndex;
103 ::ll::TypedStorage<4, 4, int> mMaxSkinButtonIndex;
104 ::ll::TypedStorage<4, 4, int> mMaxSkinIndex;
105 ::ll::TypedStorage<4, 4, int> mSelectedSkinIndex;
106 ::ll::TypedStorage<4, 4, int> mHoverSkin;
107 ::ll::TypedStorage<4, 4, int> mMaximizedEditIndex;
108 ::ll::TypedStorage<4, 4, int> mActionDeleteIndex;
109 ::ll::TypedStorage<4, 4, int> mActionCollectionIndex;
110 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DeferredTextObject>> mDeferredNameText;
111 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DeferredTextObject>> mDeferredInteractText;
112 ::ll::TypedStorage<8, 24, ::std::vector<::NpcInteractScreenController::NpcActionEditData>> mDeferredActionTexts;
113 // NOLINTEND
114
115public:
116 // prevent constructor by default
117 NpcInteractScreenController& operator=(NpcInteractScreenController const&);
118 NpcInteractScreenController(NpcInteractScreenController const&);
119 NpcInteractScreenController();
120
121public:
122 // virtual functions
123 // NOLINTBEGIN
124 virtual ~NpcInteractScreenController() /*override*/;
125
126 virtual ::ui::DirtyFlag tick() /*override*/;
127
128 virtual void onTerminate() /*override*/;
129
130 virtual void onCreation() /*override*/;
131
132 virtual void addStaticScreenVars(::Json::Value& globalVars) /*override*/;
133
134 virtual ::EventResult onNpcDialogueDataChange(::std::shared_ptr<::INpcDialogueData> dialogueData) /*override*/;
135
136 virtual ::EventResult onNpcInteractScreenClose(::ActorUniqueID npcId, bool performClosingActions) /*override*/;
137
138 virtual bool _isStillValid() const /*override*/;
139 // NOLINTEND
140
141public:
142 // member functions
143 // NOLINTBEGIN
144 MCAPI NpcInteractScreenController(
145 ::std::shared_ptr<::ClientInstanceScreenModel> model,
146 ::Player& player,
147 ::std::shared_ptr<::INpcDialogueData> dialogueData
148 );
149
150 MCAPI void _addNewDeferredButtonTexts(uint64 actionIndex);
151
152 MCAPI ::Actor* _getActor() const;
153
154 MCAPI ::std::string _getDialogText() const;
155
156 MCAPI void _handleTextChanged(::NpcInteractScreenController::NpcTextEdit edit, int index);
157
158 MCAPI bool _isAddActionAllowed();
159
160 MCAPI ::ui::ViewRequest _leaveFrom(::NpcInteractScreenController::Section fromSection);
161
162 MCAPI void _registerBindings();
163
164 MCAPI void _registerEventHandlers();
165 // NOLINTEND
166
167public:
168 // static functions
169 // NOLINTBEGIN
170 MCFOLD static void _bagVecs(::UIPropertyBag& bag, ::NpcGUIOffset const& offsets);
171 // NOLINTEND
172
173public:
174 // constructor thunks
175 // NOLINTBEGIN
176 MCAPI void* $ctor(
177 ::std::shared_ptr<::ClientInstanceScreenModel> model,
178 ::Player& player,
179 ::std::shared_ptr<::INpcDialogueData> dialogueData
180 );
181 // NOLINTEND
182
183public:
184 // destructor thunk
185 // NOLINTBEGIN
186 MCAPI void $dtor();
187 // NOLINTEND
188
189public:
190 // virtual function thunks
191 // NOLINTBEGIN
192 MCAPI ::ui::DirtyFlag $tick();
193
194 MCAPI void $onTerminate();
195
196 MCAPI void $onCreation();
197
198 MCFOLD void $addStaticScreenVars(::Json::Value& globalVars);
199
200 MCAPI ::EventResult $onNpcDialogueDataChange(::std::shared_ptr<::INpcDialogueData> dialogueData);
201
202 MCAPI ::EventResult $onNpcInteractScreenClose(::ActorUniqueID npcId, bool performClosingActions);
203
204 MCAPI bool $_isStillValid() const;
205 // NOLINTEND
206
207public:
208 // vftables
209 // NOLINTBEGIN
210 MCNAPI static void** $vftable();
211
212 MCNAPI static void** $vftableForScreenController();
213
215 // NOLINTEND
216};
Definition Actor.h:106
Definition ClientInstanceScreenController.h:5
Definition ClientInstanceScreenModel.h:5
Definition Value.h:16
Definition NpcEventListener.h:14
Definition NpcInteractScreenController.h:5
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftable()
static MCAPI void ** $vftableForScreenController()
Definition Player.h:129
Definition UIPropertyBag.h:5
Definition ActorUniqueID.h:5
Definition INpcDialogueData.h:12
Definition NpcGUIOffset.h:8
Definition NpcInteractScreenController.h:19