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