OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4StartupMainDlg.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 2005-2009, RedWolf Design GmbH, http://www.clonk.de/
5  * Copyright (c) 2013-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 // Startup screen for non-parameterized engine start
17 
18 #ifndef INC_C4StartupMainDlg
19 #define INC_C4StartupMainDlg
20 
21 #include "gui/C4Startup.h"
22 
24 {
25 private:
26  C4KeyBinding *pKeyDown, *pKeyUp, *pKeyEnter;
27  C4GUI::Label *pParticipantsLbl;
28  C4GUI::Button *pStartButton;
29  bool fFirstShown;
30 
31 protected:
32 
33  void ConfirmMoveKey(const char *strKeyFilename);
34 
35  void DrawElement(C4TargetFacet &cgo) override;
36  void OnClosed(bool fOK) override; // callback when dlg got closed: Abort startup
37  C4GUI::ContextMenu *OnPlayerSelContext(C4GUI::Element *pBtn, int32_t iX, int32_t iY); // preliminary player selection via simple context menu
38  C4GUI::ContextMenu *OnPlayerSelContextAdd(C4GUI::Element *pBtn, int32_t iX, int32_t iY);
39  C4GUI::ContextMenu *OnPlayerSelContextRemove(C4GUI::Element *pBtn, int32_t iX, int32_t iY);
40  void OnPlayerSelContextAddPlr(C4GUI::Element *pTarget, const StdCopyStrBuf &rsFilename);
41  void OnPlayerSelContextRemovePlr(C4GUI::Element *pTarget, const int &iIndex);
42  void UpdateParticipants();
44 
45  void OnStartBtn(C4GUI::Control *btn); // callback: run default start button pressed
46  void OnPlayerSelectionBtn(C4GUI::Control *btn); // callback: player selection (preliminary version via context menus...)
47  void OnNetJoinBtn(C4GUI::Control *btn); // callback: join net work game (direct join only for now)
48  void OnNetJoin(const StdStrBuf &rsHostAddress);
49  void OnOptionsBtn(C4GUI::Control *btn); // callback: Show options screen
50  void OnEditorBtn(C4GUI::Control *btn); // callback: Editor
51  void OnAboutBtn(C4GUI::Control *btn); // callback: Show about screen
52  void OnExitBtn(C4GUI::Control *btn); // callback: exit button pressed
53  void OnTODO(C4GUI::Control *btn); // button not yet implemented
54 
55  bool KeyEnterDown(); // return pressed -> reroute as space
56  bool KeyEnterUp(); // return released -> reroute as space
57 
58  void OnShown() override; // callback when shown: Show log if restart after failure; show player creation dlg on first start
59 
60 public:
61  C4StartupMainDlg(); // ctor
62  ~C4StartupMainDlg() override; // dtor
63 };
64 
65 #endif // INC_C4StartupMainDlg
void ConfirmMoveKey(const char *strKeyFilename)
void OnStartBtn(C4GUI::Control *btn)
void OnPlayerSelContextAddPlr(C4GUI::Element *pTarget, const StdCopyStrBuf &rsFilename)
void OnEditorBtn(C4GUI::Control *btn)
void OnPlayerSelContextRemovePlr(C4GUI::Element *pTarget, const int &iIndex)
C4GUI::ContextMenu * OnPlayerSelContextAdd(C4GUI::Element *pBtn, int32_t iX, int32_t iY)
C4GUI::ContextMenu * OnPlayerSelContext(C4GUI::Element *pBtn, int32_t iX, int32_t iY)
bool fOK
Definition: C4Gui.h:2082
void OnTODO(C4GUI::Control *btn)
void OnShown() override
void OnNetJoinBtn(C4GUI::Control *btn)
void OnExitBtn(C4GUI::Control *btn)
void ShowParticipantCreationDlg()
void OnAboutBtn(C4GUI::Control *btn)
void DrawElement(C4TargetFacet &cgo) override
void OnPlayerSelectionBtn(C4GUI::Control *btn)
void OnOptionsBtn(C4GUI::Control *btn)
C4GUI::ContextMenu * OnPlayerSelContextRemove(C4GUI::Element *pBtn, int32_t iX, int32_t iY)
~C4StartupMainDlg() override
void OnNetJoin(const StdStrBuf &rsHostAddress)
void OnClosed(bool fOK) override