tempfix of scriptsettings
This commit is contained in:
parent
b529fc5eb7
commit
62398b719a
@ -145,17 +145,18 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
$pagesId = 'ScriptSettingsPages';
|
$pagesId = 'ScriptSettingsPages';
|
||||||
$frame = new Frame();
|
$frame = new Frame();
|
||||||
|
|
||||||
$scriptInfo = $this->maniaControl->client->getModeScriptInfo();
|
//$scriptInfo = (array)$this->maniaControl->client->getModeScriptInfo();
|
||||||
/*if(isset($scriptInfo->)) {
|
$scriptInfo = $this->maniaControl->client->execute('GetModeScriptInfo');
|
||||||
|
if(isset($scriptInfo['faultCode'])) {
|
||||||
// Not in script mode
|
// Not in script mode
|
||||||
$label = new Label(); //TODO
|
$label = new Label();
|
||||||
$frame->add($label);
|
$frame->add($label);
|
||||||
$label->setText($scriptInfo['faultString']);
|
$label->setText($scriptInfo['faultString']);
|
||||||
return $frame;
|
return $frame;
|
||||||
}*/
|
}
|
||||||
$scriptParams = $scriptInfo->paramDescs;
|
$scriptParams = $scriptInfo['ParamDescs'];
|
||||||
|
|
||||||
$scriptSettings = (array)$this->maniaControl->client->getModeScriptSettings();
|
$scriptSettings = $this->maniaControl->client->execute('GetModeScriptSettings');
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
$pagerSize = 9.;
|
$pagerSize = 9.;
|
||||||
@ -192,7 +193,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
$pageFrames = array();
|
$pageFrames = array();
|
||||||
$y = 0.;
|
$y = 0.;
|
||||||
foreach($scriptParams as $index => $scriptParam) {
|
foreach($scriptParams as $index => $scriptParam) {
|
||||||
$settingName = $scriptParam->name;
|
$settingName = $scriptParam['Name'];
|
||||||
|
|
||||||
if(!isset($scriptSettings[$settingName])) {
|
if(!isset($scriptSettings[$settingName])) {
|
||||||
continue;
|
continue;
|
||||||
@ -259,7 +260,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
$descriptionLabel->setSize($width * 0.7, $settingHeight);
|
$descriptionLabel->setSize($width * 0.7, $settingHeight);
|
||||||
$descriptionLabel->setTextSize($labelTextSize);
|
$descriptionLabel->setTextSize($labelTextSize);
|
||||||
$descriptionLabel->setTranslate(true);
|
$descriptionLabel->setTranslate(true);
|
||||||
$descriptionLabel->setText($scriptParam->desc);
|
$descriptionLabel->setText($scriptParam['Desc']);
|
||||||
$script->addTooltip($nameLabel, $descriptionLabel);
|
$script->addTooltip($nameLabel, $descriptionLabel);
|
||||||
|
|
||||||
$y -= $settingHeight;
|
$y -= $settingHeight;
|
||||||
@ -276,13 +277,13 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
* @see \ManiaControl\Configurators\ConfiguratorMenu::saveConfigData()
|
* @see \ManiaControl\Configurators\ConfiguratorMenu::saveConfigData()
|
||||||
*/
|
*/
|
||||||
public function saveConfigData(array $configData, Player $player) {
|
public function saveConfigData(array $configData, Player $player) {
|
||||||
//TODO fix settings
|
|
||||||
$prefix = explode(".", $configData[3][0]['Name']);
|
$prefix = explode(".", $configData[3][0]['Name']);
|
||||||
if($prefix[0] != self::ACTION_PREFIX_SETTING) {
|
if($prefix[0] != self::ACTION_PREFIX_SETTING) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scriptInfo = (array)$this->maniaControl->client->getModeScriptInfo();
|
$scriptSettings = $this->maniaControl->client->execute('GetModeScriptSettings');
|
||||||
|
|
||||||
$prefixLength = strlen(self::ACTION_PREFIX_SETTING);
|
$prefixLength = strlen(self::ACTION_PREFIX_SETTING);
|
||||||
|
|
||||||
@ -344,8 +345,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
* @param $setting
|
* @param $setting
|
||||||
*/
|
*/
|
||||||
public function toggleBooleanSetting($setting, Player $player) {
|
public function toggleBooleanSetting($setting, Player $player) {
|
||||||
$scriptInfo = (array)$this->maniaControl->client->getModeScriptInfo();
|
$scriptSettings = $this->maniaControl->client->execute('GetModeScriptSettings');
|
||||||
|
|
||||||
if(!isset($scriptSettings[$setting])) {
|
if(!isset($scriptSettings[$setting])) {
|
||||||
var_dump('no setting ' . $setting);
|
var_dump('no setting ' . $setting);
|
||||||
return;
|
return;
|
||||||
|
@ -137,7 +137,8 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
$pagesId = 'ServerSettingsPages';
|
$pagesId = 'ServerSettingsPages';
|
||||||
$frame = new Frame();
|
$frame = new Frame();
|
||||||
|
|
||||||
$serverSettings = $this->maniaControl->client->getServerOptions();
|
//TODO temporary
|
||||||
|
$serverSettings = $this->maniaControl->client->execute('GetServerOptions');
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
$pagerSize = 9.;
|
$pagerSize = 9.;
|
||||||
@ -268,7 +269,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note on ServerOptions the whole Options have to be saved, otherwise a error will appear
|
// Note on ServerOptions the whole Options have to be saved, otherwise a error will appear
|
||||||
$serverSettings = (array)$this->maniaControl->client->getServerOptions();
|
$serverSettings = $this->maniaControl->client->execute('GetServerOptions'); //TODO just temporary
|
||||||
|
|
||||||
$prefixLength = strlen(self::ACTION_PREFIX_SETTING);
|
$prefixLength = strlen(self::ACTION_PREFIX_SETTING);
|
||||||
|
|
||||||
@ -329,12 +330,12 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
|
|||||||
if(!$newSettings) {
|
if(!$newSettings) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//TODO not working yet
|
|
||||||
/*$success = $this->maniaControl->client->setServerOptions($newSettings);
|
$success = $this->maniaControl->client->setServerOptions($newSettings);
|
||||||
if(!$success) {
|
if(!$success) {
|
||||||
$this->maniaControl->chat->sendError('Error occurred: ' . $this->maniaControl->getClientErrorText(), $player->login);
|
$this->maniaControl->chat->sendError('Error occurred: ' . $this->maniaControl->getClientErrorText(), $player->login);
|
||||||
return false;
|
return false;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
// Save Settings into Database
|
// Save Settings into Database
|
||||||
$mysqli = $this->maniaControl->database->mysqli;
|
$mysqli = $this->maniaControl->database->mysqli;
|
||||||
|
@ -106,8 +106,8 @@ class Connection
|
|||||||
* @param string $authLevel
|
* @param string $authLevel
|
||||||
* @param array $params
|
* @param array $params
|
||||||
*/
|
*/
|
||||||
protected function execute($methodName, $params = array(), $multicall = false)
|
public function execute($methodName, $params = array(), $multicall = false)
|
||||||
{
|
{//TODO just temporary
|
||||||
if($multicall)
|
if($multicall)
|
||||||
{
|
{
|
||||||
$this->xmlrpcClient->addCall($methodName, $params);
|
$this->xmlrpcClient->addCall($methodName, $params);
|
||||||
|
Loading…
Reference in New Issue
Block a user