10 XComboBoxWidget m_ForceStance;
13 CheckBoxWidget m_MovOverrideCheckbox;
16 int m_ApplyStanceChange;
17 bool m_OverrideMovementChange =
false;
26 m_ApplyStanceChange = -2;
28 CreateModuleWidgets();
34 DestroyModuleWidgets();
38 void CreateModuleWidgets()
40 m_ForceStance = XComboBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"StanceV") );
43 m_MovOverrideCheckbox = CheckBoxWidget.Cast(
m_MainWnd.FindAnyWidget(
"OverrideMovCheckBox") );
46 void DestroyModuleWidgets()
74 bool OnClick(
Widget w,
int x,
int y,
int button)
76 if (w == m_ForceStance)
78 Print(
"Stance changed");
79 m_ApplyStanceChange = m_ForceStance.GetCurrentItem() - 1;
82 else if (w == m_MovOverrideCheckbox)
84 Print(
"Movement override");
85 m_OverrideMovementChange =
true;
92 bool OnChange(
Widget w,
int x,
int y,
bool finished)
94 if( w == m_MovSpeedEB || w == m_MovDirEB )
96 Print(
"Movement override");
97 m_OverrideMovementChange =
true;
107 void CommandHandler()
109 if (m_ApplyStanceChange != -2)
120 cm.ForceStance(m_ApplyStanceChange);
121 m_ApplyStanceChange = -2;
124 if (m_OverrideMovementChange)
126 m_OverrideMovementChange =
false;
132 float speed = m_MovSpeedEB.GetText().ToFloat();
133 float dir = m_MovDirEB.GetText().ToFloat();
134 player.GetInputController().OverrideMovementSpeed(m_MovOverrideCheckbox.IsChecked(), speed);
135 player.GetInputController().OverrideMovementAngle(m_MovOverrideCheckbox.IsChecked(), dir);