added settings for main widget

This commit is contained in:
kremsy 2013-12-29 10:03:58 +01:00
parent bf942409fb
commit 8752864ad0
3 changed files with 57 additions and 9 deletions

View File

@ -2,6 +2,7 @@
namespace ManiaControl\Manialinks; namespace ManiaControl\Manialinks;
use FML\Controls\Quads\Quad_BgRaceScore2;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
/** /**
@ -16,7 +17,11 @@ class StyleManager {
const SETTING_LABEL_DEFAULT_STYLE = 'Default Label Style'; const SETTING_LABEL_DEFAULT_STYLE = 'Default Label Style';
const SETTING_QUAD_DEFAULT_STYLE = 'Default Quad Style'; const SETTING_QUAD_DEFAULT_STYLE = 'Default Quad Style';
const SETTING_QUAD_DEFAULT_SUBSTYLE = 'Default Quad SubStyle'; const SETTING_QUAD_DEFAULT_SUBSTYLE = 'Default Quad SubStyle';
const SETTING_MAIN_WIDGET_DEFAULT_STYLE = 'Main Widget Default Quad Style';
const SETTING_MAIN_WIDGET_DEFAULT_SUBSTYLE = 'Main Widget Default Quad SubStyle';
const SETTING_LIST_WIDGETS_WIDTH = 'List Widgets Width';
const SETTING_LIST_WIDGETS_HEIGHT = 'List Widgets Height';
/** /**
* Private properties * Private properties
*/ */
@ -34,6 +39,12 @@ class StyleManager {
$this->maniaControl->settingManager->initSetting($this, self::SETTING_LABEL_DEFAULT_STYLE, 'TextTitle1'); $this->maniaControl->settingManager->initSetting($this, self::SETTING_LABEL_DEFAULT_STYLE, 'TextTitle1');
$this->maniaControl->settingManager->initSetting($this, self::SETTING_QUAD_DEFAULT_STYLE, 'Bgs1InRace'); $this->maniaControl->settingManager->initSetting($this, self::SETTING_QUAD_DEFAULT_STYLE, 'Bgs1InRace');
$this->maniaControl->settingManager->initSetting($this, self::SETTING_QUAD_DEFAULT_SUBSTYLE, 'BgTitleShadow'); $this->maniaControl->settingManager->initSetting($this, self::SETTING_QUAD_DEFAULT_SUBSTYLE, 'BgTitleShadow');
//Main Widget
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MAIN_WIDGET_DEFAULT_STYLE, Quad_BgRaceScore2::STYLE);
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MAIN_WIDGET_DEFAULT_SUBSTYLE, Quad_BgRaceScore2::SUBSTYLE_HandleSelectable);
$this->maniaControl->settingManager->initSetting($this, self::SETTING_LIST_WIDGETS_WIDTH, '150');
$this->maniaControl->settingManager->initSetting($this, self::SETTING_LIST_WIDGETS_HEIGHT, '80');
} }
/** /**
@ -62,4 +73,41 @@ class StyleManager {
public function getDefaultQuadSubstyle() { public function getDefaultQuadSubstyle() {
return $this->maniaControl->settingManager->getSetting($this, self::SETTING_QUAD_DEFAULT_SUBSTYLE); return $this->maniaControl->settingManager->getSetting($this, self::SETTING_QUAD_DEFAULT_SUBSTYLE);
} }
/**
* Get the default main window style
*
* @return string
*/
public function getDefaultMainWindowStyle(){
return $this->maniaControl->settingManager->getSetting($this, self::SETTING_MAIN_WIDGET_DEFAULT_STYLE);
}
/**
* Get the default main window substyle
*
* @return string
*/
public function getDefaultMainWindowSubStyle(){
return $this->maniaControl->settingManager->getSetting($this, self::SETTING_MAIN_WIDGET_DEFAULT_SUBSTYLE);
}
/**
* Get the default list widget width
*
* @return string
*/
public function getListWidgetsWidth(){
return $this->maniaControl->settingManager->getSetting($this, self::SETTING_LIST_WIDGETS_WIDTH);
}
/**
* Get the default list widget height
*
* @return string
*/
public function getListWidgetsHeight(){
return $this->maniaControl->settingManager->getSetting($this, self::SETTING_LIST_WIDGETS_HEIGHT);
}
} }

View File

@ -69,10 +69,10 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_BEGINMAP, $this, 'updateWidget'); //TODO not working yet $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_BEGINMAP, $this, 'updateWidget'); //TODO not working yet
//settings //settings
$this->width = 150; $this->width = $this->maniaControl->manialinkManager->styleManager->getListWidgetsWidth();
$this->height = 80; $this->height = $this->maniaControl->manialinkManager->styleManager->getListWidgetsHeight();
$this->quadStyle = Quad_BgRaceScore2::STYLE; //TODO add default menu style to style manager $this->quadStyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowStyle();
$this->quadSubstyle = Quad_BgRaceScore2::SUBSTYLE_HandleSelectable; $this->quadSubstyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowSubStyle();
} }

View File

@ -78,10 +78,10 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$this->maniaControl->callbackManager->registerCallbackListener(AuthenticationManager::CB_AUTH_LEVEL_CHANGED, $this, 'updateWidget'); $this->maniaControl->callbackManager->registerCallbackListener(AuthenticationManager::CB_AUTH_LEVEL_CHANGED, $this, 'updateWidget');
//settings //settings
$this->width = 150; $this->width = $this->maniaControl->manialinkManager->styleManager->getListWidgetsWidth();
$this->height = 80; $this->height = $this->maniaControl->manialinkManager->styleManager->getListWidgetsHeight();
$this->quadStyle = Quad_BgRaceScore2::STYLE; //TODO add default menu style to style manager $this->quadStyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowStyle();
$this->quadSubstyle = Quad_BgRaceScore2::SUBSTYLE_HandleSelectable; $this->quadSubstyle = $this->maniaControl->manialinkManager->styleManager->getDefaultMainWindowSubStyle();
} }