1#ifndef GAME_EDITOR_EDITOR_SERVER_SETTINGS_H
2#define GAME_EDITOR_EDITOR_SERVER_SETTINGS_H
91 SInvalidSetting(
int Index,
const char *pSetting,
int Type,
int CollidingIndex,
bool Unknown) :
220 const std::vector<SParsedMapSettingArg> &
ParsedArgs(
const std::shared_ptr<IMapSetting> &pSetting)
const
264 void ColorArguments(std::vector<STextColorSplit> &vColorSplits)
const;
281 void ParseArgs(
const char *pLineInputStr,
const char *pStr);
312 void LoadCommand(
const char *pName,
const char *pArgs,
const char *pHelp);
313 void LoadSettingInt(
const std::shared_ptr<SMapSettingInt> &pSetting);
373 for(
int i = 0; i < ArgCount; i++)
Definition: editor_server_settings.h:119
std::vector< const char * > * m_pContainer
Definition: editor_server_settings.h:131
CArgumentValuesListBuilder(std::vector< const char * > *pContainer)
Definition: editor_server_settings.h:128
CArgumentValuesListBuilder & Add(const char *pString)
Definition: editor_server_settings.h:121
Definition: component.h:9
Definition: editor_server_settings.h:340
CArgumentConstraintsBuilder & Unique(int Arg)
Definition: editor_server_settings.h:357
CArgumentConstraintsBuilder(TArgumentConstraints *pContainer)
Definition: editor_server_settings.h:344
CArgumentConstraintsBuilder & Multiple(int Arg)
Definition: editor_server_settings.h:350
TArgumentConstraints * m_pContainer
Definition: editor_server_settings.h:347
Definition: editor_server_settings.h:366
CArgumentConstraintsBuilder operator()(const char *pSettingName, int ArgCount)
Definition: editor_server_settings.h:371
TCommandArgumentConstraints * m_pContainer
Definition: editor_server_settings.h:379
CCommandArgumentConstraintBuilder(TCommandArgumentConstraints *pContainer)
Definition: editor_server_settings.h:368
Definition: editor_server_settings.h:227
int CommentOffset() const
Definition: editor_server_settings.h:252
const char * InputString() const
Definition: editor_server_settings.cpp:1793
CContext(CMapSettingsBackend *pMaster, CLineInput *pLineinput)
Definition: editor_server_settings.h:271
void GetCommandHelpText(char *pStr, int Length) const
Definition: editor_server_settings.cpp:2075
void UpdatePossibleMatches()
Definition: editor_server_settings.cpp:1666
SCommandParseError m_Error
Definition: editor_server_settings.h:297
bool CommandIsValid() const
Definition: editor_server_settings.h:237
std::vector< SCurrentSettingArg > m_vCurrentArgs
Definition: editor_server_settings.h:291
void Update()
Definition: editor_server_settings.cpp:1218
int m_CurrentCompletionIndex
Definition: editor_server_settings.h:268
int m_CursorArgIndex
Definition: editor_server_settings.h:292
static const ColorRGBA ms_ArgumentStringColor
Definition: editor_server_settings.h:228
std::vector< SPossibleValueMatch > m_vPossibleMatches
Definition: editor_server_settings.h:293
void Reset()
Definition: editor_server_settings.cpp:1200
int m_CommentOffset
Definition: editor_server_settings.h:298
void UpdateCompositionString()
Definition: editor_server_settings.cpp:2083
CLineInput * m_pLineInput
Definition: editor_server_settings.h:295
int ArgCount() const
Definition: editor_server_settings.h:247
bool HasError() const
Definition: editor_server_settings.h:244
const char * CurrentArgValue() const
Definition: editor_server_settings.h:242
size_t ErrorOffset() const
Definition: editor_server_settings.h:245
EValidationResult ValidateArg(int Index, const char *pArg)
Definition: editor_server_settings.cpp:1609
size_t m_LastCursorOffset
Definition: editor_server_settings.h:294
static const ColorRGBA ms_ArgumentNumberColor
Definition: editor_server_settings.h:229
bool m_AllowUnknownCommands
Definition: editor_server_settings.h:266
void FormatDisplayValue(const char *pValue, char(&aOut)[N])
Definition: editor_server_settings.cpp:2106
void SetFontSize(float FontSize)
Definition: editor_server_settings.h:251
const SCurrentSettingArg & Arg(int Index) const
Definition: editor_server_settings.h:248
void ClearError()
Definition: editor_server_settings.cpp:1544
CLineInput * LineInput() const
Definition: editor_server_settings.h:250
float CurrentArgPos() const
Definition: editor_server_settings.h:240
const std::vector< SPossibleValueMatch > & PossibleMatches() const
Definition: editor_server_settings.h:243
int CheckCollision(ECollisionCheckResult &Result) const
Definition: editor_server_settings.cpp:1853
static const ColorRGBA ms_CommentColor
Definition: editor_server_settings.h:231
static const ColorRGBA ms_ErrorColor
Definition: editor_server_settings.h:232
void UpdateFromString(const char *pStr)
Definition: editor_server_settings.cpp:1223
size_t CurrentArgOffset() const
Definition: editor_server_settings.h:241
bool OnInput(const IInput::CEvent &Event)
Definition: editor_server_settings.cpp:1765
const char * CurrentArgName() const
Definition: editor_server_settings.h:239
static const ColorRGBA ms_ArgumentUnknownColor
Definition: editor_server_settings.h:230
const std::shared_ptr< IMapSetting > & Setting() const
Definition: editor_server_settings.h:249
void ColorArguments(std::vector< STextColorSplit > &vColorSplits) const
Definition: editor_server_settings.cpp:1806
bool Valid() const
Definition: editor_server_settings.cpp:2046
std::shared_ptr< IMapSetting > m_pCurrentSetting
Definition: editor_server_settings.h:290
bool UpdateCursor(bool Force=false)
Definition: editor_server_settings.cpp:1550
std::string m_CompositionStringBuffer
Definition: editor_server_settings.h:301
char m_aCommand[128]
Definition: editor_server_settings.h:296
float m_FontSize
Definition: editor_server_settings.h:302
SEditBoxDropdownContext m_DropdownContext
Definition: editor_server_settings.h:267
void ParseArgs(const char *pLineInputStr, const char *pStr)
Definition: editor_server_settings.cpp:1289
const char * Error() const
Definition: editor_server_settings.h:246
int CurrentArg() const
Definition: editor_server_settings.h:238
CMapSettingsBackend * m_pBackend
Definition: editor_server_settings.h:300
Definition: editor_server_settings.h:195
void LoadSettingCommand(const std::shared_ptr< SMapSettingCommand > &pSetting)
Definition: editor_server_settings.cpp:1111
std::map< int, EArgConstraint > TArgumentConstraints
Definition: editor_server_settings.h:323
void LoadSettingInt(const std::shared_ptr< SMapSettingInt > &pSetting)
Definition: editor_server_settings.cpp:1102
void RegisterLoader(const char *pSettingName, const FLoaderFunction &pfnLoader)
Definition: editor_server_settings.cpp:1163
TSettingsArgumentValues m_PossibleValuesPerCommand
Definition: editor_server_settings.h:387
CContext NewContext(CLineInput *pLineInput)
Definition: editor_server_settings.h:305
void InitValueLoaders()
Definition: editor_server_settings.cpp:2206
void LoadCommand(const char *pName, const char *pArgs, const char *pHelp)
Definition: editor_server_settings.cpp:1097
CMapSettingsBackend()=default
std::map< std::string, TArgumentConstraints > TCommandArgumentConstraints
Definition: editor_server_settings.h:324
std::map< std::shared_ptr< IMapSetting >, std::vector< SParsedMapSettingArg > > m_ParsedCommandArgs
Definition: editor_server_settings.h:386
void OnInit(CEditor *pEditor) override
Definition: editor_server_settings.cpp:1052
static void PossibleConfigVariableCallback(const struct SConfigVariable *pVariable, void *pUserData)
Definition: editor_server_settings.cpp:1184
std::map< std::string, FLoaderFunction > m_LoaderFunctions
Definition: editor_server_settings.h:388
std::vector< std::shared_ptr< IMapSetting > > m_vpMapSettings
Definition: editor_server_settings.h:385
void LoadConstraints()
Definition: editor_server_settings.cpp:1169
void(* FLoaderFunction)(const CSettingValuesBuilder &)
Definition: editor_server_settings.h:196
bool OnInput(const IInput::CEvent &Event) override
Definition: editor_server_settings.cpp:2120
void OnMapLoad() override
Definition: editor_server_settings.cpp:2134
static CContext * ms_pActiveContext
Definition: editor_server_settings.h:390
TCommandArgumentConstraints m_ArgConstraintsPerCommand
Definition: editor_server_settings.h:382
struct CMapSettingsBackend::SLoadedMapSettings m_LoadedMapSettings
void OnUpdate() override
Definition: editor_server_settings.cpp:2128
EArgConstraint ArgConstraint(const char *pSettingName, int Arg) const
Definition: editor_server_settings.h:214
void LoadAllMapSettings()
Definition: editor_server_settings.cpp:1083
void LoadPossibleValues(const CSettingValuesBuilder &Builder, const std::shared_ptr< IMapSetting > &pSetting)
Definition: editor_server_settings.cpp:1153
const std::vector< SParsedMapSettingArg > & ParsedArgs(const std::shared_ptr< IMapSetting > &pSetting) const
Definition: editor_server_settings.h:220
EArgConstraint
Definition: editor_server_settings.h:208
Definition: editor_server_settings.h:136
CSettingValuesBuilder(TSettingValues *pContainer)
Definition: editor_server_settings.h:144
CArgumentValuesListBuilder Argument(int Arg) const
Definition: editor_server_settings.h:138
TSettingValues * m_pContainer
Definition: editor_server_settings.h:148
Definition: editor_server_settings.h:152
CValuesBuilder(TSettingsArgumentValues *pContainer)
Definition: editor_server_settings.h:154
TSettingsArgumentValues * m_pContainer
Definition: editor_server_settings.h:165
CSettingValuesBuilder operator()(const char *pSettingName) const
Definition: editor_server_settings.h:159
std::map< int, TArgumentValuesList > TSettingValues
Definition: editor_server_settings.h:113
std::map< std::string, TSettingValues > TSettingsArgumentValues
Definition: editor_server_settings.h:114
ECollisionCheckResult
Definition: editor_server_settings.h:188
std::vector< const char * > TArgumentValuesList
Definition: editor_server_settings.h:112
EValidationResult
Definition: editor_server_settings.h:179
int str_copy(char *dst, const char *src, int dst_size)
Definition: system.cpp:2720
Definition: editor_server_settings.h:18
char m_aCommand[256]
Definition: editor_server_settings.h:19
CEditorMapSetting(const char *pCommand)
Definition: editor_server_settings.h:21
Definition: editor_server_settings.h:396
SLoadedMapSettings()
Definition: editor_server_settings.h:401
std::map< int, std::vector< int > > m_SettingsDuplicate
Definition: editor_server_settings.h:399
std::vector< SInvalidSetting > m_vSettingsInvalid
Definition: editor_server_settings.h:397
void Reset()
Definition: editor_server_settings.h:406
std::vector< CEditorMapSetting > m_vSettingsValid
Definition: editor_server_settings.h:398
Definition: editor_server_settings.cpp:25
Definition: editor_server_settings.h:54
EErrorType
Definition: editor_server_settings.h:59
@ ERROR_UNKNOWN
Definition: editor_server_settings.h:66
@ ERROR_TOO_MANY_ARGS
Definition: editor_server_settings.h:61
@ ERROR_INCOMPLETE
Definition: editor_server_settings.h:64
@ ERROR_INVALID_VALUE
Definition: editor_server_settings.h:62
@ ERROR_OUT_OF_RANGE
Definition: editor_server_settings.h:65
@ ERROR_UNKNOWN_VALUE
Definition: editor_server_settings.h:63
@ ERROR_NONE
Definition: editor_server_settings.h:60
char m_aMessage[256]
Definition: editor_server_settings.h:55
EErrorType m_Type
Definition: editor_server_settings.h:68
int m_ArgIndex
Definition: editor_server_settings.h:56
Definition: editor_server_settings.h:37
char m_aValue[256]
Definition: editor_server_settings.h:38
bool m_Error
Definition: editor_server_settings.h:42
char m_ExpectedType
Definition: editor_server_settings.h:43
size_t m_Start
Definition: editor_server_settings.h:40
float m_X
Definition: editor_server_settings.h:39
size_t m_End
Definition: editor_server_settings.h:41
Definition: editor_ui.h:7
Definition: editor_server_settings.h:85
bool m_Deleted
Definition: editor_server_settings.h:87
bool m_Chosen
Definition: editor_server_settings.h:88
bool m_Fixed
Definition: editor_server_settings.h:86
Definition: editor_server_settings.h:72
int m_Index
Definition: editor_server_settings.h:78
int m_CollidingIndex
Definition: editor_server_settings.h:81
@ TYPE_DUPLICATE
Definition: editor_server_settings.h:76
@ TYPE_INVALID
Definition: editor_server_settings.h:75
char m_aSetting[256]
Definition: editor_server_settings.h:79
struct SInvalidSetting::SContext m_Context
int m_Type
Definition: editor_server_settings.h:80
SInvalidSetting(int Index, const char *pSetting, int Type, int CollidingIndex, bool Unknown)
Definition: editor_server_settings.h:91
bool m_Unknown
Definition: editor_server_settings.h:82
Definition: editor_server_settings.cpp:48
Definition: editor_server_settings.cpp:39
Definition: editor_server_settings.h:30
char m_aName[32]
Definition: editor_server_settings.h:31
char m_Type
Definition: editor_server_settings.h:32
Definition: editor_server_settings.h:47
const void * m_pData
Definition: editor_server_settings.h:50
const char * m_pValue
Definition: editor_server_settings.h:48
int m_ArgIndex
Definition: editor_server_settings.h:49
Definition: editor_server_settings.h:171
static void LoadMapBugs(const CSettingValuesBuilder &BugBuilder)
Definition: editor_server_settings.cpp:2226
static void LoadArgumentTuneValues(CArgumentValuesListBuilder &&ArgBuilder)
Definition: editor_server_settings.cpp:2234
static void LoadTuneValues(const CSettingValuesBuilder &TuneBuilder)
Definition: editor_server_settings.cpp:2214
static void LoadTuneZoneValues(const CSettingValuesBuilder &TuneZoneBuilder)
Definition: editor_server_settings.cpp:2220