// setting name included in format string i.e. "sSomeSetting|newSettingValue" bool Cmd_SetStringIniSetting_Execute(COMMAND_ARGS) { char fmtString[kMaxMessageLength] = { 0 }; *result = 0; if (ExtractFormatStringArgs(0, fmtString, PASS_FMTSTR_ARGS, kCommandInfo_SetStringGameSettingEX.numParams)) { UInt32 pipePos = std::string(fmtString).find(GetSeparatorChar(scriptObj)); if (pipePos != -1) { fmtString[pipePos] = 0; char* newValue = fmtString + pipePos + 1; Setting* setting = NULL; GameSettingCollection* gmsts = GameSettingCollection::GetSingleton(); if (gmsts && gmsts->GetGameSetting(fmtString, &setting) && setting && setting->GetType() == Setting::kSetting_String) { setting->Set(newValue);; *result = 1; } } } return true; }
bool Cmd_SetNumericIniSetting_Execute(COMMAND_ARGS) { char settingName[512] = { 0 }; float newVal = 0; *result = 0; if (ExtractArgs(EXTRACT_ARGS, &settingName, &newVal)) { Setting* setting; if (GetIniSetting(settingName, &setting)) { if (setting->Set(newVal)) *result = 1; } else if (IsConsoleMode()) Console_Print("SetNumericIniSetting >> NOT FOUND"); } return true; }
bool Cmd_SetNumericGameSetting_Execute(COMMAND_ARGS) { char settingName[512] = { 0 }; float newVal = 0; *result = 0; if (ExtractArgs(EXTRACT_ARGS, &settingName, &newVal)) { Setting* setting; GameSettingCollection* gmsts = GameSettingCollection::GetSingleton(); if (gmsts && gmsts->GetGameSetting(settingName, &setting)) { if (setting->Set(newVal)) *result = 1; } else if (IsConsoleMode()) Console_Print("SetNumericGameSetting >> NOT FOUND"); } return true; }
// setting name included in format string i.e. "sSomeSetting|newSettingValue" bool Cmd_SetStringGameSettingEX_Execute(COMMAND_ARGS) { char fmtString[kMaxMessageLength] = { 0 }; *result = 0; if (ExtractFormatStringArgs(0, fmtString, PASS_FMTSTR_ARGS, kCommandInfo_SetStringGameSettingEX.numParams)) { UInt32 pipePos = std::string(fmtString).find(GetSeparatorChar(scriptObj)); if (pipePos != -1) { fmtString[pipePos] = 0; char* newValue = fmtString + pipePos + 1; Setting* setting = NULL; if (GetIniSetting(fmtString, &setting)) { setting->Set(newValue);; *result = 1; } } } return true; }