| 1 | /* |
| 2 | * LegacyClonk |
| 3 | * |
| 4 | * Copyright (c) RedWolf Design |
| 5 | * Copyright (c) 2005, Sven2 |
| 6 | * Copyright (c) 2017-2021, The LegacyClonk Team and contributors |
| 7 | * |
| 8 | * Distributed under the terms of the ISC license; see accompanying file |
| 9 | * "COPYING" for details. |
| 10 | * |
| 11 | * "Clonk" is a registered trademark of Matthes Bender, used with permission. |
| 12 | * See accompanying file "TRADEMARK" for details. |
| 13 | * |
| 14 | * To redistribute this file separately, substitute the full license texts |
| 15 | * for the above references. |
| 16 | */ |
| 17 | |
| 18 | // main game dialogs (abort game dlg, observer dlg) |
| 19 | |
| 20 | #pragma once |
| 21 | |
| 22 | #include "C4Gui.h" |
| 23 | #include "C4GuiDialogs.h" |
| 24 | |
| 25 | class C4AbortGameDialog : public C4GUI::Dialog |
| 26 | { |
| 27 | bool fRestart = false; |
| 28 | void OnRestartBtn(C4GUI::Control *btn); |
| 29 | |
| 30 | public: |
| 31 | C4AbortGameDialog(); |
| 32 | ~C4AbortGameDialog(); |
| 33 | |
| 34 | protected: |
| 35 | static bool is_shown; |
| 36 | |
| 37 | // callbacks to halt game |
| 38 | virtual void OnShown() override; // inc game halt counter |
| 39 | virtual void OnClosed(bool fOK) override; // dec game halt counter |
| 40 | |
| 41 | virtual const char *GetID() override { return "AbortGameDialog" ; } |
| 42 | |
| 43 | // align by screen, not viewport |
| 44 | virtual bool IsFreePlaceDialog() override { return true; } |
| 45 | |
| 46 | // true for dialogs that receive full keyboard and mouse input even in shared mode |
| 47 | virtual bool IsExclusiveDialog() override { return true; } |
| 48 | |
| 49 | bool fGameHalted; |
| 50 | |
| 51 | public: |
| 52 | static bool IsShown() { return is_shown; } |
| 53 | }; |
| 54 | |