OpenClonk
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 OnModsBtn(C4GUI::Control *btn); // callback: Mods
52  void OnAboutBtn(C4GUI::Control *btn); // callback: Show about screen
53  void OnExitBtn(C4GUI::Control *btn); // callback: exit button pressed
54  void OnTODO(C4GUI::Control *btn); // button not yet implemented
55 
56  bool KeyEnterDown(); // return pressed -> reroute as space
57  bool KeyEnterUp(); // return released -> reroute as space
58 
59  void OnShown() override; // callback when shown: Show log if restart after failure; show player creation dlg on first start
60 
61 public:
62  C4StartupMainDlg(); // ctor
63  ~C4StartupMainDlg() override; // dtor
64 };
65 
66 #endif // INC_C4StartupMainDlg
bool fOK
Definition: C4Gui.h:2083
void OnClosed(bool fOK) override
void OnPlayerSelContextAddPlr(C4GUI::Element *pTarget, const StdCopyStrBuf &rsFilename)
void OnStartBtn(C4GUI::Control *btn)
void DrawElement(C4TargetFacet &cgo) override
void OnNetJoin(const StdStrBuf &rsHostAddress)
~C4StartupMainDlg() override
void OnPlayerSelContextRemovePlr(C4GUI::Element *pTarget, const int &iIndex)
void ShowParticipantCreationDlg()
C4GUI::ContextMenu * OnPlayerSelContextAdd(C4GUI::Element *pBtn, int32_t iX, int32_t iY)
void OnEditorBtn(C4GUI::Control *btn)
void OnPlayerSelectionBtn(C4GUI::Control *btn)
void OnExitBtn(C4GUI::Control *btn)
void OnShown() override
void ConfirmMoveKey(const char *strKeyFilename)
void OnAboutBtn(C4GUI::Control *btn)
C4GUI::ContextMenu * OnPlayerSelContext(C4GUI::Element *pBtn, int32_t iX, int32_t iY)
void OnModsBtn(C4GUI::Control *btn)
C4GUI::ContextMenu * OnPlayerSelContextRemove(C4GUI::Element *pBtn, int32_t iX, int32_t iY)
void OnOptionsBtn(C4GUI::Control *btn)
void OnNetJoinBtn(C4GUI::Control *btn)
void OnTODO(C4GUI::Control *btn)