ScriptLog::Error(fmt::format("{}({}): {{{}}} expects {} to be consumed, but {} consumes {}", name, param_count + 1, cur_param.cmd, cur_param.consumes - 1, GetGameStringName(ref->string), count - 1));
/* Fill missing params if needed. */
for (int i = count; i < cur_param.consumes; i++) fmt::format_to(output, ":0");
}
skip_args(cur_param.consumes - 1);
break;
}
default:
for (int i = 0; i < cur_param.consumes; i++) {
ParamCheck &p = *get_next_arg();
if (!std::holds_alternative<SQInteger>(*p.param)) ScriptLog::Error(fmt::format("{}({}): {{{}}} expects an integer", name, param_count + i + 1, cur_param.cmd));
p.Encode(output);
}
}
param_count += cur_param.consumes;
}
seen_ids.pop_back();
}
const std::string Text::GetDecodedText()
{
::SetDParamStr(0, this->GetEncodedText());
return ::GetString(STR_JUST_RAW_STRING);
}
src/script/api/script_text.hpp
➞
Show inline comments
@@ -120,25 +120,25 @@ public:
* @return The same object as on which this is called, so you can chain.
*/
ScriptText *AddParam(Object value);
#endif /* DOXYGEN_API */
/**
* @api -all
*/
std::string GetEncodedText() override;
private:
using ScriptTextRef = ScriptObjectRef<ScriptText>;
using StringIDList = std::vector<StringID>;
using ScriptTextList = std::vector<ScriptText *>;
using Param = std::variant<SQInteger, std::string, ScriptTextRef>;