|
@@ -48,25 +48,25 @@
|
|
|
}
|
|
|
|
|
|
/* static */ bool ScriptGroup::SetName(GroupID group_id, Text *name)
|
|
|
{
|
|
|
CCountedPtr<Text> counter(name);
|
|
|
|
|
|
EnforcePrecondition(false, IsValidGroup(group_id));
|
|
|
EnforcePrecondition(false, name != NULL);
|
|
|
const char *text = name->GetDecodedText();
|
|
|
EnforcePreconditionEncodedText(false, text);
|
|
|
EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_GROUP_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
|
|
|
|
|
|
return ScriptObject::DoCommand(0, group_id, 0, CMD_RENAME_GROUP, text);
|
|
|
return ScriptObject::DoCommand(0, group_id, 0, CMD_ALTER_GROUP, text);
|
|
|
}
|
|
|
|
|
|
/* static */ char *ScriptGroup::GetName(GroupID group_id)
|
|
|
{
|
|
|
if (!IsValidGroup(group_id)) return NULL;
|
|
|
|
|
|
::SetDParam(0, group_id);
|
|
|
return GetString(STR_GROUP_NAME);
|
|
|
}
|
|
|
|
|
|
/* static */ bool ScriptGroup::EnableAutoReplaceProtection(GroupID group_id, bool enable)
|
|
|
{
|