Skip to content
LeviMC
English
AutoLightDark
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
17class Player;
18class UIPropertyBag;
19struct ActorUniqueID;
20struct INpcDialogueData;
21struct NpcGUIOffset;
22namespace Json { class Value; }
23// clang-format on
24
26public:
27 // NpcInteractScreenController inner types declare
28 // clang-format off
29 struct NpcActionEditData;
30 // clang-format on
31
32 // NpcInteractScreenController inner types define
33 enum class Section : uchar {
34 Basic = 0,
35 Advanced = 1,
36 MaximizedActionEdit = 2,
37 Student = 3,
38 };
39
40 enum class NpcTextEdit : int {
41 Name = 0,
42 InteractText = 1,
43 ActionButtonName = 2,
44 ActionText = 3,
45 };
46
47 enum class NpcTextErrorStatus : uchar {
48 Empty = 0,
49 ButtonSetUriEmpty = 1,
50 InvalidUri = 2,
51 Valid = 3,
52 };
53
54 struct NpcActionEditData {
55 public:
56 // member variables
57 // NOLINTBEGIN
58 ::ll::TypedStorage<1, 1, ::npc::_ActionType::Enum> type;
59 ::ll::TypedStorage<8, 104, ::DeferredTextObject> name;
60 ::ll::TypedStorage<8, 104, ::DeferredTextObject> text;
61 ::ll::TypedStorage<1, 1, ::NpcInteractScreenController::NpcTextErrorStatus> state;
62 // NOLINTEND
63 };
64
65public:
66 // member variables
67 // NOLINTBEGIN
68 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
69 ::ll::TypedStorage<1, 1, ::NpcInteractScreenController::Section> mVisibleSection;
70 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::INpcDialogueData>> mDialogueData;
71 ::ll::TypedStorage<1, 1, bool> mShouldRefresh;
72 ::ll::TypedStorage<1, 1, bool> mHasActionWarning;
73 ::ll::TypedStorage<1, 1, bool> mSaveToServer;
74 ::ll::TypedStorage<4, 4, int> mMaxSkinsPerRow;
75 ::ll::TypedStorage<4, 4, int> mStartSkinIndex;
76 ::ll::TypedStorage<4, 4, int> mMaxSkinButtonIndex;
77 ::ll::TypedStorage<4, 4, int> mMaxSkinIndex;
78 ::ll::TypedStorage<4, 4, int> mSelectedSkinIndex;
79 ::ll::TypedStorage<4, 4, int> mHoverSkin;
80 ::ll::TypedStorage<4, 4, int> mMaximizedEditIndex;
81 ::ll::TypedStorage<4, 4, int> mActionDeleteIndex;
82 ::ll::TypedStorage<4, 4, int> mActionCollectionIndex;
83 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DeferredTextObject>> mDeferredNameText;
84 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DeferredTextObject>> mDeferredInteractText;
85 ::ll::TypedStorage<8, 24, ::std::vector<::NpcInteractScreenController::NpcActionEditData>> mDeferredActionTexts;
86 // NOLINTEND
87
88public:
89 // prevent constructor by default
90 NpcInteractScreenController& operator=(NpcInteractScreenController const&);
91 NpcInteractScreenController(NpcInteractScreenController const&);
92 NpcInteractScreenController();
93
94public:
95 // virtual functions
96 // NOLINTBEGIN
97 virtual ~NpcInteractScreenController() /*override*/ = default;
98
99 virtual ::ui::DirtyFlag tick() /*override*/;
100
101 virtual void onTerminate() /*override*/;
102
103 virtual void onCreation() /*override*/;
104
105 virtual void addStaticScreenVars(::Json::Value& globalVars) /*override*/;
106
107 virtual ::EventResult onNpcDialogueDataChange(::std::shared_ptr<::INpcDialogueData> dialogueData) /*override*/;
108
109 virtual ::EventResult onNpcInteractScreenClose(::ActorUniqueID npcId, bool) /*override*/;
110
111 virtual bool _isStillValid() const /*override*/;
112 // NOLINTEND
113
114public:
115 // member functions
116 // NOLINTBEGIN
117 MCNAPI NpcInteractScreenController(
118 ::std::shared_ptr<::ClientInstanceScreenModel> model,
119 ::Player& player,
120 ::std::shared_ptr<::INpcDialogueData> dialogueData
121 );
122
123 MCNAPI void _addNewDeferredButtonTexts(uint64 actionIndex);
124
125 MCNAPI void _handleTextChanged(::NpcInteractScreenController::NpcTextEdit edit, int index);
126
127 MCNAPI bool _isAddActionAllowed();
128
129 MCNAPI ::ui::ViewRequest _leaveFrom(::NpcInteractScreenController::Section fromSection);
130
131 MCNAPI void _saveEditsToServer();
132 // NOLINTEND
133
134public:
135 // static functions
136 // NOLINTBEGIN
137 MCNAPI static void _bagVecs(::UIPropertyBag& bag, ::NpcGUIOffset const& offsets);
138 // NOLINTEND
139
140public:
141 // constructor thunks
142 // NOLINTBEGIN
143 MCNAPI void* $ctor(
144 ::std::shared_ptr<::ClientInstanceScreenModel> model,
145 ::Player& player,
146 ::std::shared_ptr<::INpcDialogueData> dialogueData
147 );
148 // NOLINTEND
149
150public:
151 // virtual function thunks
152 // NOLINTBEGIN
153 MCNAPI ::ui::DirtyFlag $tick();
154
155 MCNAPI void $onTerminate();
156
157 MCNAPI void $onCreation();
158
159 MCNAPI void $addStaticScreenVars(::Json::Value& globalVars);
160
161 MCNAPI ::EventResult $onNpcDialogueDataChange(::std::shared_ptr<::INpcDialogueData> dialogueData);
162
163 MCNAPI ::EventResult $onNpcInteractScreenClose(::ActorUniqueID npcId, bool);
164
165 MCNAPI bool $_isStillValid() const;
166 // NOLINTEND
167};
Definition ClientInstanceScreenController.h:5
Definition ClientInstanceScreenModel.h:5
Definition Value.h:16
Definition NpcEventListener.h:5
Definition NpcInteractScreenController.h:5
MCAPI void _addNewDeferredButtonTexts(uint64 actionIndex)
MCAPI::ui::ViewRequest _leaveFrom(::NpcInteractScreenController::Section fromSection)
MCAPI::EventResult $onNpcInteractScreenClose(::ActorUniqueID npcId, bool)
MCAPI bool $_isStillValid() const
MCAPI::EventResult $onNpcDialogueDataChange(::std::shared_ptr<::INpcDialogueData > dialogueData)
MCAPI void * $ctor(::std::shared_ptr<::ClientInstanceScreenModel > model, ::Player &player, ::std::shared_ptr<::INpcDialogueData > dialogueData)
static MCAPI void _bagVecs(::UIPropertyBag &bag, ::NpcGUIOffset const &offsets)
MCAPI void $addStaticScreenVars(::Json::Value &globalVars)
MCAPI::ui::DirtyFlag $tick()
MCAPI void _handleTextChanged(::NpcInteractScreenController::NpcTextEdit edit, int index)
MCAPI bool _isAddActionAllowed()
Definition Player.h:131
Definition UIPropertyBag.h:5
STL namespace.
Definition ActorUniqueID.h:5
Definition INpcDialogueData.h:12
Definition NpcGUIOffset.h:8
Definition NpcInteractScreenController.h:19