2009-05-08 13:28:41 +00:00
|
|
|
/*
|
|
|
|
* OpenClonk, http://www.openclonk.org
|
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* Copyright (c) 1998-2000, Matthes Bender
|
|
|
|
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
|
|
|
|
* Copyright (c) 2009-2013, The OpenClonk Team and contributors
|
2009-05-08 13:28:41 +00:00
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* Distributed under the terms of the ISC license; see accompanying file
|
|
|
|
* "COPYING" for details.
|
2009-05-08 13:28:41 +00:00
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* "Clonk" is a registered trademark of Matthes Bender, used with permission.
|
|
|
|
* See accompanying file "TRADEMARK" for details.
|
2009-05-08 13:28:41 +00:00
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* To redistribute this file separately, substitute the full license texts
|
|
|
|
* for the above references.
|
2009-05-08 13:28:41 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Handles engine execution in developer mode */
|
|
|
|
|
|
|
|
#ifndef INC_C4Console
|
|
|
|
#define INC_C4Console
|
|
|
|
|
2010-12-11 18:50:38 +00:00
|
|
|
#include "C4ConsoleGUI.h"
|
2009-05-08 13:28:41 +00:00
|
|
|
#include "C4ToolsDlg.h"
|
|
|
|
#include "C4ObjectListDlg.h"
|
|
|
|
#include "C4EditCursor.h"
|
|
|
|
|
2011-10-03 15:19:24 +00:00
|
|
|
#include <C4Window.h>
|
2009-05-08 13:28:41 +00:00
|
|
|
|
|
|
|
const int C4CNS_ModePlay = 0,
|
2011-08-03 23:30:37 +00:00
|
|
|
C4CNS_ModeEdit = 1,
|
|
|
|
C4CNS_ModeDraw = 2;
|
2009-05-08 13:28:41 +00:00
|
|
|
|
|
|
|
#define IDM_NET_CLIENT1 10000
|
|
|
|
#define IDM_NET_CLIENT2 10100
|
|
|
|
#define IDM_PLAYER_QUIT1 10200
|
|
|
|
#define IDM_PLAYER_QUIT2 10300
|
|
|
|
#define IDM_VIEWPORT_NEW1 10400
|
|
|
|
#define IDM_VIEWPORT_NEW2 10500
|
|
|
|
|
2010-12-11 18:50:38 +00:00
|
|
|
class C4Console: public C4ConsoleGUI
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
C4Console();
|
|
|
|
virtual ~C4Console();
|
|
|
|
void Default();
|
|
|
|
virtual void Clear();
|
|
|
|
virtual void Close();
|
2012-04-11 02:15:33 +00:00
|
|
|
using C4Window::Init;
|
2011-08-27 21:12:01 +00:00
|
|
|
virtual C4Window * Init(C4AbstractApp * app);
|
2010-03-28 17:58:21 +00:00
|
|
|
void Execute();
|
|
|
|
void ClearPointers(C4Object *pObj);
|
|
|
|
bool Message(const char *szMessage, bool fQuery=false);
|
|
|
|
bool In(const char *szText);
|
|
|
|
void DoPlay();
|
2010-12-11 18:50:38 +00:00
|
|
|
void DoHalt();
|
2010-03-28 17:58:21 +00:00
|
|
|
void UpdateInputCtrl();
|
|
|
|
void UpdateMenus();
|
2011-01-06 23:51:35 +00:00
|
|
|
void InitGame();
|
2010-03-28 17:58:21 +00:00
|
|
|
bool TogglePause(); // key callpack: pause
|
2010-12-11 18:50:38 +00:00
|
|
|
public:
|
2011-01-06 23:51:35 +00:00
|
|
|
void CloseGame();
|
2010-03-28 17:58:21 +00:00
|
|
|
bool UpdatePlayerMenu();
|
|
|
|
bool UpdateViewportMenu();
|
2010-12-14 01:06:23 +00:00
|
|
|
void UpdateStatusBars();
|
2010-12-11 18:50:38 +00:00
|
|
|
// Menu
|
2010-03-28 17:58:21 +00:00
|
|
|
void ClearViewportMenu();
|
|
|
|
void UpdateNetMenu();
|
|
|
|
void ClearNetMenu();
|
|
|
|
void PlayerJoin();
|
|
|
|
void ViewportNew();
|
|
|
|
void HelpAbout();
|
2011-04-08 21:52:40 +00:00
|
|
|
bool FileSelect(StdStrBuf *sFilename, const char *szFilter, DWORD dwFlags, bool fSave=false);
|
2011-06-24 12:25:30 +00:00
|
|
|
bool SaveGame(const char * path);
|
|
|
|
bool SaveScenario(const char * path);
|
2010-03-28 17:58:21 +00:00
|
|
|
bool FileSaveAs(bool fSaveGame);
|
2011-05-15 17:38:47 +00:00
|
|
|
bool FileSave();
|
2010-03-28 17:58:21 +00:00
|
|
|
bool FileOpen();
|
|
|
|
bool FileOpenWPlrs();
|
|
|
|
bool FileCommand();
|
|
|
|
bool FileClose();
|
|
|
|
bool FileQuit();
|
|
|
|
bool FileRecord();
|
2010-12-11 18:50:38 +00:00
|
|
|
void SetCaptionToFilename(const char* szFilename);
|
|
|
|
public:
|
|
|
|
C4ToolsDlg ToolsDlg;
|
|
|
|
C4ObjectListDlg ObjectListDlg;
|
|
|
|
C4EditCursor EditCursor;
|
2010-03-28 17:58:21 +00:00
|
|
|
|
|
|
|
int FrameCounter;
|
|
|
|
int Time,FPS;
|
2015-09-27 19:27:38 +00:00
|
|
|
|
|
|
|
// Script MRU: Keep track of recent script executions in global and local windows
|
|
|
|
enum RecentScriptInputLists
|
|
|
|
{
|
|
|
|
MRU_Scenario = 0,
|
|
|
|
MRU_Object = 1
|
|
|
|
};
|
|
|
|
private:
|
|
|
|
std::list<StdCopyStrBuf> recent_script_input[2];
|
|
|
|
public:
|
|
|
|
std::list<const char *> GetScriptSuggestions(class C4PropList *target, RecentScriptInputLists section) const;
|
|
|
|
void RegisterRecentInput(const char *input, RecentScriptInputLists section);
|
2010-03-28 17:58:21 +00:00
|
|
|
};
|
2009-05-08 13:28:41 +00:00
|
|
|
|
2010-03-28 17:58:21 +00:00
|
|
|
extern C4Console Console;
|
2009-05-08 13:28:41 +00:00
|
|
|
|
|
|
|
#endif
|