-
Notifications
You must be signed in to change notification settings - Fork 172
/
tutorialGame.h
59 lines (47 loc) · 1.46 KB
/
tutorialGame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef TUTORIAL_GAME_H
#define TUTORIAL_GAME_H
#include "epsilonServer.h"
#include "gui/gui2_canvas.h"
#include "scriptInterface.h"
class PlayerSpaceship;
class GuiRadarView;
class GuiPanel;
class GuiButton;
class GuiScrollText;
class TutorialGame : public Updatable, public GuiCanvas
{
GuiElement* viewport;
GuiRadarView* tactical_radar;
GuiRadarView* long_range_radar;
GuiElement* station_screen[8];
P<ScriptObject> script;
GuiPanel* frame;
GuiScrollText* text;
GuiButton* next_button;
bool repeated_tutorial;
public:
ScriptSimpleCallback _onNext;
TutorialGame(bool repeated_tutorial = false, string filename = "tutorial.lua");
virtual void update(float delta) override;
void setPlayerShip(P<PlayerSpaceship> ship);
void showMessage(string message, bool show_next);
void switchViewToMainScreen();
void switchViewToTactical();
void switchViewToLongRange();
void switchViewToScreen(int n);
void setMessageToTopPosition();
void setMessageToBottomPosition();
void onNext(ScriptSimpleCallback callback) { _onNext = callback; }
void finish();
private:
void hideAllScreens();
void createScreens();
};
class LocalOnlyGame : public EpsilonServer
{
public:
LocalOnlyGame() : EpsilonServer(defaultServerPort) {}
//Overide the update function from the game server, so no actuall socket communication is done.
virtual void update(float delta) override;
};
#endif//TUTORIAL_GAME_H