OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Console.cpp
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2009-2016, The OpenClonk 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 /* Handles engine execution in developer mode */
19 
20 #include "C4Include.h"
21 #include "editor/C4Console.h"
22 
23 #include "C4Version.h"
24 #include "control/C4GameControl.h"
25 #include "control/C4GameSave.h"
26 #include "game/C4Application.h"
27 #include "game/C4GraphicsSystem.h"
28 #include "game/C4Viewport.h"
29 #include "gui/C4MessageInput.h"
30 #include "landscape/C4Landscape.h"
31 #include "object/C4Def.h"
32 #include "player/C4Player.h"
33 #include "player/C4PlayerList.h"
34 #include "script/C4ScriptHost.h"
35 
36 #include "platform/StdRegistry.h"
37 
38 #define FILE_SELECT_FILTER_FOR_C4S "OpenClonk Scenario\0" \
39  "*.ocs *.ocf Scenario.txt\0" \
40  "\0"
41 
42 using namespace OpenFileFlags;
43 
45 {
46  Active = false;
47  Editing = true;
48  FrameCounter=0;
49  fGameOpen=false;
50 
51 #ifdef USE_WIN32_WINDOWS
52  hWindow=nullptr;
53 #endif
54 }
55 
56 C4Console::~C4Console() = default;
57 
59 {
61  return nullptr;
62  return this;
63 }
64 
65 bool C4Console::In(const char *szText)
66 {
67  if (!Active || !szText) return false;
68  // begins with '/'? then it's a command
69  if (*szText == '/')
70  {
72  // done
73  return true;
74  }
75  // begins with '#'? then it's a message. Route via ProcessInput to allow #/sound
76  // Also, in the lobby, everything written here is still a message
77  bool is_chat_command = (*szText == '#');
78  if (is_chat_command || (::Network.isEnabled() && !::Network.Status.isPastLobby()))
79  {
80  ::MessageInput.ProcessInput(szText + is_chat_command);
81  return true;
82  }
83  // editing enabled?
84  if (!EditCursor.EditingOK()) return false;
85  // pass through network queue
87  return true;
88 }
89 
90 // Someone defines Status as int....
91 #ifdef Status
92 #undef Status
93 #endif
94 
96 {
97  Game.Unpause();
98 }
99 
101 {
102  Game.Pause();
103 }
104 
106 {
107  if (!Active) return;
108  // Frame counter
110  {
112  StdStrBuf str;
113  str.Format("Frame: %i",FrameCounter);
115  }
116  // Time & FPS
117  if ((Game.Time!=Time) || (Game.FPS!=FPS))
118  {
119  Time=Game.Time;
120  FPS=Game.FPS;
121  StdStrBuf str;
122  str.Format("%02d:%02d:%02d (%i FPS)",Time/3600,(Time%3600)/60,Time%60,FPS);
124  }
125 }
126 
127 bool C4Console::SaveGame(const char * path)
128 {
129  // Network hosts only
130  if (::Network.isEnabled() && !::Network.isHost())
131  { Message(LoadResStr("IDS_GAME_NOCLIENTSAVE")); return false; }
132 
133  // Save game to open scenario file
134  bool fOkay=true;
136 
137  C4GameSave *pGameSave = new C4GameSaveSavegame();
138  if (!pGameSave->Save(path))
139  { Out("Save failed"); fOkay=false; }
140  delete pGameSave;
141 
143 
144  // Status report
145  if (!fOkay) Message(LoadResStr("IDS_CNS_SAVERROR"));
146  else Out(LoadResStr("IDS_CNS_GAMESAVED"));
147 
148  return fOkay;
149 }
150 
151 bool C4Console::SaveScenario(const char * path, bool export_packed)
152 {
153  C4Group *save_target_group = &Game.ScenarioFile;
154  C4Group export_group;
155  if (export_packed)
156  {
157  // Export to packed file: Delete existing
158  if (FileExists(path))
159  {
160  if (ItemIdentical(Game.ScenarioFilename, path) || !EraseItem(path))
161  {
162  Message(FormatString(LoadResStr("IDS_CNS_SAVEASERROR"), path).getData());
163  return false;
164  }
165  }
166  // Write into new, packed copy
167  if (!C4Group_PackDirectoryTo(Game.ScenarioFilename, path) || !export_group.Open(path))
168  {
169  Message(FormatString(LoadResStr("IDS_CNS_SAVEASERROR"), path).getData());
170  return false;
171  }
172  save_target_group = &export_group;
173  }
174  else if (path)
175  {
176  // When trying to save into a subfolder of the existing scenario, the copy function
177  // below will try to recursively copy everything until it blows the stack. There is
178  // really no good reason to do this, so we just disallow it here.
179  if (SEqual2(path, Game.ScenarioFilename))
180  {
181  Message(LoadResStr("IDS_CNS_RECURSIVESAVEASERROR"));
182  return false;
183  }
184  // Open new scenario file
185  // Close current scenario file to allow re-opening at new path
187  // Copy current scenario file to target
189  {
190  Message(FormatString(LoadResStr("IDS_CNS_SAVEASERROR"),path).getData());
191  return false;
192  }
193  // Re-open at new path (unless exporting, in which case the export is just a copy)
197  {
198  Message(FormatString(LoadResStr("IDS_CNS_SAVEASERROR"), Game.ScenarioFilename).getData());
199  return false;
200  }
201  }
202  else
203  {
204  // Do not save to temp network file
206  {
207  Message(LoadResStr("IDS_CNS_NONETREFSAVE"));
208  return false;
209  }
210  }
211 
212  // Can't save to child groups
213  if (save_target_group->GetMother() && save_target_group->GetMother()->IsPacked())
214  {
215  StdStrBuf str;
216  str.Format(LoadResStr("IDS_CNS_NOCHILDSAVE"),
217  GetFilename(save_target_group->GetName()));
218  Message(str.getData());
219  return false;
220  }
221 
222  // Save game to open scenario file
224 
225  bool fOkay=true;
227  if (!pGameSave->Save(*save_target_group, false))
228  { Out("Game::Save failed"); fOkay=false; }
229  delete pGameSave;
230 
231  // Close and reopen scenario file to fix file changes
232  if (!export_packed)
233  {
234  if (!Game.ScenarioFile.Close())
235  {
236  Out("ScenarioFile::Close failed"); fOkay = false;
237  }
239  {
240  Out("ScenarioFile::Open failed"); fOkay = false;
241  }
242  }
243 
245 
246  // Initialize/script notification
248  {
249  StdStrBuf str(LoadResStr("IDS_CNS_SCRIPTCREATEDOBJECTS"));
250  str += LoadResStr("IDS_CNS_WARNDOUBLE");
251  Message(str.getData());
252  Game.fScriptCreatedObjects = false;
253  }
254 
255  // Status report
256  if (!fOkay) Message(LoadResStr("IDS_CNS_SAVERROR"));
257  else Out(LoadResStr("IDS_CNS_SCENARIOSAVED"));
258 
259  return fOkay;
260 }
261 
263 {
264  // Save game
265  // FIXME: What about editing a savegame inplace? (Game.C4S.Head.SaveGame)
266  return SaveScenario(nullptr);
267 }
268 
269 bool C4Console::FileSaveAs(bool fSaveGame, bool export_packed)
270 {
271  // Do save-as dialog
272  StdCopyStrBuf filename("");
273  filename.Copy(Game.ScenarioFile.GetName());
274  if (export_packed)
275  {
276  RemoveExtension(&filename);
277  filename.Append("_packed.ocs");
278  }
279  if (!FileSelect(&filename,
280  "OpenClonk Scenario\0*.ocs\0\0",
282  true)) return false;
283  DefaultExtension(&filename,"ocs");
284  if (!export_packed) ::Config.Developer.AddRecentlyEditedScenario(filename.getData());
285  if (fSaveGame)
286  // Save game
287  return SaveGame(filename.getData());
288  else
289  return SaveScenario(filename.getData(), export_packed);
290 }
291 
292 bool C4Console::Message(const char *szMessage, bool fQuery)
293 {
294  if (!Active) return false;
295  return C4ConsoleGUI::Message(szMessage, fQuery);
296 }
297 
299 {
300  StdCopyStrBuf filename;
301 #ifdef WITH_QT_EDITOR
302  bool host_in_network = false;
303  if (!C4ConsoleGUI::CreateNewScenario(&filename, &host_in_network)) return false;
306  if (host_in_network)
307  {
308  Game.NetworkActive = true;
309  Game.fLobby = true;
310  }
311  Application.OpenGame(filename.getData());
312  return true;
313 #endif
314  // Not implemented
315  return false;
316 
317 }
318 
319 bool C4Console::FileOpen(const char *filename, bool host_in_network)
320 {
321  // Get scenario file name
322  StdCopyStrBuf c4sfile("");
323  if (!filename)
324  {
325  if (!FileSelect(&c4sfile,
328  return false;
329  filename = c4sfile.getData();
330  }
333  if (host_in_network)
334  {
335  Game.NetworkActive = true;
336  Game.fLobby = true;
337  }
338  // Open game
339  Application.OpenGame(filename);
340  return true;
341 }
342 
344 {
345  // Get scenario file name
346  StdCopyStrBuf c4sfile("");
347  if (!FileSelect(&c4sfile,
350  return false;
351  // Get player file name(s)
352  StdCopyStrBuf c4pfile("");
353  if (!FileSelect(&c4pfile,
354  "OpenClonk Player\0*.ocp\0\0",
356  )) return false;
357  // Compose command line
359  if (DirectoryExists(c4pfile.getData())) // Multiplayer
360  {
361  const char *cptr = c4pfile.getData() + SLen(c4pfile.getData()) + 1;
362  while (*cptr)
363  {
364  char c4pfile2[512 + 1] = "";
365  SAppend(c4pfile.getData(), c4pfile2, 512);
366  SAppend(DirSep, c4pfile2, 512);
367  SAppend(cptr, c4pfile2, 512);
368  SAddModule(Game.PlayerFilenames, c4pfile2);
369  cptr += SLen(cptr) + 1;
370  }
371  }
372  else // Single player
373  {
375  }
377  // Open game
378  Application.OpenGame(c4sfile.getData());
379  return true;
380 }
381 
383 {
384  if (!fGameOpen) return false;
386  return true;
387 }
388 
389 bool C4Console::FileSelect(StdStrBuf * sFilename, const char * szFilter, DWORD dwFlags, bool fSave)
390 {
391  return C4ConsoleGUI::FileSelect(sFilename, szFilter, dwFlags, fSave);
392 }
393 
395 {
396  // only in running mode
397  if (!Game.IsRunning || !::Control.IsRuntimeRecordPossible()) return false;
398  // start record!
400  // disable menuitem
402  return true;
403 }
404 
406 {
409 }
410 
412 {
414  PropertyDlgObject = nullptr;
415  ToolsDlg.Default();
416 }
417 
419 {
420  if (pSurface) delete pSurface;
421  pSurface = nullptr;
422 
423  C4Window::Clear();
425 
426  EditCursor.Clear();
427  ToolsDlg.Clear();
430  ClearPlayerMenu();
431  ClearNetMenu();
432 #ifndef _WIN32
433  Application.Quit();
434 #endif
435 }
436 
438 {
440  Application.Quit();
441 }
442 
444 {
445  Close();
446  return true;
447 }
448 
450 {
451  StdStrBuf strCopyright;
452  strCopyright.Format("Copyright (c) %s %s", C4COPYRIGHT_YEAR, C4COPYRIGHT_COMPANY);
453  ShowAboutWithCopyright(strCopyright);
454 }
455 
457 {
458  if (!fGameOpen) return;
460 }
461 
463 {
464  if (!Active) return false;
466  for (C4Player *pPlr=::Players.First; pPlr; pPlr=pPlr->Next)
467  {
468  StdStrBuf sText;
469  sText.Format(LoadResStr("IDS_CNS_NEWPLRVIEWPORT"),pPlr->GetName());
471  }
472  return true;
473 }
474 
476 {
477  if (!Active) return;
479 }
480 
482 {
483  // add global and standard functions
485  SetInputFunctions(functions);
486 }
487 
489 {
490  if (!Active) return false;
491  ClearPlayerMenu();
492  for (C4Player *pPlr=::Players.First; pPlr; pPlr=pPlr->Next)
493  {
494  StdStrBuf sText;
495  if (::Network.isEnabled())
496  sText.Format(LoadResStr("IDS_CNS_PLRQUITNET"),pPlr->GetName(),pPlr->AtClientName);
497  else
498  sText.Format(LoadResStr("IDS_CNS_PLRQUIT"),pPlr->GetName());
499  AddKickPlayerMenuItem(pPlr, sText, (!::Network.isEnabled() || ::Network.isHost()) && Editing);
500  }
501  return true;
502 }
503 
505 {
506  if (!Active) return;
510  UpdateNetMenu();
511 }
512 
514 {
515  // Get player file name(s)
516  StdCopyStrBuf c4pfile("");
517  if (!FileSelect(&c4pfile,
518  "OpenClonk Player\0*.ocp\0\0",
520  )) return;
521 
522  // Multiple players
523  if (DirectoryExists(c4pfile.getData()))
524  {
525  const char *cptr = c4pfile.getData() + SLen(c4pfile.getData()) + 1;
526  while (*cptr)
527  {
528  StdStrBuf f;
529  f.Copy(c4pfile.getData());
530  f.AppendBackslash(); f.Append(cptr);
531  cptr += SLen(cptr)+1;
533  }
534  }
535  // Single player
536  else
537  {
538  ::Players.JoinNew(c4pfile.getData());
539  }
540 }
541 
543 {
544  // Active & network hosting check
545  if (!Active) return;
546  if (!::Network.isHost() || !::Network.isEnabled()) return;
547  // Clear old
548  ClearNetMenu();
549  // Insert menu
551 
552  // Host
553  StdStrBuf str;
554  str.Format(LoadResStr("IDS_MNU_NETHOST"),Game.Clients.getLocalName(),Game.Clients.getLocalID());
556  // Clients
557  for (C4Network2Client *pClient=::Network.Clients.GetNextClient(nullptr); pClient; pClient=::Network.Clients.GetNextClient(pClient))
558  {
559  if (pClient->isHost()) continue;
560  str.Format(LoadResStr(pClient->isActivated() ? "IDS_MNU_NETCLIENT_DEACTIVATE" : "IDS_MNU_NETCLIENT_ACTIVATE"),
561  pClient->getName(), pClient->getID());
562  AddNetMenuItemForPlayer(pClient->getID(), str.getData(), pClient->isActivated() ? C4ConsoleGUI::CO_Deactivate : C4ConsoleGUI::CO_Activate);
563  str.Format(LoadResStr("IDS_NET_KICKCLIENTEX"), pClient->getName(), pClient->getID());
564  AddNetMenuItemForPlayer(pClient->getID(), str.getData(), C4ConsoleGUI::CO_Kick);
565  }
566  return;
567 }
568 
570 {
571  if (!Active) return;
573 }
574 
575 void C4Console::SetCaptionToFilename(const char* szFilename)
576 {
577  SetTitle(GetFilename(szFilename));
579 }
580 
582 {
588 }
589 
591 {
592  if (!Active) return;
593  // Default game dependent members
594  Default();
596  // Init game dependent members
597  EditCursor.Init();
598 
599  // Console updates
600  fGameOpen=true;
601  UpdateInputCtrl();
605  // Initial neutral viewport unless started with players
607 }
608 
610 {
611  if (!Active || !fGameOpen) return;
612  fGameOpen=false;
614  SetTitle(LoadResStr("IDS_CNS_CONSOLE"));
615 }
616 
618 {
619  return Game.TogglePause();
620 }
621 
622 std::list<const char *> C4Console::GetScriptSuggestions(C4PropList *target, RecentScriptInputLists section) const
623 {
624  // Functions for this object
625  std::list<const char *> functions = ::ScriptEngine.GetFunctionNames(target);
626  // Prepend most recently used script calls in reverse order
627  const std::list<StdCopyStrBuf> &mru = recent_script_input[section];
628  if (!mru.empty())
629  {
630  functions.insert(functions.begin(), nullptr);
631  // add pointers into string buffer list
632  // do not iterate with for (auto i : mru) because this would copy the buffer and add stack pointers
633  for (const auto & i : mru)
634  functions.insert(functions.begin(), i.getData());
635  }
636  return functions;
637 }
638 
640 {
641  std::list<StdCopyStrBuf> &mru = recent_script_input[section];
642  // remove previous copy (i.e.: Same input just gets pushed to top)
643  mru.remove(StdCopyStrBuf(input));
644  // register to list
645  mru.emplace_back(input);
646  // limit history length
647  if (static_cast<int32_t>(mru.size()) > ::Config.Developer.MaxScriptMRU)
648  mru.erase(mru.begin());
649 }
650 
651 #if !(defined(USE_WIN32_WINDOWS) || defined(USE_COCOA) || defined(WITH_QT_EDITOR))
652 class C4ConsoleGUI::State: public C4ConsoleGUI::InternalState<class C4ConsoleGUI>
653 {
654  public: State(C4ConsoleGUI *console): Super(console) {}
655 };
656 class C4ToolsDlg::State: public C4ConsoleGUI::InternalState<class C4ToolsDlg>
657 {
658  public: State(C4ToolsDlg* dlg): Super(dlg) {}
659  void Clear() {}
660  void Default() {}
661 };
667 bool C4ConsoleGUI::ClearLog() {return false;}
672 {
673  C4Rect r(0, 0, 400, 350);
674  if (!C4Window::Init(C4Window::W_Console, pApp, LoadResStr("IDS_CNS_CONSOLE"), &r))
675  return false;
676  return true;
677 }
681 bool C4ConsoleGUI::DoUpdateHaltCtrls(bool) {return false;}
682 bool C4ConsoleGUI::FileSelect(StdStrBuf *, char const*, DWORD, bool) {return false;}
683 bool C4ConsoleGUI::Message(char const*, bool) {return false;}
684 void C4ConsoleGUI::Out(char const*) {}
685 bool C4ConsoleGUI::PropertyDlgOpen() {return false;}
691 void C4ConsoleGUI::SetInputFunctions(std::list<const char*>&) {}
699 bool C4ConsoleGUI::UpdateModeCtrls(int) {return false;}
703 bool C4ToolsDlg::PopMaterial() {return false;}
704 bool C4ToolsDlg::PopTextures() {return false;}
710 bool C4Viewport::TogglePlayerLock() {return false;}
712 #endif
bool FileSaveAs(bool fSaveGame, bool export_packed=false)
Definition: C4Console.cpp:269
void Execute()
Definition: C4Console.cpp:581
char * GetFilename(char *szPath)
Definition: StdFile.cpp:45
const char * getData() const
Definition: StdBuf.h:442
C4EditCursor EditCursor
Definition: C4Console.h:90
void EnableControls(bool fEnable)
Definition: C4ConsoleGUI.h:143
const DWORD OFN_EXPLORER
Definition: C4ConsoleGUI.h:31
bool IsRunning
Definition: C4Game.h:139
void OpenGame(const char *scenario=nullptr)
int FrameCounter
Definition: C4Console.h:92
char ScenarioFilename[_MAX_PATH+1]
Definition: C4Game.h:102
StdStrBuf TempScenarioFile
Definition: C4Game.h:126
C4Config Config
Definition: C4Config.cpp:833
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:130
State(C4ToolsDlg *dlg)
Definition: C4Console.cpp:658
C4Console Console
Definition: C4Globals.cpp:45
bool isHost() const
Definition: C4Network2.h:209
C4Network2Client * GetNextClient(C4Network2Client *pClient)
RecentScriptInputLists
Definition: C4Console.h:96
void SetCaptionToFileName(const char *file_name)
Definition: C4Console.cpp:689
bool PopMaterial()
Definition: C4Console.cpp:703
C4Group * GetMother()
Definition: C4Group.cpp:2004
void SAppend(const char *szSource, char *szTarget, int iMaxL)
Definition: Standard.cpp:235
bool ItemIdentical(const char *szFilename1, const char *szFilename2)
Definition: StdFile.cpp:855
void ClearNetMenu()
Definition: C4Console.cpp:569
C4Game Game
Definition: C4Globals.cpp:52
C4GameScriptHost GameScript
void HelpAbout()
Definition: C4Console.cpp:449
C4AulScriptEngine ScriptEngine
Definition: C4Globals.cpp:43
void CloseConsoleWindow()
Definition: C4ConsoleGUI.h:116
void ClearViewportMenu()
Definition: C4Console.cpp:475
void DeleteConsoleWindow()
Definition: C4Console.cpp:678
C4ToolsDlg ToolsDlg
Definition: C4Console.h:88
C4Surface * pSurface
Definition: C4Window.h:274
void ToolsDlgSelectMaterial(C4ToolsDlg *dlg, const char *material)
Definition: C4Console.cpp:695
void ToolsDlgSelectBackTexture(C4ToolsDlg *dlg, const char *texture)
Definition: C4Console.cpp:698
bool TogglePause()
Definition: C4Console.cpp:617
void SetTitle(const char *Title)
Definition: C4AppT.cpp:111
void UpdateNetMenu()
Definition: C4Console.cpp:542
void RegisterRecentInput(const char *input, RecentScriptInputLists section)
Definition: C4Console.cpp:639
Definition: C4Rect.h:27
void ToolsDlgInitMaterialCtrls(class C4ToolsDlg *dlg)
Definition: C4Console.cpp:693
bool DoUpdateHaltCtrls(bool fHalt)
Definition: C4Console.cpp:681
C4Player * First
Definition: C4PlayerList.h:31
void DoHalt()
Definition: C4Console.cpp:100
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:174
C4MessageInput MessageInput
~C4Console() override
int Time
Definition: C4Console.h:93
#define _MAX_PATH
bool FileClose()
Definition: C4Console.cpp:382
size_t SLen(const char *sptr)
Definition: Standard.h:74
void UpdateMenus()
Definition: C4Console.cpp:504
#define FILE_SELECT_FILTER_FOR_C4S
Definition: C4Console.cpp:38
void PropertyDlgUpdate(class C4EditCursorSelection &rSelection, bool force_function_update)
Definition: C4Console.cpp:687
void AddRecentlyEditedScenario(const char *fn)
Definition: C4Config.cpp:96
bool PropertyDlgOpen()
Definition: C4Console.cpp:685
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
bool Pause()
Definition: C4Game.cpp:950
void UpdateInputCtrl()
Definition: C4Console.cpp:481
void Clear() override
Definition: C4Console.cpp:418
bool C4Group_PackDirectoryTo(const char *szFilename, const char *szFilenameTo)
Definition: C4Group.cpp:221
void AppendBackslash()
Definition: StdBuf.cpp:248
void ClearNetMenu()
Definition: C4Console.cpp:668
bool CreateNewScenario(StdStrBuf *out_filename, bool *out_host_as_network)
Definition: C4ConsoleGUI.h:113
void ToolsDlgSelectTexture(C4ToolsDlg *dlg, const char *texture)
Definition: C4Console.cpp:696
int32_t FrameCounter
Definition: C4Game.h:128
void ShowAboutWithCopyright(StdStrBuf &copyright)
Definition: C4Console.cpp:692
C4Network2 Network
Definition: C4Globals.cpp:53
void JoinNew(const char *szFilename)
bool Save(const char *szFilename)
Definition: C4GameSave.cpp:398
C4Object * PropertyDlgObject
Definition: C4ConsoleGUI.h:164
int32_t getLocalID() const
Definition: C4Client.h:171
int32_t FPS
Definition: C4Game.h:111
const char * GetName() const
Definition: C4Group.cpp:1845
bool isPastLobby() const
Definition: C4Network2.h:88
void DoPlay()
Definition: C4Console.cpp:95
C4GameControl Control
C4Landscape Landscape
C4GraphicsSystem GraphicsSystem
Definition: C4Globals.cpp:51
bool Open(const char *szGroupName, bool fCreate=false)
Definition: C4Group.cpp:514
const char * getLocalName() const
Definition: C4Client.h:170
C4Value ScenPropList
Definition: C4ScriptHost.h:163
void SetCaptionToFilename(const char *szFilename)
Definition: C4Console.cpp:575
void Execute()
Definition: C4ConsoleGUI.h:109
void DoInput(C4PacketType eCtrlType, C4ControlPacket *pPkt, C4ControlDeliveryType eDelivery)
C4Group ScenarioFile
Definition: C4Game.h:86
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:519
const DWORD OFN_FILEMUSTEXIST
Definition: C4ConsoleGUI.h:28
bool Unpause()
Definition: C4Game.cpp:976
C4PlayerList Players
bool C4Group_CopyItem(const char *szSource, const char *szTarget1, bool fNoSort, bool fResetAttributes)
Definition: C4Group.cpp:100
int32_t Time
Definition: C4Game.h:131
void ViewportNew()
Definition: C4Console.cpp:456
bool ProcessCommand(const char *szCommand)
int32_t MaxScriptMRU
Definition: C4Config.h:86
C4ConfigDeveloper Developer
Definition: C4Config.h:252
bool IsRuntimeRecordPossible() const
C4Network2Status Status
Definition: C4Network2.h:122
const int NO_OWNER
Definition: C4Constants.h:138
void Out(const char *message)
Definition: C4Console.cpp:684
bool Close()
Definition: C4Group.cpp:755
C4ObjectListDlg ObjectListDlg
Definition: C4Console.h:89
void ClearPointers(C4Object *pObj)
void Close() override
Definition: C4Console.cpp:437
bool In(const char *szText)
Definition: C4Console.cpp:65
bool NetworkActive
Definition: C4Game.h:122
void DefaultExtension(char *szFilename, const char *szExtension)
Definition: StdFile.cpp:274
bool isEnabled() const
Definition: C4Network2.h:203
bool CreateViewport(int32_t iPlayer, bool fSilent=false)
Definition: C4Viewport.cpp:917
void ToolsDlgSelectBackMaterial(C4ToolsDlg *dlg, const char *material)
Definition: C4Console.cpp:697
bool TogglePlayerLock()
Definition: C4Console.cpp:710
void RemoveExtension(char *szFilename)
Definition: StdFile.cpp:306
State(C4ConsoleGUI *console)
Definition: C4Console.cpp:654
LandscapeMode GetMode() const
std::list< const char * > GetScriptSuggestions(class C4PropList *target, RecentScriptInputLists section) const
Definition: C4Console.cpp:622
void InitGradeCtrl()
Definition: C4Console.cpp:701
int32_t GetStartupCount()
void ClearPointers(class C4Object *obj)
Definition: C4ConsoleGUI.h:117
const DWORD OFN_HIDEREADONLY
Definition: C4ConsoleGUI.h:26
bool Message(const char *message, bool query)
Definition: C4Console.cpp:683
void Quit() override
bool FileOpenWPlrs()
Definition: C4Console.cpp:343
void AddNetMenuItemForPlayer(int32_t client_id, const char *text, C4ConsoleGUI::ClientOperation co)
Definition: C4Console.cpp:664
bool FileRecord()
Definition: C4Console.cpp:394
bool FileExists(const char *szFileName)
void UpdateIFTControls()
Definition: C4Console.cpp:705
std::list< const char * > GetFunctionNames(C4PropList *)
void AddKickPlayerMenuItem(C4Player *player, StdStrBuf &player_text, bool enabled)
Definition: C4Console.cpp:662
bool ToolsDlgOpen(class C4ToolsDlg *dlg)
Definition: C4Console.cpp:694
bool DirectoryExists(const char *szFilename)
Definition: StdFile.cpp:684
void Default()
Definition: C4Console.cpp:411
C4Network2ClientList Clients
Definition: C4Network2.h:116
bool FileOpen(const char *filename=nullptr, bool host_in_network=false)
Definition: C4Console.cpp:319
void ClearViewportMenu()
Definition: C4Console.cpp:670
C4PlayerInfoList & PlayerInfos
Definition: C4Game.h:71
bool UpdatePlayerMenu()
Definition: C4Console.cpp:488
void NeedPreviewUpdate()
Definition: C4Console.cpp:702
C4ViewportList Viewports
Definition: C4Viewport.cpp:841
char PlayerFilenames[20 *_MAX_PATH+1]
Definition: C4Game.h:104
bool SaveScenario(const char *path, bool export_packed=false)
Definition: C4Console.cpp:151
void InitGame()
Definition: C4Console.cpp:590
bool UpdateModeCtrls(int iMode)
Definition: C4Console.cpp:699
void UpdateToolCtrls()
Definition: C4Console.cpp:708
void UpdateLandscapeModeCtrls()
Definition: C4Console.cpp:706
bool FileNew()
Definition: C4Console.cpp:298
void RecordingEnabled()
Definition: C4Console.cpp:688
bool EraseItem(const char *szItemName)
Definition: StdFile.cpp:809
bool CreateConsoleWindow(C4AbstractApp *application)
Definition: C4Console.cpp:671
int FPS
Definition: C4Console.h:93
bool ScrollBarsByViewPosition()
Definition: C4Console.cpp:709
bool PopTextures()
Definition: C4Console.cpp:704
bool Active
Definition: C4Window.h:273
void ClearPointers(C4Object *pObj)
Definition: C4Console.cpp:405
C4Player * Next
Definition: C4Player.h:142
bool FileSave()
Definition: C4Console.cpp:262
bool SEqual2(const char *szStr1, const char *szStr2)
Definition: Standard.cpp:176
C4ClientList & Clients
Definition: C4Game.h:69
void SetInputFunctions(std::list< const char * > &functions)
Definition: C4Console.cpp:691
bool FileSelect(StdStrBuf *sFilename, const char *szFilter, DWORD dwFlags, bool fSave)
Definition: C4Console.cpp:682
virtual C4Window * Init(WindowKind windowKind, C4AbstractApp *pApp, const char *Title, const C4Rect *size)
Definition: C4AppT.cpp:106
void CloseGame()
Definition: C4Console.cpp:609
bool ClearLog()
Definition: C4Console.cpp:667
bool IsPacked() const
Definition: C4Group.cpp:2009
bool FileQuit()
Definition: C4Console.cpp:443
void AddMenuItemForPlayer(C4Player *player, StdStrBuf &player_text)
Definition: C4Console.cpp:663
virtual C4Window * Init(C4AbstractApp *app)
Definition: C4Console.cpp:58
void ToolsDlgClose()
Definition: C4Console.cpp:666
bool TogglePause()
Definition: C4Game.cpp:942
void ClearCommandLine()
void DoEnableControls(bool fEnable)
Definition: C4Console.cpp:680
bool FileSelect(StdStrBuf *sFilename, const char *szFilter, DWORD dwFlags, bool fSave=false)
Definition: C4Console.cpp:389
void AddNetMenu()
Definition: C4Console.cpp:665
const DWORD OFN_ALLOWMULTISELECT
Definition: C4ConsoleGUI.h:29
void DisplayInfoText(InfoTextType type, StdStrBuf &text)
Definition: C4Console.cpp:679
bool SaveGame(const char *path)
Definition: C4Console.cpp:127
#define DirSep
C4PropList * _getPropList() const
Definition: C4Value.h:129
virtual void Clear()
Definition: C4AppT.cpp:99
void ClearPlayerMenu()
Definition: C4Console.cpp:669
void UpdateStatusBars()
Definition: C4Console.cpp:105
bool UpdateViewportMenu()
Definition: C4Console.cpp:462
uint32_t DWORD
bool fScriptCreatedObjects
Definition: C4Game.h:117
bool fLobby
Definition: C4Game.h:118
void RequestRuntimeRecord()
void Copy()
Definition: StdBuf.h:467
bool EditingOK(bool for_landscape_drawing=false)
void SetCursor(Cursor cursor)
Definition: C4Console.cpp:690
bool SAddModule(char *szList, const char *szModule, bool fCaseSensitive)
Definition: Standard.cpp:535
C4Application Application
Definition: C4Globals.cpp:44
const DWORD OFN_OVERWRITEPROMPT
Definition: C4ConsoleGUI.h:27
void UpdateTextures()
Definition: C4Console.cpp:707
bool ProcessInput(const char *szText)
bool Message(const char *szMessage, bool fQuery=false)
Definition: C4Console.cpp:292
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270
void PlayerJoin()
Definition: C4Console.cpp:513
void EnableControls()
Definition: C4Console.cpp:700
void PropertyDlgClose()
Definition: C4Console.cpp:686
class InternalState< class C4ConsoleGUI > Super
Definition: C4ConsoleGUI.h:42