OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4StartupScenSelDlg.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) 2009-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: Scenario selection dialog
17 
18 #ifndef INC_C4StartupScenSelDlg
19 #define INC_C4StartupScenSelDlg
20 
21 #include "gui/C4Startup.h"
22 #include "landscape/C4Scenario.h"
23 #include "gui/C4Folder.h"
25 
26 #include <list>
27 #include <string>
28 
30 
40  C4StartupScenSel_TitleOverlayMargin = 20, // number of pixels to each side of title overlay picture
41  C4StartupScenSel_MaxAchievements = 3; // maximum number of achievements shown next to entry
42 
43 // a list of loaded scenarios
45 {
46 public:
47  class Folder;
48  // either a scenario or scenario folder; manages singly linked tree
49  class Entry
50  {
51  protected:
54  class Folder *pParent;
55 
56  friend class Folder;
57 
58  protected:
65 
66  public:
67  Entry(class C4ScenarioListLoader *pLoader, class Folder *pParent);
68  virtual ~Entry(); // dtor: unlink from tree
69 
70  bool Load(C4Group *pFromGrp, const StdStrBuf *psFilename, bool fLoadEx); // load as child if pFromGrp, else directly from filename
71  virtual bool LoadCustom(C4Group &rGrp, bool fNameLoaded, bool fIconLoaded) { return true; } // load custom data for entry type (e.g. scenario title fallback in Scenario.txt)
72  virtual bool LoadCustomPre(C4Group &rGrp) { return true; } // preload stuff that's early in the group (Scenario.txt)
73  virtual bool Start() = 0; // start/open entry
74  virtual Folder *GetIsFolder() { return nullptr; } // return this if this is a folder
75 
76  const StdStrBuf &GetName() const { return sName; }
77  const StdStrBuf &GetEntryFilename() const { return sFilename; }
78  const StdStrBuf &GetVersion() const { return sVersion; }
79  const StdStrBuf &GetAuthor() const { return sAuthor; }
80  const C4Facet &GetIconFacet() const { return fctIcon; }
81  const C4Facet &GetTitlePicture() const { return fctTitle; }
82  const StdStrBuf &GetDesc() const { return sDesc; }
83  int GetIconIndex() { return iIconIndex; }
84  int GetDifficulty() { return iDifficulty; }
85  int GetFolderIndex() { return iFolderIndex; }
86  Entry *GetNext() const { return pNext; }
87  class Folder *GetParent() const { return pParent; }
88  virtual StdStrBuf GetTypeName() = 0;
89  virtual bool GetAchievement(int32_t idx, C4Facet *out_facet, const char **out_description) { return false; } // return true and fill output parameters if player got the indexed achievement
90 
91  static Entry *CreateEntryForFile(const StdStrBuf &sFilename, C4ScenarioListLoader *pLoader, Folder *pParent); // create correct entry type based on file extension
92 
93  virtual bool CanOpen(StdStrBuf &sError) { return true; } // whether item can be started/opened (e.g. mission access, unregistered)
94  virtual bool IsGrayed() { return false; } // additional condition for graying out - notice unreg folders are grayed but can still be opened
95  virtual bool IsHidden() { return false; } // condition for hiding element completely
96  virtual bool HasMissionAccess() const { return true; }
97  virtual bool HasUnregisteredAccess() const { return false; }
98  virtual StdStrBuf GetOpenText() = 0; // get open button text
99  virtual StdStrBuf GetOpenTooltip() = 0;
100 
101  virtual const char *GetDefaultExtension() { return nullptr; } // extension to be added when item is renamed
102  virtual bool SetTitleInGroup(C4Group &rGrp, const char *szNewTitle);
103  bool RenameTo(const char *szNewName); // change name+filename
104  virtual bool IsScenario() { return false; }
105 
106  virtual C4ScenarioParameterDefs *GetParameterDefs() { return nullptr; }
107  virtual C4ScenarioParameters *GetParameters() { return nullptr; }
108  };
109 
110  // a loaded scenario to be started
111  class Scenario : public Entry
112  {
113  private:
114  C4Scenario C4S;
115  C4ScenarioParameterDefs ParameterDefs;
116  C4ScenarioParameters Parameters; // each entry caches its parameters set by the user
118  StdCopyStrBuf sAchievementDescriptions[C4StartupScenSel_MaxAchievements];
119  int32_t nAchievements;
120  bool fNoMissionAccess;
121  int32_t iMinPlrCount;
122 
123  public:
124  Scenario(class C4ScenarioListLoader *pLoader, class Folder *pParent) : Entry(pLoader, pParent), fNoMissionAccess(false), nAchievements(0), iMinPlrCount(0) {}
125  virtual ~Scenario() {}
126 
127  virtual bool LoadCustom(C4Group &rGrp, bool fNameLoaded, bool fIconLoaded); // do fallbacks for title and icon; check whether scenario is valid
128  virtual bool LoadCustomPre(C4Group &rGrp); // load scenario core
129  virtual bool Start(); // launch scenario!
130 
131  virtual bool CanOpen(StdStrBuf &sError); // check mission access, player count, etc.
132  virtual bool IsGrayed() { return false; } // additional option for graying out
133  virtual bool IsHidden() { return C4S.Head.Secret && !HasMissionAccess(); } // condition for hiding element completely
134  virtual bool HasMissionAccess() const { return !fNoMissionAccess; }; // check mission access only
135  virtual StdStrBuf GetOpenText(); // get open button text
136  virtual StdStrBuf GetOpenTooltip();
137  const C4Scenario &GetC4S() const { return C4S; } // get scenario core
138  virtual bool GetAchievement(int32_t idx, C4Facet *out_facet, const char **out_description); // return true and fill output parameters if player got the indexed achievement
139 
140  virtual StdStrBuf GetTypeName() { return StdCopyStrBuf(LoadResStr("IDS_TYPE_SCENARIO"), true); }
141 
142  virtual const char *GetDefaultExtension() { return "ocs"; }
143 
144  virtual C4ScenarioParameterDefs *GetParameterDefs() { return &ParameterDefs; }
145  virtual C4ScenarioParameters *GetParameters() { return &Parameters; }
146 
147  virtual bool IsScenario() { return true; }
148  };
149 
150  // scenario folder
151  class Folder : public Entry
152  {
153  protected:
155  bool fContentsLoaded; // if set, directory contents are already loaded
156  Entry *pFirst; // tree structure
157  class C4MapFolderData *pMapData; // if set, contains gfx and data for special map-style folders
158  friend class Entry;
159 
160  public:
161  Folder(class C4ScenarioListLoader *pLoader, Folder *pParent) : Entry(pLoader, pParent), fContentsLoaded(false), pFirst(nullptr), pMapData(nullptr) {}
162  virtual ~Folder();
163 
164  virtual bool LoadCustomPre(C4Group &rGrp); // load folder core
165 
166  bool LoadContents(C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf *psFilename, bool fLoadEx, bool fReload); // load folder contents as child if pFromGrp, else directly from filename
167  uint32_t GetEntryCount() const;
168 
169  protected:
170  void ClearChildren();
171  void Sort();
172  virtual bool DoLoadContents(C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf &sFilename, bool fLoadEx) = 0; // load folder contents as child if pFromGrp, else directly from filename
173 
174  public:
175  virtual bool Start(); // open as subfolder
176  virtual Folder *GetIsFolder() { return this; } // this is a folder
177  Entry *GetFirstEntry() const { return pFirst; }
178  void Resort() { Sort(); }
179  Entry *FindEntryByName(const char *szFilename) const; // find entry by filename comparison
180 
181  virtual bool CanOpen(StdStrBuf &sError) { return true; } // can always open folders
182  virtual bool IsGrayed(); // unreg folders can be opened to view stuff but they are still grayed out for clarity
183  virtual StdStrBuf GetOpenText(); // get open button text
184  virtual StdStrBuf GetOpenTooltip();
185  C4MapFolderData *GetMapData() const { return pMapData; }
186 
187  virtual const C4ScenarioParameterDefs *GetAchievementDefs() const { return nullptr; }
188  virtual const C4AchievementGraphics *GetAchievementGfx() const { return nullptr; }
189  };
190 
191  // .ocf subfolder: Read through by group
192  class SubFolder : public Folder
193  {
194  private:
195  C4ScenarioParameterDefs AchievementDefs;
196  C4AchievementGraphics AchievementGfx;
197 
198  public:
199  SubFolder(class C4ScenarioListLoader *pLoader, Folder *pParent) : Folder(pLoader, pParent) {}
200  virtual ~SubFolder() {}
201 
202  virtual const char *GetDefaultExtension() { return "ocf"; }
203 
204  virtual StdStrBuf GetTypeName() { return StdCopyStrBuf(LoadResStr("IDS_TYPE_FOLDER"), true); }
205 
206  virtual const C4ScenarioParameterDefs *GetAchievementDefs() const { return &AchievementDefs; }
207  virtual const C4AchievementGraphics *GetAchievementGfx() const { return &AchievementGfx; }
208 
209  protected:
210  virtual bool LoadCustom(C4Group &rGrp, bool fNameLoaded, bool fIconLoaded); // load custom data for entry type - icon fallback to folder icon
211  virtual bool DoLoadContents(C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf &sFilename, bool fLoadEx); // load folder contents as child if pFromGrp, else directly from filename
212  };
213 
214  // regular, open folder: Read through by directory iterator
215  class RegularFolder : public Folder
216  {
217  public:
219  virtual ~RegularFolder();
220 
221  virtual StdStrBuf GetTypeName() { return StdCopyStrBuf(LoadResStr("IDS_TYPE_DIRECTORY"), true); }
222 
223  void Merge(const char *szPath);
224 
225  protected:
226  virtual bool LoadCustom(C4Group &rGrp, bool fNameLoaded, bool fIconLoaded); // load custom data for entry type - icon fallback to folder icon
227  virtual bool DoLoadContents(C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf &sFilename, bool fLoadEx); // load folder contents as child if pFromGrp, else directly from filename
228 
229  typedef std::list<std::string> NameList;
230  NameList contents;
231  };
232 
233 private:
234  RegularFolder *pRootFolder;
235  Folder *pCurrFolder; // scenario list in working directory
236  int32_t iLoading, iProgress, iMaxProgress;
237  bool fAbortThis, fAbortPrevious; // activity state
238  const C4ScenarioParameters &Achievements;
239 
240 public:
241  C4ScenarioListLoader(const C4ScenarioParameters &Achievements);
243 
244 private:
245  // activity control (to be replaced by true multithreading)
246  bool BeginActivity(bool fAbortPrevious);
247  void EndActivity();
248 
249 public:
250  bool DoProcessCallback(int32_t iProgress, int32_t iMaxProgress); // returns false if the activity was aborted
251 
252 public:
253  bool Load(const StdStrBuf &sRootFolder); // (unthreaded) loading of all entries in root folder
254  bool Load(Folder *pSpecifiedFolder, bool fReload); // (unthreaded) loading of all entries in subfolder
255  bool LoadExtended(Entry *pEntry); // (unthreaded) loading of desc and title image of specified entry
256  bool FolderBack(); // go upwards by one folder
257  bool ReloadCurrent(); // reload file list
258  bool IsLoading() const { return !!iLoading; }
259  Entry *GetFirstEntry() const { return pCurrFolder ? pCurrFolder->GetFirstEntry() : nullptr; }
260 
261  Folder *GetCurrFolder() const { return pCurrFolder; }
262  Folder *GetRootFolder() const { return pRootFolder; }
263 
264  int32_t GetProgress() const { return iProgress; }
265  int32_t GetMaxProgress() const { return iMaxProgress; }
266  int32_t GetProgressPercent() const { return iProgress * 100 / std::max<int32_t>(iMaxProgress, 1); }
267 
268  const C4ScenarioParameters &GetAchievements() const { return Achievements; }
269 };
270 
271 
272 // -----------------------------------------------
273 
274 
275 
276 // for map-style folders: Data for map display
278 {
279 private:
280  struct Scenario
281  {
282  // compiled data
283  StdStrBuf sFilename;
284  StdStrBuf sBaseImage, sOverlayImage;
285 
286  // parameters for title as drawn on the map (if desired; otherwise sTitle empty)
287  StdStrBuf sTitle;
288  int32_t iTitleFontSize;
289  uint32_t dwTitleInactClr, dwTitleActClr;
290  int32_t iTitleOffX, iTitleOffY;
291  uint8_t byTitleAlign;
292  bool fTitleBookFont;
293  bool fImgDump; // developer help: Dump background image part
294 
295  C4Rect rcOverlayPos;
296  FLOAT_RECT rcfOverlayPos;
297 
298  // set during initialization
299  C4FacetSurface fctBase, fctOverlay;
300  C4ScenarioListLoader::Entry *pScenEntry;
301  C4GUI::Button *pBtn; // used to resolve button events to scenario
302 
303  void CompileFunc(StdCompiler *pComp);
304  };
305 
306  struct AccessGfx
307  {
308  // compiled data
309  StdStrBuf sPassword;
310  StdStrBuf sOverlayImage;
311  C4Rect rcOverlayPos;
312  FLOAT_RECT rcfOverlayPos;
313 
314  // set during initialization
315  C4FacetSurface fctOverlay;
316 
317  void CompileFunc(StdCompiler *pComp);
318  };
319 
320  // non-interactive map item
321  class MapPic : public C4GUI::Picture
322  {
323  private:
324  FLOAT_RECT rcfBounds; // drawing bounds
325  public:
326  MapPic(const FLOAT_RECT &rcfBounds, const C4Facet &rfct); // ctor
327 
328  virtual void MouseInput(C4GUI::CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam); // input: mouse movement or buttons - deselect everything if clicked
329 
330  protected:
331  virtual void DrawElement(C4TargetFacet &cgo); // draw the image
332  };
333 
334 private:
335  C4FacetSurface fctBackgroundPicture; FLOAT_RECT rcfBG;
336  bool fCoordinatesAdjusted;
337  C4Rect rcScenInfoArea; // area in which scenario info is displayed
338  class C4ScenarioListLoader::Folder *pScenarioFolder;
339  class C4ScenarioListLoader::Entry *pSelectedEntry;
340  C4GUI::TextWindow *pSelectionInfoBox;
341  int32_t MinResX, MinResY; // minimum resolution for display of the map
342  bool fUseFullscreenMap;
343  Scenario **ppScenList; int32_t iScenCount;
344  AccessGfx **ppAccessGfxList; int32_t iAccessGfxCount;
345  class C4StartupScenSelDlg *pMainDlg;
346 
347 public:
348  C4MapFolderData() : fCoordinatesAdjusted(false), ppScenList(nullptr), iScenCount(0), ppAccessGfxList(nullptr), iAccessGfxCount(0), pMainDlg(nullptr) {}
350 
351 private:
352  void ConvertFacet2ScreenCoord(const C4Rect &rc, FLOAT_RECT *pfrc, float fBGZoomX, float fBGZoomY, int iOffX, int iOffY);
353  void ConvertFacet2ScreenCoord(int32_t *piValue, float fBGZoom, int iOff);
354  void ConvertFacet2ScreenCoord(C4Rect &rcMapArea, bool fAspect); // adjust coordinates of loaded facets so they match given area
355 
356 protected:
357  void OnButtonScenario(C4GUI::Control *pEl);
358 
359  friend class C4StartupScenSelDlg;
360 
361 public:
362  void Clear();
363  bool Load(C4Group &hGroup, C4ScenarioListLoader::Folder *pScenLoaderFolder);
364  void CompileFunc(StdCompiler *pComp);
365  void CreateGUIElements(C4StartupScenSelDlg *pMainDlg, C4GUI::Window &rContainer);
366  void ResetSelection();
367 
368  C4GUI::TextWindow *GetSelectionInfoBox() const { return pSelectionInfoBox; }
369  C4ScenarioListLoader::Entry *GetSelectedEntry() const { return pSelectedEntry; }
370 };
371 
372 
373 
374 
375 // -----------------------------------------------
376 
377 // startup dialog: Scenario selection
379 {
380 public:
381  // one item in the scenario list
383  {
384  private:
385  typedef C4GUI::Window BaseClass;
386  // subcomponents
387  C4GUI::Picture *pIcon; // item icon
388  C4GUI::Label *pNameLabel; // item caption
389  C4GUI::Picture *ppAchievements[C4StartupScenSel_MaxAchievements]; // achievement icons
390  C4ScenarioListLoader::Entry *pScenListEntry; // associated, loaded item info
391 
392  public:
393  ScenListItem(C4GUI::ListBox *pForListBox, C4ScenarioListLoader::Entry *pForEntry, C4GUI::Element *pInsertBeforeElement=nullptr);
394 
395  protected:
396  struct RenameParams { };
397  void AbortRenaming(RenameParams par);
398  C4GUI::RenameEdit::RenameResult DoRenaming(RenameParams par, const char *szNewName);
399  public:
400  bool KeyRename();
401 
402  protected:
403  virtual void UpdateOwnPos(); // recalculate item positioning
404  void Update() {}
405 
406  public:
407  virtual void MouseInput(C4GUI::CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam);
408  C4ScenarioListLoader::Entry *GetEntry() const { return pScenListEntry; }
409  ScenListItem *GetNext() { return static_cast<ScenListItem *>(BaseClass::GetNext()); }
410 
411  virtual bool CheckNameHotkey(const char * c); // return whether this item can be selected by entering given char
412  };
413 
414 public:
415  C4StartupScenSelDlg(bool fNetwork); // ctor
416  ~C4StartupScenSelDlg(); // dtor
417 
418 private:
419  enum { ShowStyle_Book=0, ShowStyle_Map=1 };
420  enum { IconLabelSpacing = 2 }; // space between an icon and its text
421 
422  // book style scenario selection
423  C4GUI::Label *pScenSelCaption; // caption label atop scenario list; indicating current folder
424  C4GUI::ListBox *pScenSelList; // left page of book: Scenario selection
425  C4GUI::Label *pScenSelProgressLabel; // progress label shown while scenario list is being generated
426  C4GUI::TextWindow *pSelectionInfo; // used to display the description of the current selection
427  class C4GameOptionsList *pSelectionOptions; // displays custom scenario options for selected item below description
428 
429  C4KeyBinding *pKeyRefresh, *pKeyBack, *pKeyForward, *pKeyRename, *pKeyDelete, *pKeyCheat;
430  class C4GameOptionButtons *pGameOptionButtons;
431  C4GUI::Button *pOpenBtn;
432  C4GUI::Tabular *pScenSelStyleTabular;
433 
434  C4ScenarioListLoader *pScenLoader;
435 
436  // map style scenario selection
437  C4MapFolderData *pMapData;
438  C4Facet *pfctBackground;
439 
440  bool fIsInitialLoading;
441  bool fStartNetworkGame;
442 
443  C4GUI::RenameEdit *pRenameEdit;
444 
445  // achievements of all activated players
446  C4ScenarioParameters Achievements;
447 
448 public:
449  static C4StartupScenSelDlg *pInstance; // singleton
450 
451 protected:
452  virtual int32_t GetMarginTop() { return (rcBounds.Hgt/7); }
453  virtual bool HasBackground() { return false; }
454  virtual void DrawElement(C4TargetFacet &cgo);
455 
456  virtual bool OnEnter() { DoOK(); return true; }
457  virtual bool OnEscape() { DoBack(true); return true; }
458  bool KeyBack() { return DoBack(true); }
459  bool KeyRefresh() { DoRefresh(); return true; }
460  bool KeyForward() { DoOK(); return true; }
461  bool KeyRename();
462  bool KeyDelete();
463  bool KeyCheat();
464  void KeyCheat2(const StdStrBuf &rsCheatCode);
465 
466  void DeleteConfirm(ScenListItem *pSel);
467 
468  virtual void OnShown(); // callback when shown: Init file list
469  virtual void OnClosed(bool fOK); // callback when dlg got closed: Return to main screen
470  void OnBackBtn(C4GUI::Control *btn) { DoBack(true); }
471  void OnNextBtn(C4GUI::Control *btn) { DoOK(); }
472  void OnSelChange(class C4GUI::Element *pEl) { UpdateSelection(); }
473  void OnSelDblClick(class C4GUI::Element *pEl) { DoOK(); }
474  void OnButtonScenario(C4GUI::Control *pEl);
475 
476  virtual void OnLeagueOptionChanged();
477 
478  friend class C4MapFolderData;
479 
480 private:
481  void UpdateList();
482  void UpdateSelection();
483  void ResortFolder();
484  ScenListItem *GetSelectedItem();
486  void SetOpenButtonDefaultText();
487  void FocusScenList();
488  void UpdateAchievements();
489 
490 public:
492  bool OpenFolder(C4ScenarioListLoader::Folder *pNewFolder);
493  void ProcessCallback() { UpdateList(); } // process callback by loader
494  bool DoOK(); // open/start currently selected item
495  bool DoBack(bool fAllowClose); // back folder, or abort dialog
496  void DoRefresh(); // refresh file list
497  void DeselectAll(); // reset focus and update selection info
498 
499  void StartRenaming(C4GUI::RenameEdit *pNewRenameEdit);
500  void AbortRenaming();
501  bool IsRenaming() const { return !!pRenameEdit; }
502  void SetRenamingDone() { pRenameEdit=nullptr; }
503 
504  void SetBackground(C4Facet *pNewBG) { pfctBackground=pNewBG; }
505 
506  bool IsNetworkStart() const { return fStartNetworkGame; }
507 
508  friend class ScenListItem;
509 };
510 
511 
512 #endif // INC_C4StartupScenSelDlg
const int32_t C4StartupScenSel_DefaultIcon_WinFolder
const int32_t C4StartupScenSel_TitlePictureWdt
int32_t GetProgressPercent() const
virtual bool GetAchievement(int32_t idx, C4Facet *out_facet, const char **out_description)
virtual void OnLeagueOptionChanged()
bool LoadExtended(Entry *pEntry)
const int32_t C4StartupScenSel_IconCount
virtual bool DoLoadContents(C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf &sFilename, bool fLoadEx)
void OnSelChange(class C4GUI::Element *pEl)
virtual bool DoLoadContents(C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf &sFilename, bool fLoadEx)=0
virtual const C4ScenarioParameterDefs * GetAchievementDefs() const
void StartRenaming(C4GUI::RenameEdit *pNewRenameEdit)
const int32_t C4StartupScenSel_DefaultIcon_OldIconBG
StdCopyStrBuf sAuthor
C4GUI::TextWindow * GetSelectionInfoBox() const
virtual bool IsHidden()
bool StartScenario(C4ScenarioListLoader::Scenario *pStartScen)
virtual bool HasUnregisteredAccess() const
SubFolder(class C4ScenarioListLoader *pLoader, Folder *pParent)
C4GUI::RenameEdit::RenameResult DoRenaming(RenameParams par, const char *szNewName)
void OnSelDblClick(class C4GUI::Element *pEl)
C4ScenarioListLoader(const C4ScenarioParameters &Achievements)
virtual const C4AchievementGraphics * GetAchievementGfx() const
void SetBackground(C4Facet *pNewBG)
virtual bool HasBackground()
Definition: C4Rect.h:29
virtual const char * GetDefaultExtension()
Entry * pNext
RegularFolder(class C4ScenarioListLoader *pLoader, Folder *pParent)
void OnButtonScenario(C4GUI::Control *pEl)
int GetFolderIndex()
const C4Scenario & GetC4S() const
StdCopyStrBuf sDesc
const StdStrBuf & GetAuthor() const
virtual bool IsScenario()
virtual StdStrBuf GetOpenText()=0
virtual ~Entry()
StdCopyStrBuf sName
StdCopyStrBuf sFilename
bool fOK
Definition: C4Gui.h:2082
const StdStrBuf & GetVersion() const
void CreateGUIElements(C4StartupScenSelDlg *pMainDlg, C4GUI::Window &rContainer)
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
virtual const C4ScenarioParameterDefs * GetAchievementDefs() const
const StdStrBuf & GetDesc() const
C4StartupScenSelDlg(bool fNetwork)
int iDifficulty
void KeyCheat2(const StdStrBuf &rsCheatCode)
virtual void DrawElement(C4TargetFacet &cgo)
virtual bool LoadCustomPre(C4Group &rGrp)
virtual C4ScenarioParameterDefs * GetParameterDefs()
const int32_t C4StartupScenSel_TitlePictureHgt
StdCopyStrBuf sVersion
virtual bool CanOpen(StdStrBuf &sError)
const int32_t C4StartupScenSel_TitleOverlayMargin
void CompileFunc(StdCompiler *pComp)
bool DoProcessCallback(int32_t iProgress, int32_t iMaxProgress)
void OnButtonScenario(C4GUI::Control *pEl)
virtual bool LoadCustom(C4Group &rGrp, bool fNameLoaded, bool fIconLoaded)
virtual bool LoadCustom(C4Group &rGrp, bool fNameLoaded, bool fIconLoaded)
C4Rect rcBounds
Definition: C4Gui.h:385
int iIconIndex
virtual StdStrBuf GetTypeName()=0
virtual bool CheckNameHotkey(const char *c)
const int32_t C4StartupScenSel_DefaultIcon_SavegamesFolder
virtual bool SetTitleInGroup(C4Group &rGrp, const char *szNewTitle)
virtual bool DoLoadContents(C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf &sFilename, bool fLoadEx)
const int32_t C4StartupScenSel_TitlePicturePadding
virtual bool HasMissionAccess() const
static Entry * CreateEntryForFile(const StdStrBuf &sFilename, C4ScenarioListLoader *pLoader, Folder *pParent)
virtual const char * GetDefaultExtension()
Folder * GetRootFolder() const
virtual Folder * GetIsFolder()
Entry(class C4ScenarioListLoader *pLoader, class Folder *pParent)
bool DoBack(bool fAllowClose)
virtual StdStrBuf GetOpenTooltip()=0
virtual void MouseInput(C4GUI::CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam)
virtual bool HasMissionAccess() const
virtual bool LoadCustom(C4Group &rGrp, bool fNameLoaded, bool fIconLoaded)
void OnNextBtn(C4GUI::Control *btn)
bool OpenFolder(C4ScenarioListLoader::Folder *pNewFolder)
bool Load(const StdStrBuf &sRootFolder)
C4FacetSurface fctIcon
virtual bool LoadCustom(C4Group &rGrp, bool fNameLoaded, bool fIconLoaded)
class C4MapFolderData * pMapData
bool fBaseLoaded
Element * GetNext() const
Definition: C4Gui.h:449
int32_t GetProgress() const
Entry * GetFirstEntry() const
virtual C4ScenarioParameters * GetParameters()
bool fExLoaded
int32_t GetMaxProgress() const
const int32_t C4StartupScenSel_DefaultIcon_Folder
virtual bool IsGrayed()
class C4ScenarioListLoader * pLoader
Scenario(class C4ScenarioListLoader *pLoader, class Folder *pParent)
class Folder * GetParent() const
virtual bool LoadCustomPre(C4Group &rGrp)
bool LoadContents(C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf *psFilename, bool fLoadEx, bool fReload)
virtual bool CanOpen(StdStrBuf &sError)
const C4Facet & GetTitlePicture() const
bool Secret
Definition: C4Scenario.h:77
ScenListItem(C4GUI::ListBox *pForListBox, C4ScenarioListLoader::Entry *pForEntry, C4GUI::Element *pInsertBeforeElement=nullptr)
void OnBackBtn(C4GUI::Control *btn)
bool IsNetworkStart() const
const StdStrBuf & GetName() const
const int32_t C4StartupScenSel_DefaultIcon_Scenario
virtual void OnClosed(bool fOK)
bool Load(C4Group *pFromGrp, const StdStrBuf *psFilename, bool fLoadEx)
void DeleteConfirm(ScenListItem *pSel)
int32_t Hgt
Definition: C4Rect.h:32
C4ScenarioListLoader::Entry * GetSelectedEntry() const
C4SHead Head
Definition: C4Scenario.h:230
virtual const char * GetDefaultExtension()
C4ScenarioListLoader::Entry * GetEntry() const
const int32_t C4StartupScenSel_MaxAchievements
Folder * GetCurrFolder() const
int GetDifficulty()
Folder(class C4ScenarioListLoader *pLoader, Folder *pParent)
uint32_t DWORD
virtual bool Start()=0
virtual C4ScenarioParameters * GetParameters()
Entry * FindEntryByName(const char *szFilename) const
int iFolderIndex
const C4Facet & GetIconFacet() const
virtual int32_t GetMarginTop()
const StdStrBuf & GetEntryFilename() const
const C4ScenarioParameters & GetAchievements() const
class Folder * pParent
virtual bool LoadCustomPre(C4Group &rGrp)
C4MapFolderData * GetMapData() const
virtual bool GetAchievement(int32_t idx, C4Facet *out_facet, const char **out_description)
virtual bool CanOpen(StdStrBuf &sError)
int GetIconIndex()
bool Load(C4Group &hGroup, C4ScenarioListLoader::Folder *pScenLoaderFolder)
C4FacetSurface fctTitle
bool RenameTo(const char *szNewName)
virtual C4ScenarioParameterDefs * GetParameterDefs()
virtual const C4AchievementGraphics * GetAchievementGfx() const
static C4StartupScenSelDlg * pInstance
Entry * GetNext() const