OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4MainMenu.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
5  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
6  *
7  * Distributed under the terms of the ISC license; see accompanying file
8  * "COPYING" for details.
9  *
10  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
11  * See accompanying file "TRADEMARK" for details.
12  *
13  * To redistribute this file separately, substitute the full license texts
14  * for the above references.
15  */
16 // Engine internal C4Menus: Main menu, Options, Player join, Hostility, etc.
17 
18 #ifndef INC_C4MainMenu
19 #define INC_C4MainMenu
20 
21 #include "gui/C4Menu.h"
22 
23 // Menu identification constants for main menus
24 enum
25 {
26  C4MN_Hostility = 1, // identification for hostility menu
27  C4MN_Main = 2, // identification for all other menus
31 };
32 
33 class C4MainMenu : public C4Menu
34 {
35 public:
36  C4MainMenu();
37 
38  void Default() override;
39 
40 protected:
41  int32_t Player;
42 
43 public:
44  bool Init(C4FacetSurface &fctSymbol, const char *szEmpty, int32_t iPlayer, int32_t iExtra=C4MN_Extra_None, int32_t iExtraData=0, int32_t iId=0, int32_t iStyle=C4MN_Style_Normal);
45  bool InitRefSym(const C4Facet &fctSymbol, const char *szEmpty, int32_t iPlayer, int32_t iExtra=C4MN_Extra_None, int32_t iExtraData=0, int32_t iId=0, int32_t iStyle=C4MN_Style_Normal);
46 
47  bool ActivateMain(int32_t iPlayer);
48  bool ActivateNewPlayer(int32_t iPlayer);
49  bool ActivateHostility(int32_t iPlayer);
50  bool ActivateGoals(int32_t iPlayer, bool fDoActivate);
51  bool ActivateRules(int32_t iPlayer);
52  bool ActivateSavegame(int32_t iPlayer);
53  bool ActivateHost(int32_t iPlayer);
54  bool ActivateClient(int32_t iPlayer);
55  bool ActivateOptions(int32_t iPlayer, int32_t selection = 0);
56  bool ActivateDisplay(int32_t iPlayer, int32_t selection = 0);
57  bool ActivateSurrender(int32_t iPlayer);
58  bool ActivateObserver();
59 
60 protected:
61  bool MenuCommand(const char *szCommand, bool fIsCloseCommand) override;
62 
63  bool DoRefillInternal(bool &rfRefilled) override;
64 
65  void OnSelectionChanged(int32_t iNewSelection) override;
66  void OnUserSelectItem(int32_t Player, int32_t iIndex) override;
67  void OnUserEnter(int32_t Player, int32_t iIndex, bool fRight) override;
68  void OnUserClose() override;
69  int32_t GetControllingPlayer() override { return Player; }
70 
71 public:
72  bool ActivateCommand(int32_t iPlayer, const char *szCommand);
73 };
74 
75 #endif
bool ActivateNewPlayer(int32_t iPlayer)
Definition: C4MainMenu.cpp:63
void OnUserEnter(int32_t Player, int32_t iIndex, bool fRight) override
Definition: C4MainMenu.cpp:290
Definition: C4Menu.h:122
void OnSelectionChanged(int32_t iNewSelection) override
Definition: C4MainMenu.cpp:270
bool ActivateObserver()
Definition: C4MainMenu.cpp:872
bool ActivateCommand(int32_t iPlayer, const char *szCommand)
Definition: C4MainMenu.cpp:865
bool Init(C4FacetSurface &fctSymbol, const char *szEmpty, int32_t iPlayer, int32_t iExtra=C4MN_Extra_None, int32_t iExtraData=0, int32_t iId=0, int32_t iStyle=C4MN_Style_Normal)
Definition: C4MainMenu.cpp:49
bool ActivateRules(int32_t iPlayer)
Definition: C4MainMenu.cpp:350
bool DoRefillInternal(bool &rfRefilled) override
Definition: C4MainMenu.cpp:108
bool ActivateSavegame(int32_t iPlayer)
Definition: C4MainMenu.cpp:388
bool ActivateDisplay(int32_t iPlayer, int32_t selection=0)
Definition: C4MainMenu.cpp:537
int32_t Player
Definition: C4MainMenu.h:41
bool ActivateHost(int32_t iPlayer)
Definition: C4MainMenu.cpp:469
bool ActivateHostility(int32_t iPlayer)
Definition: C4MainMenu.cpp:638
bool InitRefSym(const C4Facet &fctSymbol, const char *szEmpty, int32_t iPlayer, int32_t iExtra=C4MN_Extra_None, int32_t iExtraData=0, int32_t iId=0, int32_t iStyle=C4MN_Style_Normal)
Definition: C4MainMenu.cpp:56
bool ActivateOptions(int32_t iPlayer, int32_t selection=0)
Definition: C4MainMenu.cpp:517
bool ActivateGoals(int32_t iPlayer, bool fDoActivate)
Definition: C4MainMenu.cpp:304
bool ActivateClient(int32_t iPlayer)
Definition: C4MainMenu.cpp:490
bool MenuCommand(const char *szCommand, bool fIsCloseCommand) override
Definition: C4MainMenu.cpp:653
int32_t GetControllingPlayer() override
Definition: C4MainMenu.h:69
bool ActivateSurrender(int32_t iPlayer)
Definition: C4MainMenu.cpp:504
void OnUserSelectItem(int32_t Player, int32_t iIndex) override
Definition: C4MainMenu.cpp:284
void OnUserClose() override
Definition: C4MainMenu.cpp:298
bool ActivateMain(int32_t iPlayer)
Definition: C4MainMenu.cpp:566
void Default() override
Definition: C4MainMenu.cpp:43