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  virtual void Default();
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  virtual bool MenuCommand(const char *szCommand, bool fIsCloseCommand);
62 
63  virtual bool DoRefillInternal(bool &rfRefilled);
64 
65  virtual void OnSelectionChanged(int32_t iNewSelection);
66  virtual void OnUserSelectItem(int32_t Player, int32_t iIndex);
67  virtual void OnUserEnter(int32_t Player, int32_t iIndex, bool fRight);
68  virtual void OnUserClose();
69  virtual int32_t GetControllingPlayer() { return Player; }
70 
71 public:
72  bool ActivateCommand(int32_t iPlayer, const char *szCommand);
73 };
74 
75 #endif
virtual void OnSelectionChanged(int32_t iNewSelection)
Definition: C4MainMenu.cpp:271
bool ActivateNewPlayer(int32_t iPlayer)
Definition: C4MainMenu.cpp:64
virtual bool DoRefillInternal(bool &rfRefilled)
Definition: C4MainMenu.cpp:109
virtual void OnUserEnter(int32_t Player, int32_t iIndex, bool fRight)
Definition: C4MainMenu.cpp:291
virtual bool MenuCommand(const char *szCommand, bool fIsCloseCommand)
Definition: C4MainMenu.cpp:654
virtual void Default()
Definition: C4MainMenu.cpp:44
Definition: C4Menu.h:122
bool ActivateObserver()
Definition: C4MainMenu.cpp:873
bool ActivateCommand(int32_t iPlayer, const char *szCommand)
Definition: C4MainMenu.cpp:866
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:50
bool ActivateRules(int32_t iPlayer)
Definition: C4MainMenu.cpp:351
bool ActivateSavegame(int32_t iPlayer)
Definition: C4MainMenu.cpp:389
bool ActivateDisplay(int32_t iPlayer, int32_t selection=0)
Definition: C4MainMenu.cpp:538
int32_t Player
Definition: C4MainMenu.h:41
bool ActivateHost(int32_t iPlayer)
Definition: C4MainMenu.cpp:470
bool ActivateHostility(int32_t iPlayer)
Definition: C4MainMenu.cpp:639
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:57
bool ActivateOptions(int32_t iPlayer, int32_t selection=0)
Definition: C4MainMenu.cpp:518
bool ActivateGoals(int32_t iPlayer, bool fDoActivate)
Definition: C4MainMenu.cpp:305
virtual void OnUserClose()
Definition: C4MainMenu.cpp:299
bool ActivateClient(int32_t iPlayer)
Definition: C4MainMenu.cpp:491
virtual void OnUserSelectItem(int32_t Player, int32_t iIndex)
Definition: C4MainMenu.cpp:285
bool ActivateSurrender(int32_t iPlayer)
Definition: C4MainMenu.cpp:505
virtual int32_t GetControllingPlayer()
Definition: C4MainMenu.h:69
bool ActivateMain(int32_t iPlayer)
Definition: C4MainMenu.cpp:567