OpenClonk
C4ScenarioListLoader::RegularFolder Class Reference

#include <C4StartupScenSelDlg.h>

Inheritance diagram for C4ScenarioListLoader::RegularFolder:
[legend]
Collaboration diagram for C4ScenarioListLoader::RegularFolder:
[legend]

Public Member Functions

 RegularFolder (class C4ScenarioListLoader *pLoader, Folder *pParent)
 
 ~RegularFolder () override
 
StdStrBuf GetTypeName () override
 
void Merge (const char *szPath)
 
bool LoadCustomPre (C4Group &rGrp) override
 
bool LoadContents (C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf *psFilename, bool fLoadEx, bool fReload)
 
uint32_t GetEntryCount () const
 
bool Start () override
 
FolderGetIsFolder () override
 
EntryGetFirstEntry () const
 
void Resort ()
 
EntryFindEntryByName (const char *szFilename) const
 
bool CanOpen (StdStrBuf &sError, bool &CanHide) override
 
bool IsGrayed () override
 
StdStrBuf GetOpenText () override
 
StdStrBuf GetOpenTooltip () override
 
C4MapFolderDataGetMapData () const
 
virtual const C4ScenarioParameterDefsGetAchievementDefs () const
 
virtual const C4AchievementGraphicsGetAchievementGfx () const
 
bool Load (C4Group *pFromGrp, const StdStrBuf *psFilename, bool fLoadEx)
 
const StdStrBufGetName () const
 
const StdStrBufGetEntryFilename () const
 
const StdStrBufGetVersion () const
 
const StdStrBufGetAuthor () const
 
const C4FacetGetIconFacet () const
 
const C4FacetGetTitlePicture () const
 
const StdStrBufGetDesc () const
 
int GetIconIndex ()
 
int GetDifficulty ()
 
int GetFolderIndex ()
 
EntryGetNext () const
 
class FolderGetParent () const
 
virtual bool GetAchievement (int32_t idx, C4Facet *out_facet, const char **out_description)
 
virtual bool IsHidden ()
 
virtual bool HasMissionAccess () const
 
virtual bool HasUnregisteredAccess () const
 
virtual const char * GetDefaultExtension ()
 
virtual bool SetTitleInGroup (C4Group &rGrp, const char *szNewTitle)
 
bool RenameTo (const char *szNewName)
 
virtual bool IsScenario ()
 
virtual C4ScenarioParameterDefsGetParameterDefs ()
 
virtual C4ScenarioParametersGetParameters ()
 

Static Public Member Functions

static EntryCreateEntryForFile (const StdStrBuf &sFilename, C4ScenarioListLoader *pLoader, Folder *pParent)
 

Protected Types

typedef std::list< std::string > NameList
 

Protected Member Functions

bool LoadCustom (C4Group &rGrp, bool fNameLoaded, bool fIconLoaded) override
 
bool DoLoadContents (C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf &sFilename, bool fLoadEx) override
 
void ClearChildren ()
 
void Sort ()
 

Protected Attributes

NameList contents
 
C4Folder C4F
 
bool fContentsLoaded
 
EntrypFirst
 
class C4MapFolderDatapMapData
 
class C4ScenarioListLoaderpLoader
 
EntrypNext
 
class FolderpParent
 
StdCopyStrBuf sName
 
StdCopyStrBuf sFilename
 
StdCopyStrBuf sDesc
 
StdCopyStrBuf sVersion
 
StdCopyStrBuf sAuthor
 
C4FacetSurface fctIcon
 
C4FacetSurface fctTitle
 
bool fBaseLoaded
 
bool fExLoaded
 
int iIconIndex
 
int iDifficulty
 
int iFolderIndex
 

Detailed Description

Definition at line 213 of file C4StartupScenSelDlg.h.

Member Typedef Documentation

◆ NameList

typedef std::list<std::string> C4ScenarioListLoader::RegularFolder::NameList
protected

Definition at line 227 of file C4StartupScenSelDlg.h.

Constructor & Destructor Documentation

◆ RegularFolder()

C4ScenarioListLoader::RegularFolder::RegularFolder ( class C4ScenarioListLoader pLoader,
Folder pParent 
)
inline

Definition at line 216 of file C4StartupScenSelDlg.h.

216 : Folder(pLoader, pParent) {}
class C4ScenarioListLoader * pLoader
Folder(class C4ScenarioListLoader *pLoader, Folder *pParent)
class Folder * pParent

◆ ~RegularFolder()

C4ScenarioListLoader::RegularFolder::~RegularFolder ( )
overridedefault

Referenced by C4ScenarioListLoader::SubFolder::DoLoadContents().

Here is the caller graph for this function:

Member Function Documentation

◆ CanOpen()

bool C4ScenarioListLoader::Folder::CanOpen ( StdStrBuf sError,
bool &  CanHide 
)
inlineoverridevirtualinherited

Reimplemented from C4ScenarioListLoader::Entry.

Definition at line 179 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::GetOpenText(), C4ScenarioListLoader::Entry::GetOpenTooltip(), and C4ScenarioListLoader::Entry::IsGrayed().

179 { return true; } // can always open folders
Here is the call graph for this function:

◆ ClearChildren()

void C4ScenarioListLoader::Folder::ClearChildren ( )
protectedinherited

Definition at line 917 of file C4StartupScenSelDlg.cpp.

References C4ScenarioListLoader::Entry::GetIsFolder(), C4ScenarioListLoader::Folder::pFirst, and C4ScenarioListLoader::Entry::pParent.

918 {
919  // folder deletion: del all the tree non-recursively
920  Folder *pDelFolder = this, *pCheckFolder;
921  for (;;)
922  {
923  // delete all children as long as they are not folders
924  Entry *pChild;
925  while ((pChild = pDelFolder->pFirst))
926  if ((pCheckFolder = pChild->GetIsFolder()))
927  // child entry if folder: Continue delete in there
928  pDelFolder = pCheckFolder;
929  else
930  // regular child entry: del it
931  // destructor of child will remove it from list
932  delete pChild;
933  // this emptied: Done!
934  if (pDelFolder == this) break;
935  // deepest child recursion reached: Travel up folders
936  pDelFolder = (pCheckFolder = pDelFolder)->pParent;
937  assert(pDelFolder);
938  delete pCheckFolder;
939  }
940 }
Folder(class C4ScenarioListLoader *pLoader, Folder *pParent)
class Folder * pParent
Here is the call graph for this function:

◆ CreateEntryForFile()

C4ScenarioListLoader::Entry * C4ScenarioListLoader::Entry::CreateEntryForFile ( const StdStrBuf sFilename,
C4ScenarioListLoader pLoader,
Folder pParent 
)
staticinherited

Definition at line 549 of file C4StartupScenSelDlg.cpp.

References C4CFN_FolderFiles, C4CFN_ScenarioFiles, DirContainsScenarios(), DirectoryExists(), StdStrBuf::getData(), GetExtension(), and WildcardMatch().

Referenced by C4ScenarioListLoader::SubFolder::DoLoadContents(), DoLoadContents(), and C4ScenarioListLoader::Entry::GetAchievement().

550 {
551  // determine entry type by file type
552  const char *szFilename = sFilename.getData();
553  if (!szFilename || !*szFilename) return nullptr;
554  if (WildcardMatch(C4CFN_ScenarioFiles, sFilename.getData())) return new Scenario(pLoader, pParent);
555  if (WildcardMatch(C4CFN_FolderFiles, sFilename.getData())) return new SubFolder(pLoader, pParent);
556  // regular, open folder (C4Group-packed folders without extensions are not regarded, because they could contain anything!)
557  const char *szExt = GetExtension(szFilename);
558  if ((!szExt || !*szExt) && DirectoryExists(sFilename.getData()))
559  {
560  // open folders only if they contain a scenario or folder
561  if (DirContainsScenarios(szFilename))
562  return new RegularFolder(pLoader, pParent);
563  }
564  // type not recognized
565  return nullptr;
566 }
#define C4CFN_FolderFiles
Definition: C4Components.h:176
bool DirContainsScenarios(const char *szDir)
char * GetExtension(char *szFilename)
Definition: StdFile.cpp:121
const char * getData() const
Definition: StdBuf.h:442
bool DirectoryExists(const char *szFilename)
Definition: StdFile.cpp:684
bool WildcardMatch(const char *szWildcard, const char *szString)
Definition: StdFile.cpp:374
#define C4CFN_ScenarioFiles
Definition: C4Components.h:175
class Folder * pParent
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoLoadContents()

bool C4ScenarioListLoader::RegularFolder::DoLoadContents ( C4ScenarioListLoader pLoader,
C4Group pFromGrp,
const StdStrBuf sFilename,
bool  fLoadEx 
)
overrideprotectedvirtual

Implements C4ScenarioListLoader::Folder.

Definition at line 1104 of file C4StartupScenSelDlg.cpp.

References C4Group_TestIgnore(), C4ScenarioListLoader::Entry::CreateEntryForFile(), DebugLogF(), DirectoryExists(), C4ScenarioListLoader::DoProcessCallback(), StdStrBuf::getData(), GetFilename(), and C4ScenarioListLoader::Entry::Load().

1105 {
1106  // clear any previous
1107  ClearChildren();
1108  // regular folders must exist and not be within group!
1109  assert(!pFromGrp);
1110  if (sFilename.getData() && sFilename[0])
1111  Merge(sFilename.getData());
1112 
1113  // get number of entries, to estimate progress
1114  int32_t iCountLoaded=0, iCountTotal=0;
1115  NameList::iterator it;
1116  for (it = contents.begin(); it != contents.end(); ++it)
1117  {
1118  if (!DirectoryExists(it->c_str())) continue;
1119  DirectoryIterator DirIter(it->c_str());
1120  const char *szChildFilename;
1121  for (; (szChildFilename = *DirIter); ++DirIter)
1122  {
1123  if (!*szChildFilename || *GetFilename(szChildFilename)=='.') continue;
1124  ++iCountTotal;
1125  }
1126  }
1127  // initial progress estimate
1128  if (!pLoader->DoProcessCallback(iCountLoaded, iCountTotal, nullptr)) return false;
1129 
1130  // do actual loading of files
1131  std::set<std::string> names;
1132  const char *szChildFilename;
1133  for (it = contents.begin(); it != contents.end(); ++it)
1134  {
1135  if (!pLoader->DoProcessCallback(iCountLoaded, iCountTotal, GetFilename(it->c_str()))) return false;
1136  for (DirectoryIterator DirIter(it->c_str()); (szChildFilename = *DirIter); ++DirIter)
1137  {
1138  StdStrBuf sChildFilename(szChildFilename);
1139  szChildFilename = GetFilename(szChildFilename);
1140  // progress callback
1141  if (!pLoader->DoProcessCallback(iCountLoaded, iCountTotal, szChildFilename)) return false;
1142  // Ignore directory navigation entries and CVS folders
1143  if (C4Group_TestIgnore(szChildFilename)) continue;
1144  if (names.find(szChildFilename) != names.end()) continue;
1145  names.insert(szChildFilename);
1146  // filename okay; create this item
1147  Entry *pNewEntry = Entry::CreateEntryForFile(sChildFilename, pLoader, this);
1148  if (pNewEntry)
1149  {
1150  // ...and load it
1151  if (!pNewEntry->Load(nullptr, &sChildFilename, fLoadEx))
1152  {
1153  DebugLogF(R"(Error loading entry "%s" in Folder "%s"!)", szChildFilename, it->c_str());
1154  delete pNewEntry;
1155  }
1156  }
1157  ++iCountLoaded;
1158  }
1159  }
1160  // done, success
1161  fContentsLoaded = true;
1162  return true;
1163 }
char * GetFilename(char *szPath)
Definition: StdFile.cpp:45
bool DoProcessCallback(int32_t iProgress, int32_t iMaxProgress, const char *current_load_info)
static Entry * CreateEntryForFile(const StdStrBuf &sFilename, C4ScenarioListLoader *pLoader, Folder *pParent)
const char * getData() const
Definition: StdBuf.h:442
bool DirectoryExists(const char *szFilename)
Definition: StdFile.cpp:684
bool C4Group_TestIgnore(const char *szFilename)
Definition: C4Group.cpp:85
bool DebugLogF(const char *strMessage ...)
Definition: C4Log.cpp:288
Here is the call graph for this function:

◆ FindEntryByName()

C4ScenarioListLoader::Entry * C4ScenarioListLoader::Folder::FindEntryByName ( const char *  szFilename) const
inherited

Definition at line 957 of file C4StartupScenSelDlg.cpp.

References GetFilename(), C4ScenarioListLoader::Entry::GetNext(), and SEqualNoCase().

Referenced by C4MapFolderData::Load().

958 {
959  // do a case-insensitive filename comparison
960  for (Entry *pEntry = pFirst; pEntry; pEntry = pEntry->GetNext())
961  if (SEqualNoCase(szFilename, GetFilename(pEntry->GetEntryFilename().getData())))
962  return pEntry;
963  // nothing found
964  return nullptr;
965 }
char * GetFilename(char *szPath)
Definition: StdFile.cpp:45
bool SEqualNoCase(const char *szStr1, const char *szStr2, int iLen)
Definition: Standard.cpp:207
Entry * GetNext() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAchievement()

virtual bool C4ScenarioListLoader::Entry::GetAchievement ( int32_t  idx,
C4Facet out_facet,
const char **  out_description 
)
inlinevirtualinherited

Reimplemented in C4ScenarioListLoader::Scenario.

Definition at line 87 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::CreateEntryForFile().

Referenced by C4ScenarioListLoader::Scenario::GetC4S(), and C4StartupScenSelDlg::ScenListItem::ScenListItem().

87 { return false; } // return true and fill output parameters if player got the indexed achievement
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAchievementDefs()

virtual const C4ScenarioParameterDefs* C4ScenarioListLoader::Folder::GetAchievementDefs ( ) const
inlinevirtualinherited

Reimplemented in C4ScenarioListLoader::SubFolder.

Definition at line 185 of file C4StartupScenSelDlg.h.

Referenced by C4ScenarioListLoader::Scenario::LoadCustomPre().

185 { return nullptr; }
Here is the caller graph for this function:

◆ GetAchievementGfx()

virtual const C4AchievementGraphics* C4ScenarioListLoader::Folder::GetAchievementGfx ( ) const
inlinevirtualinherited

Reimplemented in C4ScenarioListLoader::SubFolder.

Definition at line 186 of file C4StartupScenSelDlg.h.

Referenced by C4ScenarioListLoader::Scenario::LoadCustomPre().

186 { return nullptr; }
Here is the caller graph for this function:

◆ GetAuthor()

const StdStrBuf& C4ScenarioListLoader::Entry::GetAuthor ( ) const
inlineinherited

Definition at line 77 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::sAuthor.

Referenced by C4StartupScenSelDlg::OnClosed().

77 { return sAuthor; }
StdCopyStrBuf sAuthor
Here is the caller graph for this function:

◆ GetDefaultExtension()

virtual const char* C4ScenarioListLoader::Entry::GetDefaultExtension ( )
inlinevirtualinherited

Reimplemented in C4ScenarioListLoader::SubFolder, and C4ScenarioListLoader::Scenario.

Definition at line 99 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::RenameTo(), and C4ScenarioListLoader::Entry::SetTitleInGroup().

Referenced by C4ScenarioListLoader::Entry::RenameTo().

99 { return nullptr; } // extension to be added when item is renamed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDesc()

const StdStrBuf& C4ScenarioListLoader::Entry::GetDesc ( ) const
inlineinherited

Definition at line 80 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::sDesc.

Referenced by C4StartupScenSelDlg::OnClosed().

80 { return sDesc; }
StdCopyStrBuf sDesc
Here is the caller graph for this function:

◆ GetDifficulty()

int C4ScenarioListLoader::Entry::GetDifficulty ( )
inlineinherited

Definition at line 82 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::iDifficulty.

Referenced by EntrySortFunc().

Here is the caller graph for this function:

◆ GetEntryCount()

uint32_t C4ScenarioListLoader::Folder::GetEntryCount ( ) const
inherited

Definition at line 896 of file C4StartupScenSelDlg.cpp.

References C4ScenarioListLoader::Entry::pNext.

897 {
898  uint32_t iCount = 0;
899  for (Entry *i = pFirst; i; i = i->pNext) ++iCount;
900  return iCount;
901 }
Entry * pNext

◆ GetEntryFilename()

const StdStrBuf& C4ScenarioListLoader::Entry::GetEntryFilename ( ) const
inlineinherited

Definition at line 75 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::sFilename.

Referenced by C4StartupScenSelDlg::DeleteConfirm(), C4StartupScenSelDlg::KeyDelete(), and C4StartupScenSelDlg::StartScenario().

75 { return sFilename; }
StdCopyStrBuf sFilename
Here is the caller graph for this function:

◆ GetFirstEntry()

Entry* C4ScenarioListLoader::Folder::GetFirstEntry ( ) const
inlineinherited

Definition at line 175 of file C4StartupScenSelDlg.h.

Referenced by C4ScenarioListLoader::GetFirstEntry().

175 { return pFirst; }
Here is the caller graph for this function:

◆ GetFolderIndex()

int C4ScenarioListLoader::Entry::GetFolderIndex ( )
inlineinherited

Definition at line 83 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::iFolderIndex.

Referenced by EntrySortFunc().

Here is the caller graph for this function:

◆ GetIconFacet()

const C4Facet& C4ScenarioListLoader::Entry::GetIconFacet ( ) const
inlineinherited

Definition at line 78 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::fctIcon.

Referenced by C4StartupScenSelDlg::ScenListItem::ScenListItem().

78 { return fctIcon; }
C4FacetSurface fctIcon
Here is the caller graph for this function:

◆ GetIconIndex()

int C4ScenarioListLoader::Entry::GetIconIndex ( )
inlineinherited

Definition at line 81 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::iIconIndex.

Referenced by EntrySortFunc().

Here is the caller graph for this function:

◆ GetIsFolder()

Folder* C4ScenarioListLoader::Folder::GetIsFolder ( )
inlineoverridevirtualinherited

Reimplemented from C4ScenarioListLoader::Entry.

Definition at line 174 of file C4StartupScenSelDlg.h.

Referenced by EntrySortFunc().

174 { return this; } // this is a folder
Here is the caller graph for this function:

◆ GetMapData()

C4MapFolderData* C4ScenarioListLoader::Folder::GetMapData ( ) const
inlineinherited

Definition at line 183 of file C4StartupScenSelDlg.h.

Referenced by C4StartupScenSelDlg::OnClosed().

183 { return pMapData; }
class C4MapFolderData * pMapData
Here is the caller graph for this function:

◆ GetName()

const StdStrBuf& C4ScenarioListLoader::Entry::GetName ( ) const
inlineinherited

Definition at line 74 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::sName.

Referenced by C4StartupScenSelDlg::ScenListItem::CheckNameHotkey(), EntrySortFunc(), C4StartupScenSelDlg::KeyDelete(), C4StartupScenSelDlg::OnClosed(), and C4StartupScenSelDlg::ScenListItem::ScenListItem().

74 { return sName; }
StdCopyStrBuf sName
Here is the caller graph for this function:

◆ GetNext()

Entry* C4ScenarioListLoader::Entry::GetNext ( ) const
inlineinherited

Definition at line 84 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::pNext.

Referenced by C4ScenarioListLoader::Folder::FindEntryByName(), and C4StartupScenSelDlg::OnClosed().

84 { return pNext; }
Entry * pNext
Here is the caller graph for this function:

◆ GetOpenText()

StdStrBuf C4ScenarioListLoader::Folder::GetOpenText ( )
overridevirtualinherited

Implements C4ScenarioListLoader::Entry.

Definition at line 967 of file C4StartupScenSelDlg.cpp.

References LoadResStr().

968 {
969  return StdCopyStrBuf(LoadResStr("IDS_BTN_OPEN"));
970 }
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
Here is the call graph for this function:

◆ GetOpenTooltip()

StdStrBuf C4ScenarioListLoader::Folder::GetOpenTooltip ( )
overridevirtualinherited

Implements C4ScenarioListLoader::Entry.

Definition at line 972 of file C4StartupScenSelDlg.cpp.

References LoadResStr().

973 {
974  return StdCopyStrBuf(LoadResStr("IDS_DLGTIP_SCENSELNEXT"));
975 }
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
Here is the call graph for this function:

◆ GetParameterDefs()

virtual C4ScenarioParameterDefs* C4ScenarioListLoader::Entry::GetParameterDefs ( )
inlinevirtualinherited

Reimplemented in C4ScenarioListLoader::Scenario.

Definition at line 104 of file C4StartupScenSelDlg.h.

Referenced by C4StartupScenSelDlg::OnClosed().

104 { return nullptr; }
Here is the caller graph for this function:

◆ GetParameters()

virtual C4ScenarioParameters* C4ScenarioListLoader::Entry::GetParameters ( )
inlinevirtualinherited

Reimplemented in C4ScenarioListLoader::Scenario.

Definition at line 105 of file C4StartupScenSelDlg.h.

Referenced by C4StartupScenSelDlg::OnClosed().

105 { return nullptr; }
Here is the caller graph for this function:

◆ GetParent()

class Folder* C4ScenarioListLoader::Entry::GetParent ( ) const
inlineinherited

Definition at line 85 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::GetTypeName(), and C4ScenarioListLoader::Entry::pParent.

Referenced by C4ScenarioListLoader::FolderBack().

85 { return pParent; }
class Folder * pParent
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTitlePicture()

const C4Facet& C4ScenarioListLoader::Entry::GetTitlePicture ( ) const
inlineinherited

Definition at line 79 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::fctTitle.

Referenced by C4StartupScenSelDlg::OnClosed().

79 { return fctTitle; }
C4FacetSurface fctTitle
Here is the caller graph for this function:

◆ GetTypeName()

StdStrBuf C4ScenarioListLoader::RegularFolder::GetTypeName ( )
inlineoverridevirtual

Implements C4ScenarioListLoader::Entry.

Definition at line 219 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::LoadCustom(), LoadResStr(), C4ScenarioListLoader::Entry::pLoader, and C4ScenarioListLoader::Entry::sFilename.

219 { return StdCopyStrBuf(LoadResStr("IDS_TYPE_DIRECTORY"), true); }
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
Here is the call graph for this function:

◆ GetVersion()

const StdStrBuf& C4ScenarioListLoader::Entry::GetVersion ( ) const
inlineinherited

Definition at line 76 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::sVersion.

Referenced by C4StartupScenSelDlg::OnClosed().

76 { return sVersion; }
StdCopyStrBuf sVersion
Here is the caller graph for this function:

◆ HasMissionAccess()

virtual bool C4ScenarioListLoader::Entry::HasMissionAccess ( ) const
inlinevirtualinherited

Reimplemented in C4ScenarioListLoader::Scenario.

Definition at line 94 of file C4StartupScenSelDlg.h.

Referenced by C4ScenarioListLoader::Scenario::CanOpen(), and C4ScenarioListLoader::Scenario::IsHidden().

94 { return true; }
Here is the caller graph for this function:

◆ HasUnregisteredAccess()

virtual bool C4ScenarioListLoader::Entry::HasUnregisteredAccess ( ) const
inlinevirtualinherited

Definition at line 95 of file C4StartupScenSelDlg.h.

References C4ScenarioListLoader::Entry::GetOpenText(), and C4ScenarioListLoader::Entry::GetOpenTooltip().

95 { return false; }
Here is the call graph for this function:

◆ IsGrayed()

bool C4ScenarioListLoader::Folder::IsGrayed ( )
overridevirtualinherited

Reimplemented from C4ScenarioListLoader::Entry.

Definition at line 977 of file C4StartupScenSelDlg.cpp.

978 {
979  return false;
980 }

◆ IsHidden()

virtual bool C4ScenarioListLoader::Entry::IsHidden ( )
inlinevirtualinherited

Reimplemented in C4ScenarioListLoader::Scenario.

Definition at line 93 of file C4StartupScenSelDlg.h.

93 { return false; } // condition for hiding element completely

◆ IsScenario()

virtual bool C4ScenarioListLoader::Entry::IsScenario ( )
inlinevirtualinherited

Reimplemented in C4ScenarioListLoader::Scenario.

Definition at line 102 of file C4StartupScenSelDlg.h.

Referenced by C4ScenarioListLoader::Entry::SetTitleInGroup().

102 { return false; }
Here is the caller graph for this function:

◆ Load()

bool C4ScenarioListLoader::Entry::Load ( C4Group pFromGrp,
const StdStrBuf psFilename,
bool  fLoadEx 
)
inherited

Definition at line 431 of file C4StartupScenSelDlg.cpp.

References C4CFN_IconPNG, C4CFN_ScenarioDesc, C4CFN_ScenarioIcon, C4CFN_ScenarioTitle, C4CFN_Title, C4CFN_Version, C4FCT_Full, C4StartupScenSel_DefaultIcon_OldIconBG, C4FacetSurface::Clear(), Config, StdStrBuf::Copy(), C4FacetSurface::Create(), C4Facet::Draw(), C4ScenarioListLoader::Entry::fBaseLoaded, C4ScenarioListLoader::Entry::fctIcon, C4StartupGraphics::fctScenSelIcons, C4ScenarioListLoader::Entry::fctTitle, C4ScenarioListLoader::Entry::fExLoaded, C4Group::FindEntry(), C4Config::General, C4Startup::Get(), C4ComponentHost::GetData(), StdStrBuf::getData(), GetFilename(), C4Group::GetFullName(), C4ComponentHost::GetLanguageString(), C4Facet::GetPhase(), C4Surface::GetPixDw(), StdStrBuf::GrabPointer(), C4Startup::Graphics, C4Facet::Hgt, C4ConfigGeneral::LanguageEx, C4FacetSurface::Load(), C4Language::LoadComponentHost(), C4ScenarioListLoader::Entry::LoadCustom(), C4ScenarioListLoader::Entry::LoadCustomPre(), C4Group::LoadEntryString(), C4Surface::Lock(), C4Group::Open(), C4Group::OpenAsChild(), RemoveExtension(), C4ScenarioListLoader::Entry::sDesc, C4Surface::SetPixDw(), C4ScenarioListLoader::Entry::sFilename, C4ScenarioListLoader::Entry::sName, C4Facet::Surface, C4ScenarioListLoader::Entry::sVersion, StdStrBuf::Take(), C4Surface::Unlock(), and C4Facet::Wdt.

Referenced by C4ScenarioListLoader::SubFolder::DoLoadContents(), DoLoadContents(), C4ScenarioListLoader::Scenario::LoadCustomPre(), and C4ScenarioListLoader::LoadExtended().

432 {
433  // nothing to do if already loaded
434  if (fBaseLoaded && (fExLoaded || !fLoadEx)) return true;
435  C4Group Group;
436  // group specified: Load as child
437  if (pFromGrp)
438  {
439  assert(psFilename);
440  if (!Group.OpenAsChild(pFromGrp, psFilename->getData())) return false;
441  // set FN by complete entry name
442  this->sFilename.Take(Group.GetFullName());
443  }
444  else
445  {
446  // set FN by complete entry name
447  if (psFilename) this->sFilename.Copy(*psFilename);
448  // no parent group: Direct load from filename
449  if (!Group.Open(sFilename.getData())) return false;
450  }
451  // okay; load standard stuff from group
452  bool fNameLoaded=false, fIconLoaded=false;
453  if (fBaseLoaded)
454  {
455  fNameLoaded = fIconLoaded = true;
456  }
457  else
458  {
459  // Set default name as filename without extension
461  char *szBuf = sName.GrabPointer();
462  RemoveExtension(szBuf);
463  sName.Take(szBuf);
464  // load entry specific stuff that's in the front of the group
465  if (!LoadCustomPre(Group))
466  return false;
467  // Load entry name
468  C4ComponentHost DefNames;
471  fNameLoaded = true;
472  // load entry icon
473  if (Group.FindEntry(C4CFN_IconPNG) && fctIcon.Load(Group, C4CFN_IconPNG, C4FCT_Full, C4FCT_Full, false, 0))
474  fIconLoaded = true;
475  else
476  {
477  C4FacetSurface fctTemp;
478  if (Group.FindEntry(C4CFN_ScenarioIcon) && fctTemp.Load(Group, C4CFN_ScenarioIcon, C4FCT_Full, C4FCT_Full, true, 0))
479  {
480  // old style icon: Blit it on a pieace of paper
481  fctTemp.Surface->Lock();
482  for (int y=0; y<fctTemp.Hgt; ++y)
483  for (int x=0; x<fctTemp.Wdt; ++x)
484  {
485  uint32_t dwPix = fctTemp.Surface->GetPixDw(x,y, false);
486  // transparency has some tolerance...
487  if (Inside<uint8_t>(dwPix & 0xff, 0xb8, 0xff))
488  if (Inside<uint8_t>((dwPix>>0x08) & 0xff, 0x00, 0x0f))
489  if (Inside<uint8_t>((dwPix>>0x10) & 0xff, 0xb8, 0xff))
490  fctTemp.Surface->SetPixDw(x,y,0x00ffffff);
491  }
492  fctTemp.Surface->Unlock();
493  int iIconSize = C4Startup::Get()->Graphics.fctScenSelIcons.Hgt;
494  fctIcon.Create(iIconSize, iIconSize, C4FCT_Full, C4FCT_Full);
496  fctTemp.Draw(fctIcon.Surface, (fctIcon.Wdt-fctTemp.Wdt)/2, (fctIcon.Hgt-fctTemp.Hgt)/2);
497  fctTemp.Clear();
498  fIconLoaded = true;
499  }
500  }
501  // load any entryx-type-specific custom data (e.g. fallbacks for scenario title, and icon)
502  if (!LoadCustom(Group, fNameLoaded, fIconLoaded)) return false;
503  fBaseLoaded = true;
504  }
505  // load extended stuff: title picture
506  if (fLoadEx && !fExLoaded)
507  {
508  // load desc
509  C4ComponentHost DefDesc;
511  {
512  sDesc.Copy(DefDesc.GetData());
513  }
514  // load title
516  fExLoaded = true;
517  // load version
519  }
520  // done, success
521  return true;
522 }
char * GetFilename(char *szPath)
Definition: StdFile.cpp:45
bool FindEntry(const char *szWildCard, StdStrBuf *sFileName=nullptr, size_t *iSize=nullptr)
Definition: C4Group.cpp:1774
const char * GetData() const
C4Config Config
Definition: C4Config.cpp:833
char * GrabPointer()
Definition: StdBuf.h:459
const int32_t C4StartupScenSel_DefaultIcon_OldIconBG
C4ConfigGeneral General
Definition: C4Config.h:251
bool Load(C4Group &hGroup, const char *szName, int iWdt, int iHgt, bool fNoErrIfNotFound, int iFlags)
Definition: C4FacetEx.cpp:78
bool Lock()
Definition: C4Surface.cpp:453
bool Unlock()
Definition: C4Surface.cpp:464
#define C4CFN_Version
Definition: C4Components.h:72
StdCopyStrBuf sDesc
C4FacetID fctScenSelIcons
Definition: C4Startup.h:73
StdCopyStrBuf sName
StdCopyStrBuf sFilename
bool GetLanguageString(const char *szLanguage, StdStrBuf &rTarget)
static bool LoadComponentHost(C4ComponentHost *host, C4Group &hGroup, const char *szFilename, const char *szLanguage)
Definition: C4Language.cpp:232
StdStrBuf GetFullName() const
Definition: C4Group.cpp:2078
#define C4CFN_Title
Definition: C4Components.h:82
StdCopyStrBuf sVersion
bool SetPixDw(int iX, int iY, DWORD dwCol)
Definition: C4Surface.cpp:576
bool Open(const char *szGroupName, bool fCreate=false)
Definition: C4Group.cpp:514
virtual bool LoadCustom(C4Group &rGrp, bool fNameLoaded, bool fIconLoaded)
void Take(char *pnData)
Definition: StdBuf.h:457
void Draw(C4Facet &cgo, bool fAspect=true, int32_t iPhaseX=0, int32_t iPhaseY=0, bool fTransparent=true)
Definition: C4Facet.cpp:154
DWORD GetPixDw(int iX, int iY, bool fApplyModulation)
Definition: C4Surface.cpp:491
char LanguageEx[CFG_MaxString+1]
Definition: C4Config.h:37
const char * getData() const
Definition: StdBuf.h:442
void RemoveExtension(char *szFilename)
Definition: StdFile.cpp:306
C4FacetSurface fctIcon
bool fBaseLoaded
bool fExLoaded
bool LoadEntryString(const char *szEntryName, StdStrBuf *Buf)
Definition: C4Group.cpp:1932
#define C4CFN_IconPNG
Definition: C4Components.h:86
float Hgt
Definition: C4Facet.h:118
#define C4CFN_ScenarioDesc
Definition: C4Components.h:88
bool Create(int iWdt, int iHgt, int iWdt2=C4FCT_Full, int iHgt2=C4FCT_Full)
Definition: C4FacetEx.cpp:54
static C4Startup * Get()
Definition: C4Startup.h:145
C4Surface * Surface
Definition: C4Facet.h:117
const int C4FCT_Full
Definition: C4FacetEx.h:26
#define C4CFN_ScenarioIcon
Definition: C4Components.h:85
void Copy()
Definition: StdBuf.h:467
float Wdt
Definition: C4Facet.h:118
C4Facet GetPhase(int iPhaseX=0, int iPhaseY=0)
Definition: C4Facet.cpp:59
C4StartupGraphics Graphics
Definition: C4Startup.h:112
void Clear()
Definition: C4FacetEx.h:44
#define C4CFN_ScenarioTitle
Definition: C4Components.h:84
bool OpenAsChild(C4Group *pMother, const char *szEntryName, bool fExclusive=false, bool fCreate=false)
Definition: C4Group.cpp:1585
virtual bool LoadCustomPre(C4Group &rGrp)
C4FacetSurface fctTitle
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadContents()

bool C4ScenarioListLoader::Folder::LoadContents ( C4ScenarioListLoader pLoader,
C4Group pFromGrp,
const StdStrBuf psFilename,
bool  fLoadEx,
bool  fReload 
)
inherited

Definition at line 942 of file C4StartupScenSelDlg.cpp.

References C4ScenarioListLoader::Entry::sFilename.

Referenced by C4ScenarioListLoader::Load().

943 {
944  // contents already loaded?
945  if (fContentsLoaded && !fReload) return true;
946  // clear previous
947  if (pMapData) { delete pMapData; pMapData = nullptr; }
948  // if filename is not given, assume it's been loaded in this entry
949  if (!psFilename) psFilename = &this->sFilename; else this->sFilename = *psFilename;
950  // nothing loaded: Load now
951  if (!DoLoadContents(pLoader, pFromGrp, *psFilename, fLoadEx)) return false;
952  // sort loaded stuff by name
953  Sort();
954  return true;
955 }
virtual bool DoLoadContents(C4ScenarioListLoader *pLoader, C4Group *pFromGrp, const StdStrBuf &sFilename, bool fLoadEx)=0
StdCopyStrBuf sFilename
class C4MapFolderData * pMapData
Here is the caller graph for this function:

◆ LoadCustom()

bool C4ScenarioListLoader::RegularFolder::LoadCustom ( C4Group rGrp,
bool  fNameLoaded,
bool  fIconLoaded 
)
overrideprotectedvirtual

Reimplemented from C4ScenarioListLoader::Entry.

Definition at line 1094 of file C4StartupScenSelDlg.cpp.

References C4StartupScenSel_DefaultIcon_WinFolder, C4ScenarioListLoader::Entry::fctIcon, C4Startup::Get(), C4ScenarioListLoader::Entry::iFolderIndex, and C4FacetSurface::Set().

1095 {
1096  // default icon fallback
1097  if (!fIconLoaded)
1098  fctIcon.Set(C4Startup::Get()->Graphics.fctScenSelIcons.GetSection(C4StartupScenSel_DefaultIcon_WinFolder));
1099  // folder index
1101  return true;
1102 }
C4FolderHead Head
Definition: C4Folder.h:36
const int32_t C4StartupScenSel_DefaultIcon_WinFolder
void Set(const C4Facet &cpy)
Definition: C4FacetEx.h:46
C4FacetSurface fctIcon
static C4Startup * Get()
Definition: C4Startup.h:145
int iFolderIndex
int32_t Index
Definition: C4Folder.h:25
Here is the call graph for this function:

◆ LoadCustomPre()

bool C4ScenarioListLoader::Folder::LoadCustomPre ( C4Group rGrp)
overridevirtualinherited

Reimplemented from C4ScenarioListLoader::Entry.

Definition at line 982 of file C4StartupScenSelDlg.cpp.

References C4CFN_FolderCore, DirSep, C4Group::GetFullName(), and C4Group::LoadEntryString().

983 {
984  // load folder core if available
985  StdStrBuf sFileContents;
986  if (rGrp.LoadEntryString(C4CFN_FolderCore, &sFileContents))
987  if (!CompileFromBuf_LogWarn<StdCompilerINIRead>(C4F, sFileContents, (rGrp.GetFullName() + DirSep C4CFN_FolderCore).getData()))
988  return false;
989  return true;
990 }
#define C4CFN_FolderCore
Definition: C4Components.h:44
StdStrBuf GetFullName() const
Definition: C4Group.cpp:2078
bool LoadEntryString(const char *szEntryName, StdStrBuf *Buf)
Definition: C4Group.cpp:1932
#define DirSep
Here is the call graph for this function:

◆ Merge()

void C4ScenarioListLoader::RegularFolder::Merge ( const char *  szPath)

Definition at line 1165 of file C4StartupScenSelDlg.cpp.

Referenced by C4ScenarioListLoader::Load().

1166 {
1167  contents.emplace_back(szPath);
1168 }
Here is the caller graph for this function:

◆ RenameTo()

bool C4ScenarioListLoader::Entry::RenameTo ( const char *  szNewName)
inherited

Definition at line 568 of file C4StartupScenSelDlg.cpp.

References _MAX_PATH, C4GUI::MessageDialog::btnOK, C4CFN_Title, C4Group_IsGroup(), C4Group_MoveItem(), C4Group::Close(), StdStrBuf::Copy(), C4Group::Delete(), StdStrBuf::Format(), StdStrBuf::getData(), C4ScenarioListLoader::Entry::GetDefaultExtension(), C4Group::GetError(), GetFilename(), C4GUI::Ico_Error, ItemExists(), ItemIdentical(), LoadResStr(), MakeFilenameFromTitle(), C4Group::Open(), pGUI, SAppend(), SCopy(), SEqual(), C4ScenarioListLoader::Entry::SetTitleInGroup(), C4ScenarioListLoader::Entry::sFilename, C4GUI::Screen::ShowMessageModal(), and C4ScenarioListLoader::Entry::sName.

Referenced by C4ScenarioListLoader::Entry::GetDefaultExtension().

569 {
570  // change name+filename
571  // some name sanity validation
572  if (!szNewName || !*szNewName) return false;
573  if (SEqual(szNewName, sName.getData())) return true;
574  char fn[_MAX_PATH+1];
575  SCopy(szNewName, fn, _MAX_PATH);
576  // generate new file name
578  if (!*fn) return false;
579  const char *szExt = GetDefaultExtension();
580  if (szExt) { SAppend(".", fn, _MAX_PATH); SAppend(szExt, fn, _MAX_PATH); }
581  char fullfn[_MAX_PATH+1];
582  SCopy(sFilename.getData(), fullfn, _MAX_PATH);
583  char *fullfn_fn = GetFilename(fullfn);
584  SCopy(fn, fullfn_fn, _MAX_PATH - (fullfn_fn - fullfn));
585  StdCopyStrBuf strErr(LoadResStr("IDS_FAIL_RENAME"));
586  // check if a rename is due
587  if (!ItemIdentical(sFilename.getData(), fullfn))
588  {
589  // check for duplicate filename
590  if (ItemExists(fullfn))
591  {
592  StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_FILEEXISTS"), fullfn);
594  return false;
595  }
596  // OK; then rename
597  if (!C4Group_MoveItem(sFilename.getData(), fullfn, true))
598  {
599  StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_RENAMEFILE"), sFilename.getData(), fullfn);
601  return false;
602  }
603  sFilename.Copy(fullfn);
604  }
605  // update real name in group, if this is a group
606  if (C4Group_IsGroup(fullfn))
607  {
608  C4Group Grp;
609  if (!Grp.Open(fullfn))
610  {
611  StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_OPENFILE"), sFilename.getData(), Grp.GetError());
613  return false;
614  }
615  if (!Grp.Delete(C4CFN_Title))
616  {
617  StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_DELOLDTITLE"), sFilename.getData(), Grp.GetError());
619  return false;
620  }
621  if (!SetTitleInGroup(Grp, szNewName)) return false;
622  if (!Grp.Close())
623  {
624  StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_WRITENEWTITLE"), sFilename.getData(), Grp.GetError());
626  return false;
627  }
628  }
629  // update title
630  sName.Copy(szNewName);
631  // done
632  return true;
633 }
char * GetFilename(char *szPath)
Definition: StdFile.cpp:45
void SCopy(const char *szSource, char *sTarget, size_t iMaxL)
Definition: Standard.cpp:152
void SAppend(const char *szSource, char *szTarget, int iMaxL)
Definition: Standard.cpp:257
bool ItemIdentical(const char *szFilename1, const char *szFilename2)
Definition: StdFile.cpp:855
virtual const char * GetDefaultExtension()
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:174
bool Delete(const char *szFiles, bool fRecursive=false)
Definition: C4Group.cpp:1334
#define _MAX_PATH
bool SEqual(const char *szStr1, const char *szStr2)
Definition: Standard.h:93
StdCopyStrBuf sName
StdCopyStrBuf sFilename
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
void MakeFilenameFromTitle(char *szTitle)
Definition: StdFile.cpp:402
C4GUIScreen * pGUI
Definition: C4Gui.cpp:1191
#define C4CFN_Title
Definition: C4Components.h:82
bool ShowMessageModal(const char *szMessage, const char *szCaption, DWORD dwButtons, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)
bool Open(const char *szGroupName, bool fCreate=false)
Definition: C4Group.cpp:514
bool C4Group_IsGroup(const char *szFilename)
Definition: C4Group.cpp:94
bool Close()
Definition: C4Group.cpp:755
virtual bool SetTitleInGroup(C4Group &rGrp, const char *szNewTitle)
const char * getData() const
Definition: StdBuf.h:442
const char * GetError()
Definition: C4Group.cpp:504
bool C4Group_MoveItem(const char *szSource, const char *szTarget1, bool fNoSort)
Definition: C4Group.cpp:144
bool ItemExists(const char *szItemName)
Definition: StdFile.h:75
void Copy()
Definition: StdBuf.h:467
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Resort()

void C4ScenarioListLoader::Folder::Resort ( )
inlineinherited

Definition at line 176 of file C4StartupScenSelDlg.h.

Referenced by C4StartupScenSelDlg::OnClosed().

Here is the caller graph for this function:

◆ SetTitleInGroup()

bool C4ScenarioListLoader::Entry::SetTitleInGroup ( C4Group rGrp,
const char *  szNewTitle 
)
virtualinherited

Definition at line 635 of file C4StartupScenSelDlg.cpp.

References C4Group::Add(), C4GUI::MessageDialog::btnOK, C4CFN_WriteTitle, Config, StdStrBuf::Copy(), StdStrBuf::Format(), C4Config::General, StdStrBuf::getData(), C4Group::GetError(), GetFilename(), StdStrBuf::GrabPointer(), C4GUI::Ico_Error, C4ScenarioListLoader::Entry::IsScenario(), C4ConfigGeneral::Language, LoadResStr(), pGUI, RemoveExtension(), SEqual(), C4ScenarioListLoader::Entry::sFilename, C4GUI::Screen::ShowMessageModal(), and StdStrBuf::Take().

Referenced by C4ScenarioListLoader::Entry::GetDefaultExtension(), and C4ScenarioListLoader::Entry::RenameTo().

636 {
637  // default for group files: Create a title text file and set the title in there
638  // no title needed if filename is sufficient - except for scenarios, where a Scenario.txt could overwrite the title
639  if (!IsScenario())
640  {
641  StdStrBuf sNameByFile; sNameByFile.Copy(GetFilename(sFilename.getData()));
642  char *szBuf = sNameByFile.GrabPointer();
643  RemoveExtension(szBuf);
644  sNameByFile.Take(szBuf);
645  if (SEqual(szNewTitle, sNameByFile.getData())) return true;
646  }
647  // okay, make a title
648  StdStrBuf sTitle; sTitle.Format("%s:%s", Config.General.Language, szNewTitle);
649  if (!rGrp.Add(C4CFN_WriteTitle, sTitle, false, true))
650  {
651  StdStrBuf sMsg; sMsg.Format(LoadResStr("IDS_ERR_ERRORADDINGNEWTITLEFORFIL"), sFilename.getData(), rGrp.GetError());
653  return false;
654  }
655  return true;
656 }
char * GetFilename(char *szPath)
Definition: StdFile.cpp:45
#define C4CFN_WriteTitle
Definition: C4Components.h:83
C4Config Config
Definition: C4Config.cpp:833
char * GrabPointer()
Definition: StdBuf.h:459
C4ConfigGeneral General
Definition: C4Config.h:251
void Format(const char *szFmt,...) GNUC_FORMAT_ATTRIBUTE_O
Definition: StdBuf.cpp:174
virtual bool IsScenario()
bool SEqual(const char *szStr1, const char *szStr2)
Definition: Standard.h:93
StdCopyStrBuf sFilename
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
C4GUIScreen * pGUI
Definition: C4Gui.cpp:1191
bool ShowMessageModal(const char *szMessage, const char *szCaption, DWORD dwButtons, Icons icoIcon, int32_t *piConfigDontShowAgainSetting=nullptr)
void Take(char *pnData)
Definition: StdBuf.h:457
const char * getData() const
Definition: StdBuf.h:442
void RemoveExtension(char *szFilename)
Definition: StdFile.cpp:306
char Language[CFG_MaxString+1]
Definition: C4Config.h:36
const char * GetError()
Definition: C4Group.cpp:504
bool Add(const char *szFile, const char *szAddAs)
Definition: C4Group.cpp:1316
void Copy()
Definition: StdBuf.h:467
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sort()

void C4ScenarioListLoader::Folder::Sort ( )
protectedinherited

Definition at line 903 of file C4StartupScenSelDlg.cpp.

References EntrySortFunc(), and C4ScenarioListLoader::Entry::pNext.

904 {
905  // use C-Library-QSort on a buffer of entry pointers; then re-link list
906  if (!pFirst) return;
907  uint32_t iCount,i;
908  Entry **ppEntries = new Entry *[i = iCount = GetEntryCount()], **ppI, *pI=pFirst, **ppIThis;
909  for (ppI = ppEntries; i--; pI = pI->pNext) *ppI++ = pI;
910  qsort(ppEntries, iCount, sizeof(Entry *), &EntrySortFunc);
911  ppIThis = &pFirst;
912  for (ppI = ppEntries; iCount--; ppIThis = &((*ppIThis)->pNext)) *ppIThis = *ppI++;
913  *ppIThis = nullptr;
914  delete [] ppEntries;
915 }
int EntrySortFunc(const void *pEl1, const void *pEl2)
Here is the call graph for this function:

◆ Start()

bool C4ScenarioListLoader::Folder::Start ( )
overridevirtualinherited

Implements C4ScenarioListLoader::Entry.

Definition at line 854 of file C4StartupScenSelDlg.cpp.

References C4StartupScenSelDlg::OpenFolder().

855 {
856  // open as subfolder
857  if (!C4StartupScenSelDlg::pInstance) return false;
859 }
bool OpenFolder(C4ScenarioListLoader::Folder *pNewFolder)
static C4StartupScenSelDlg * pInstance
Here is the call graph for this function:

Member Data Documentation

◆ C4F

C4Folder C4ScenarioListLoader::Folder::C4F
protectedinherited

Definition at line 152 of file C4StartupScenSelDlg.h.

◆ contents

NameList C4ScenarioListLoader::RegularFolder::contents
protected

Definition at line 228 of file C4StartupScenSelDlg.h.

◆ fBaseLoaded

bool C4ScenarioListLoader::Entry::fBaseLoaded
protectedinherited

Definition at line 59 of file C4StartupScenSelDlg.h.

Referenced by C4ScenarioListLoader::Entry::Load().

◆ fContentsLoaded

bool C4ScenarioListLoader::Folder::fContentsLoaded
protectedinherited

Definition at line 153 of file C4StartupScenSelDlg.h.

◆ fctIcon

◆ fctTitle

C4FacetSurface C4ScenarioListLoader::Entry::fctTitle
protectedinherited

◆ fExLoaded

bool C4ScenarioListLoader::Entry::fExLoaded
protectedinherited

Definition at line 59 of file C4StartupScenSelDlg.h.

Referenced by C4ScenarioListLoader::Entry::Load().

◆ iDifficulty

int C4ScenarioListLoader::Entry::iDifficulty
protectedinherited

◆ iFolderIndex

int C4ScenarioListLoader::Entry::iFolderIndex
protectedinherited

◆ iIconIndex

◆ pFirst

Entry* C4ScenarioListLoader::Folder::pFirst
protectedinherited

◆ pLoader

◆ pMapData

class C4MapFolderData* C4ScenarioListLoader::Folder::pMapData
protectedinherited

Definition at line 155 of file C4StartupScenSelDlg.h.

◆ pNext

◆ pParent

◆ sAuthor

StdCopyStrBuf C4ScenarioListLoader::Entry::sAuthor
protectedinherited

Definition at line 57 of file C4StartupScenSelDlg.h.

Referenced by C4ScenarioListLoader::Entry::GetAuthor().

◆ sDesc

StdCopyStrBuf C4ScenarioListLoader::Entry::sDesc
protectedinherited

◆ sFilename

◆ sName

◆ sVersion

StdCopyStrBuf C4ScenarioListLoader::Entry::sVersion
protectedinherited

The documentation for this class was generated from the following files: