concat script settings change message

This commit is contained in:
Steffen Schröder 2013-12-31 16:12:23 +01:00
parent 96eda851df
commit 6349c3447f

View File

@ -280,19 +280,28 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
}
// Notifications
foreach ($newSettings as $setting => $value) {
$title = $this->maniaControl->authenticationManager->getAuthLevelName($player->authLevel);
$chatMessage = '$ff0' . $title . ' $<' . $player->nickname . '$> set ScriptSetting ';
$settingsCount = count($newSettings);
$settingIndex = 0;
foreach ($newSettings as $setting => $value) {
$chatMessage .= '$<' . '$fff' . preg_replace('/^S_/', '', $setting) . '$z$s$ff0 ';
$chatMessage .= 'to $fff' . $this->parseSettingValue($value) . '$>!';
$chatMessage .= 'to $fff' . $this->parseSettingValue($value) . '$>';
$this->maniaControl->chat->sendInformation($chatMessage);
$this->maniaControl->log(Formatter::stripCodes($chatMessage));
if ($settingIndex <= $settingsCount - 2) {
$chatMessage .= ', ';
}
// Trigger own callback
$this->maniaControl->callbackManager->triggerCallback(self::CB_SCRIPTSETTING_CHANGED,
array(self::CB_SCRIPTSETTING_CHANGED, $setting, $value));
$settingIndex++;
}
$chatMessage .= '!';
$this->maniaControl->chat->sendInformation($chatMessage);
$this->maniaControl->log(Formatter::stripCodes($chatMessage));
}
/**