OpenClonk
C4ConfigDeveloper Class Reference

#include <C4Config.h>

Public Member Functions

void CompileFunc (StdCompiler *compiler)
 
void AddRecentlyEditedScenario (const char *filename)
 

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 81 of file C4Config.h.

Member Function Documentation

◆ AddRecentlyEditedScenario()

void C4ConfigDeveloper::AddRecentlyEditedScenario ( const char *  filename)

Definition at line 97 of file C4Config.cpp.

98 {
99  if (!filename || !*filename)
100  {
101  return;
102  }
103  // Put given scenario first in list by moving all other scenarios down
104  // Check how many scenarios to move down the list. Stop moving down when the given scenario is in the list
105  int32_t move_down_num;
106  for (move_down_num = 0; move_down_num < CFG_MaxEditorMRU - 1; ++move_down_num)
107  {
108  if (!strncmp(filename, RecentlyEditedSzenarios[move_down_num], CFG_MaxString))
109  {
110  break;
111  }
112  }
113  // Move them down
114  for (int32_t i = move_down_num; i > 0; --i)
115  {
117  }
118  // Put current scenario in
119  strncpy(RecentlyEditedSzenarios[0], filename, CFG_MaxString);
120 }
@ CFG_MaxEditorMRU
Definition: C4Config.h:28
@ CFG_MaxString
Definition: C4Config.h:28
char RecentlyEditedSzenarios[CFG_MaxEditorMRU][CFG_MaxString+1]
Definition: C4Config.h:90

References CFG_MaxEditorMRU, CFG_MaxString, and RecentlyEditedSzenarios.

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

Here is the caller graph for this function:

◆ CompileFunc()

void C4ConfigDeveloper::CompileFunc ( StdCompiler compiler)

Definition at line 83 of file C4Config.cpp.

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

References AltTodoFilename, AutoFileReload, CFG_MaxEditorMRU, DebugShapeTextures, FormatString(), MaxScriptMRU, mkNamingAdapt(), RecentlyEditedSzenarios, s, ShowHelp, TodoFilename, and StdCompiler::Value().

Here is the call graph for this function:

Member Data Documentation

◆ AltTodoFilename

char C4ConfigDeveloper::AltTodoFilename[CFG_MaxString+1]

Definition at line 86 of file C4Config.h.

Referenced by CompileFunc(), and C4MessageInput::ProcessCommand().

◆ AutoFileReload

int32_t C4ConfigDeveloper::AutoFileReload

Definition at line 84 of file C4Config.h.

Referenced by CompileFunc(), and C4Game::InitGame().

◆ DebugShapeTextures

int32_t C4ConfigDeveloper::DebugShapeTextures

Definition at line 88 of file C4Config.h.

Referenced by CompileFunc(), and C4TextureShape::Load().

◆ MaxScriptMRU

int32_t C4ConfigDeveloper::MaxScriptMRU

Definition at line 87 of file C4Config.h.

Referenced by CompileFunc(), and C4Console::RegisterRecentInput().

◆ RecentlyEditedSzenarios

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

Definition at line 90 of file C4Config.h.

Referenced by AddRecentlyEditedScenario(), and CompileFunc().

◆ ShowHelp

bool C4ConfigDeveloper::ShowHelp

Definition at line 89 of file C4Config.h.

Referenced by CompileFunc().

◆ TodoFilename

char C4ConfigDeveloper::TodoFilename[CFG_MaxString+1]

Definition at line 85 of file C4Config.h.

Referenced by CompileFunc(), and C4MessageInput::ProcessCommand().


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