Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Tween verb help UI in and out.
- Loading branch information
Showing
with
23 additions
and
1 deletion.
-
+7
−0
modules/game/main.cs
-
+1
−0
modules/game/verbHelp.gui
-
+15
−1
modules/game/verbs.cs
|
|
@@ -3,6 +3,7 @@ |
|
|
// up properly. |
|
|
|
|
|
// Module dependencies. |
|
|
include(twillex); |
|
|
include(stateMachine); |
|
|
include(trackingCamera); |
|
|
include(offsetCamera); |
|
|
@@ -57,6 +58,10 @@ |
|
|
GlobalActionMap.bind(keyboard, "escape", "quit"); |
|
|
GlobalActionMap.bind(keyboard, "alt f4", "quit"); |
|
|
|
|
|
// Global tweening engine. |
|
|
Twillex::create(Tweens); |
|
|
Tweens.startUpdates(); |
|
|
|
|
|
// Gameplay modules. |
|
|
Knights.onStart(); |
|
|
Enemies.onStart(); |
|
|
@@ -74,6 +79,8 @@ |
|
|
Knights.onEnd(); |
|
|
Enemies.onEnd(); |
|
|
|
|
|
Tweens.delete(); |
|
|
|
|
|
// Delete the objects we created. |
|
|
GameGroup.delete(); |
|
|
} |
|
|
@@ -9,6 +9,7 @@ new GuiBitmapCtrl(VerbHelpDlg) { |
|
|
extent = "130 200"; |
|
|
minExtent = "8 8"; |
|
|
tooltipprofile = GuiToolTipProfile; |
|
|
deployed = true; |
|
|
|
|
|
new GuiMLTextCtrl(VerbHelpText) { |
|
|
lineSpacing = 2; |
|
|
|
|
|
@@ -58,7 +58,7 @@ class = StateMachine; |
|
|
|
|
|
// Keyboard actions that should be available in any state. |
|
|
%this.globalMap.bindCmd(keyboard, "ctrl c", "Verbs.onEvent(cancel);"); |
|
|
%this.globalMap.bindCmd(keyboard, "?", "VerbHelpDlg.setVisible(!VerbHelpDlg.isVisible());"); |
|
|
%this.globalMap.bindCmd(keyboard, "?", "Verbs.toggleHelp();"); |
|
|
%this.globalMap.push(); |
|
|
|
|
|
// Direction selection actions. |
|
|
@@ -101,6 +101,8 @@ class = StateMachine; |
|
|
%this.directionMap.delete(); |
|
|
} |
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
|
|
|
|
function Verbs::updateHelpDlg(%this) { |
|
|
%len = %this.getDynamicFieldCount(); |
|
|
VerbHelpText.setText(""); |
|
|
@@ -138,6 +140,18 @@ class = StateMachine; |
|
|
%this.updateHelpDlg(); |
|
|
} |
|
|
|
|
|
function Verbs::toggleHelp(%this) { |
|
|
if(VerbHelpDlg.tween) { |
|
|
VerbHelpDlg.tween.delete(); |
|
|
} |
|
|
VerbHelpDlg.deployed = !VerbHelpDlg.deployed; |
|
|
|
|
|
VerbHelpDlg.tween = Tweens.toOnce(200, VerbHelpDlg, |
|
|
VerbHelpDlg.deployed |
|
|
? "position: 20 252" |
|
|
: "position: -200 252"); |
|
|
} |
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
|
|
|
|
function Verbs::onFinish(%this) { |
|
|
|