C4ConfigDeveloper Class Reference

#include <C4Config.h>

Public Member Functions

void CompileFunc (StdCompiler *pComp)
void AddRecentlyEditedScenario (const char *fn)

Public Attributes

int32_t AutoFileReload
char TodoFilename [CFG_MaxString+1]
char AltTodoFilename [CFG_MaxString+1]
int32_t MaxScriptMRU
int32_t DebugShapeTextures
bool ShowHelp
char RecentlyEditedSzenarios [CFG_MaxEditorMRU][CFG_MaxString+1]

Detailed Description

Definition at line 80 of file C4Config.h.

Member Function Documentation

◆ AddRecentlyEditedScenario()

void C4ConfigDeveloper::AddRecentlyEditedScenario ( const char *  fn)

Definition at line 96 of file C4Config.cpp.

References CFG_MaxEditorMRU, and CFG_MaxString.

Referenced by C4Console::FileNew(), C4Console::FileOpen(), C4Console::FileOpenWPlrs(), and C4Console::FileSaveAs().

97 {
98  if (!fn || !*fn) return;
99  // Put given scenario first in list by moving all other scenarios down
100  // Check how many scenarios to move down the list. Stop moving down when the given scenario is in the list
101  int32_t move_down_num;
102  for (move_down_num = 0; move_down_num < CFG_MaxEditorMRU - 1; ++move_down_num)
103  if (!strncmp(fn, RecentlyEditedSzenarios[move_down_num], CFG_MaxString))
104  break;
105  // Move them down
106  for (int32_t i = move_down_num; i > 0; --i)
108  // Put current scenario in
109  strncpy(RecentlyEditedSzenarios[0], fn, CFG_MaxString);
110 }
char RecentlyEditedSzenarios[CFG_MaxEditorMRU][CFG_MaxString+1]
Definition: C4Config.h:89
Here is the caller graph for this function:

◆ CompileFunc()

void C4ConfigDeveloper::CompileFunc ( StdCompiler pComp)

Definition at line 84 of file C4Config.cpp.

References CFG_MaxEditorMRU, FormatString(), mkNamingAdapt(), s, and StdCompiler::Value().

85 {
86  pComp->Value(mkNamingAdapt(AutoFileReload, "AutoFileReload", 1 , false, true));
87  pComp->Value(mkNamingAdapt(s(TodoFilename), "TodoFilename", "{SCENARIO}/TODO.txt", false, true));
88  pComp->Value(mkNamingAdapt(s(AltTodoFilename), "AltTodoFilename2", "{USERPATH}/TODO.txt", false, true));
89  pComp->Value(mkNamingAdapt(MaxScriptMRU, "MaxScriptMRU", 30 , false, false));
90  pComp->Value(mkNamingAdapt(DebugShapeTextures, "DebugShapeTextures", 0 , false, true));
91  pComp->Value(mkNamingAdapt(ShowHelp, "ShowHelp", true , false, false));
92  for (int32_t i = 0; i < CFG_MaxEditorMRU; ++i)
93  pComp->Value(mkNamingAdapt(s(RecentlyEditedSzenarios[i]), FormatString("EditorMRU%02d", (int)i).getData(), "", false, false));
94 }
int32_t DebugShapeTextures
Definition: C4Config.h:87
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
char TodoFilename[CFG_MaxString+1]
Definition: C4Config.h:84
int32_t AutoFileReload
Definition: C4Config.h:83
int32_t MaxScriptMRU
Definition: C4Config.h:86
void Value(const T &rStruct)
Definition: StdCompiler.h:161
char RecentlyEditedSzenarios[CFG_MaxEditorMRU][CFG_MaxString+1]
Definition: C4Config.h:89
char AltTodoFilename[CFG_MaxString+1]
Definition: C4Config.h:85
#define s
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270
Here is the call graph for this function:

Member Data Documentation

◆ AltTodoFilename

char C4ConfigDeveloper::AltTodoFilename[CFG_MaxString+1]

Definition at line 85 of file C4Config.h.

Referenced by C4MessageInput::ProcessCommand().

◆ AutoFileReload

int32_t C4ConfigDeveloper::AutoFileReload

Definition at line 83 of file C4Config.h.

Referenced by C4Game::InitGame().

◆ DebugShapeTextures

int32_t C4ConfigDeveloper::DebugShapeTextures

Definition at line 87 of file C4Config.h.

Referenced by C4TextureShape::Load().

◆ MaxScriptMRU

int32_t C4ConfigDeveloper::MaxScriptMRU

Definition at line 86 of file C4Config.h.

Referenced by C4Console::RegisterRecentInput().

◆ RecentlyEditedSzenarios

char C4ConfigDeveloper::RecentlyEditedSzenarios[CFG_MaxEditorMRU][CFG_MaxString+1]

Definition at line 89 of file C4Config.h.

◆ ShowHelp

bool C4ConfigDeveloper::ShowHelp

◆ TodoFilename

char C4ConfigDeveloper::TodoFilename[CFG_MaxString+1]

Definition at line 84 of file C4Config.h.

Referenced by C4MessageInput::ProcessCommand().

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