From 43c0925dee4490412fb99efc64dd7075bffd1a2d Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Fri, 17 Mar 2017 17:20:03 -0400 Subject: [PATCH] Added tutorial helper script. --- data/scripts/tutorial.lua | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 data/scripts/tutorial.lua diff --git a/data/scripts/tutorial.lua b/data/scripts/tutorial.lua new file mode 100644 index 00000000..0d146ef9 --- /dev/null +++ b/data/scripts/tutorial.lua @@ -0,0 +1,54 @@ +--[[ + +Tutorial constants and functions + +--]] + +--Controller Types +CONTROLLER_KEYBOARD = 1; +CONTROLLER_GAMEPAD = 2; + +--Tutorial Widget Ids + +TUTORIAL_CAMERA = 1; +TUTORIAL_MOVING = 2; +TUTORIAL_TARGETING_FRIENDLY = 3; +TUTORIAL_TALKING = 4; +TUTORIAL_MAINMENU = 5; +TUTORIAL_ACTIVEMODE = 6; +TUTORIAL_TARGETING_ENEMY = 7; +TUTORIAL_ENGAGECOMBAT = 8; +TUTORIAL_BATTLEACTIONS = 9; +TUTORIAL_CASTING = 10; +TUTORIAL_ACTIONS = 11; +TUTORIAL_TP = 12; +TUTORIAL_WEAPONSKILLS = 13; +TUTORIAL_NPCS = 14; +TUTORIAL_NPCLS = 15; +TUTORIAL_JOURNAL = 16; +TUTORIAL_DEFEATENEMY = 18; + +--Helper functions + +function showTutorialSuccessWidget(player, textId) + player:SendRequestedInfo(2, nil, nil, textId); +end + +function openTutorialWidget(player, controllerType, widgetId) + --Default to keyboard if somethings fucky + if (controllerType ~= CONTROLLER_GAMEPAD) + controllerType = CONTROLLER_KEYBOARD; + player:SendRequestedInfo(4, nil, nil, controllerType, widgetId); +end + +function closeTutorialWidget(player) + player:SendRequestedInfo(5); +end + +function startTutorialMode(player) + player:SendRequestedInfo(9); +end + +function endTutorialMode(player) + player:SendRequestedInfo(7); +end \ No newline at end of file