25 #include "common/array.h" 26 #include "common/str.h" 28 #include "twp/scenegraph.h" 30 #include "twp/motor.h" 32 #define MAXDIALOGSLOTS 9 34 #define SLIDINGSPEED 25.f 35 #define SLOTMARGIN 4.f 46 bool _isValid =
false;
50 float _shakeTime = 0.f;
59 int limit = MAXCHOICES;
68 enum DialogConditionMode {
82 DialogConditionMode mode;
98 virtual void shutup() = 0;
109 void visit(
const YOnce &node)
override;
110 void visit(
const YShowOnce &node)
override;
111 void visit(
const YOnceEver &node)
override;
112 void visit(
const YTempOnce &node)
override;
121 virtual ~
IsGoto()
override {}
122 void visit(
const YGoto &node)
override { _isGoto =
true; }
125 bool _isGoto =
false;
131 void visit(
const YChoice &node)
override { _isChoice =
true; }
134 bool _isChoice =
false;
140 void visit(
const YShutup &node)
override { _isShutup =
true; }
143 bool _isShutup =
false;
152 void visit(
const YCodeExp &node)
override;
153 void visit(
const YGoto &node)
override;
154 void visit(
const YSay &node)
override;
155 void visit(
const YPause &node)
override;
156 void visit(
const YParrot &node)
override;
157 void visit(
const YDialog &node)
override;
158 void visit(
const YOverride &node)
override;
160 void visit(
const YLimit &node)
override;
162 void visit(
const YWaitFor &node)
override;
163 void visit(
const YShutup &node)
override;
166 Dialog *_dialog =
nullptr;
175 void visit(
const YCodeCond &node)
override;
176 void visit(
const YOnce &node)
override;
177 void visit(
const YShowOnce &node)
override;
178 void visit(
const YOnceEver &node)
override;
179 void visit(
const YTempOnce &node)
override;
182 bool _accepted =
true;
185 Dialog *_dialog =
nullptr;
191 virtual ~
Dialog()
override;
193 void choose(
int choice);
194 void update(
float dt);
195 DialogState getState()
const {
return _state; }
197 void setMousePos(
const Math::Vector2d &pos) { _mousePos = pos; }
198 Math::Vector2d getNextChoicePos(
const Math::Vector2d &pos);
199 Math::Vector2d getPreviousChoicePos(
const Math::Vector2d &pos);
203 bool isOnce(
int line)
const;
204 bool isShowOnce(
int line)
const;
205 bool isOnceEver(
int line)
const;
206 bool isTempOnce(
int line)
const;
212 void gotoNextLabel();
213 bool choicesReady()
const {
return numSlots() > 0; }
214 void updateChoiceStates();
217 void running(
float dt);
220 int numSlots()
const;
223 Math::Vector2d getChoicePos(
int index)
const;
224 int getActiveSlot(
const Math::Vector2d &pos)
const;
226 virtual void drawCore(
const Math::Matrix4 &trsf)
override final;
235 DialogState _state = DialogState::None;
236 size_t _currentStatement = 0;
240 Math::Vector2d _mousePos;
241 float _fadeTime = 0.f;
Definition: scenegraph.h:41
Definition: achievements_tables.h:27