started mc settings
This commit is contained in:
parent
797843e057
commit
c60c1e5c30
@ -2,30 +2,31 @@
|
||||
|
||||
namespace ManiaControl\Configurators;
|
||||
|
||||
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Manialinks\ManialinkManager;
|
||||
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
|
||||
use ManiaControl\Players\Player;
|
||||
use FML\ManiaLink;
|
||||
use FML\ManiaLinks;
|
||||
use FML\Controls\Frame;
|
||||
use FML\Controls\Label;
|
||||
use FML\Controls\Labels\Label_Text;
|
||||
use FML\Controls\Quad;
|
||||
use FML\Controls\Quads\Quad_BgRaceScore2;
|
||||
use FML\Controls\Quads\Quad_Icons64x64_1;
|
||||
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
|
||||
use FML\ManiaLink;
|
||||
use FML\ManiaLinks;
|
||||
use FML\Script\Menus;
|
||||
use FML\Script\Pages;
|
||||
use FML\Script\Script;
|
||||
use FML\Script\Tooltips;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Commands\CommandListener;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Manialinks\ManialinkManager;
|
||||
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
|
||||
use ManiaControl\Players\Player;
|
||||
|
||||
require_once __DIR__ . '/ConfiguratorMenu.php';
|
||||
require_once __DIR__ . '/ScriptSettings.php';
|
||||
require_once __DIR__ . '/ServerSettings.php';
|
||||
require_once __DIR__ . '/ManiaControlSettings.php';
|
||||
|
||||
/**
|
||||
* Class managing ingame ManiaControl configuration
|
||||
@ -51,6 +52,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
|
||||
private $maniaControl = null;
|
||||
private $scriptSettings = null;
|
||||
private $serverSettings = null;
|
||||
private $maniaControlSettings = null;
|
||||
private $menus = array();
|
||||
private $playersMenuShown = array();
|
||||
|
||||
@ -80,13 +82,17 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(ScriptSettings::CB_SCRIPTSETTING_CHANGED, $this, 'reopenMenu');
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(ServerSettings::CB_SERVERSETTING_CHANGED, $this, 'reopenMenu');
|
||||
|
||||
// Create server settings
|
||||
$this->serverSettings = new ServerSettings($maniaControl);
|
||||
$this->addMenu($this->serverSettings);
|
||||
|
||||
// Create script settings
|
||||
$this->scriptSettings = new ScriptSettings($maniaControl);
|
||||
$this->addMenu($this->scriptSettings);
|
||||
|
||||
// Create server settings
|
||||
$this->serverSettings = new ServerSettings($maniaControl);
|
||||
$this->addMenu($this->serverSettings);
|
||||
// Create Mania Control Settings
|
||||
$this->maniaControlSettings = new ServerSettings($maniaControl);
|
||||
$this->addMenu($this->maniaControlSettings);
|
||||
|
||||
// Register for commands
|
||||
$this->maniaControl->commandManager->registerCommandListener('config', $this, 'handleConfigCommand', true);
|
||||
@ -190,8 +196,7 @@ class Configurator implements CallbackListener, CommandListener, ManialinkPageAn
|
||||
public function toggleMenu(Player $player) {
|
||||
if(isset($this->playersMenuShown[$player->login])) {
|
||||
$this->hideMenu($player);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$this->showMenu($player);
|
||||
}
|
||||
}
|
||||
|
66
application/core/Configurators/ManiaControlSettings.php
Normal file
66
application/core/Configurators/ManiaControlSettings.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Class offering a Configurator for Script Settings
|
||||
*
|
||||
* @author steeffeen & kremsy
|
||||
*/
|
||||
namespace ManiaControl\Configurators;
|
||||
|
||||
|
||||
use FML\Script\Script;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Players\Player;
|
||||
|
||||
class ManiaControlSettings implements ConfiguratorMenu{
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
const TITLE = 'ManiaControl Settings';
|
||||
|
||||
/**
|
||||
* Private Properties
|
||||
*/
|
||||
private $maniaControl = null;
|
||||
|
||||
/**
|
||||
* Create a new Script Settings Instance
|
||||
*
|
||||
* @param ManiaControl $maniaControl
|
||||
*/
|
||||
public function __construct(ManiaControl $maniaControl) {
|
||||
$this->maniaControl = $maniaControl;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Menu Title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle() {
|
||||
self::TITLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Configurator Menu Frame
|
||||
*
|
||||
* @param float $width
|
||||
* @param float $height
|
||||
* @param Script $script
|
||||
* @return \FML\Controls\Frame
|
||||
*/
|
||||
public function getMenu($width, $height, Script $script) {
|
||||
var_dump($this->maniaControl->settingManager->getSettings());
|
||||
// TODO: Implement getMenu() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the Config Data
|
||||
*
|
||||
* @param array $configData
|
||||
* @param Player $player
|
||||
*/
|
||||
public function saveConfigData(array $configData, Player $player) {
|
||||
// TODO: Implement saveConfigData() method.
|
||||
}
|
||||
}
|
@ -5,6 +5,8 @@ namespace ManiaControl\Maps;
|
||||
use FML\Controls\Quad;
|
||||
use FML\Controls\Quads\Quad_Icons64x64_1;
|
||||
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
|
||||
use FML\ManiaLink;
|
||||
use FML\Script\EUISound;
|
||||
use ManiaControl\Admin\AuthenticationManager;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
|
@ -417,7 +417,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
||||
$switchToQuad->setText("»");
|
||||
$switchToQuad->setTextColor("0F0");
|
||||
|
||||
//$switchToQuad->setAction(self::ACTION_CONFIRM_SWITCHTO_MAP . "." . ($id));
|
||||
$confirmFrame = $this->buildConfirmFrame($maniaLink, $y, $id);
|
||||
$script->addToggle($switchToQuad, $confirmFrame);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user