ingame configurator adjustments

This commit is contained in:
Steffen Schröder 2013-12-09 09:07:55 +01:00
parent 3cdb0a3d93
commit 201d17dae6
2 changed files with 23 additions and 19 deletions

View File

@ -63,9 +63,9 @@ class Configurator implements CallbackListener, ManialinkPageAnswerListener {
// Init settings // Init settings
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_POSX, 0.); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_POSX, 0.);
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_POSY, 0.); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_POSY, 3.);
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_WIDTH, 170.); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_WIDTH, 170.);
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_HEIGHT, 90.); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_HEIGHT, 81.);
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_STYLE, Quad_BgRaceScore2::STYLE); $this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_STYLE, Quad_BgRaceScore2::STYLE);
$this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_SUBSTYLE, $this->maniaControl->settingManager->initSetting($this, self::SETTING_MENU_SUBSTYLE,
Quad_BgRaceScore2::SUBSTYLE_HandleSelectable); Quad_BgRaceScore2::SUBSTYLE_HandleSelectable);
@ -239,7 +239,7 @@ class Configurator implements CallbackListener, ManialinkPageAnswerListener {
// Add Close Quad (X) // Add Close Quad (X)
$closeQuad = new Quad_Icons64x64_1(); $closeQuad = new Quad_Icons64x64_1();
$frame->add($closeQuad); $frame->add($closeQuad);
$closeQuad->setPosition($menuWidth * 0.484, $menuHeight * 0.47, 3); $closeQuad->setPosition($menuWidth * 0.483, $menuHeight * 0.467, 3);
$closeQuad->setSize(6, 6); $closeQuad->setSize(6, 6);
$closeQuad->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_QuitRace); $closeQuad->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_QuitRace);
$closeQuad->setAction(self::ACTION_TOGGLEMENU); $closeQuad->setAction(self::ACTION_TOGGLEMENU);

View File

@ -75,7 +75,7 @@ class ScriptSettings implements ConfiguratorMenu {
$pagerSize = 9.; $pagerSize = 9.;
$settingHeight = 5.; $settingHeight = 5.;
$labelTextSize = 2; $labelTextSize = 2;
$pageMaxCount = 15; $pageMaxCount = 13;
// Pagers // Pagers
$pagerPrev = new Quad_Icons64x64_1(); $pagerPrev = new Quad_Icons64x64_1();
@ -107,18 +107,34 @@ class ScriptSettings implements ConfiguratorMenu {
$pageFrame = new Frame(); $pageFrame = new Frame();
$frame->add($pageFrame); $frame->add($pageFrame);
array_push($pageFrames, $pageFrame); array_push($pageFrames, $pageFrame);
$y = $height * 0.43; $y = $height * 0.41;
} }
$settingFrame = new Frame();
$pageFrame->add($settingFrame);
$settingFrame->setY($y);
$nameLabel = new Label(); $nameLabel = new Label();
$pageFrame->add($nameLabel); $settingFrame->add($nameLabel);
$nameLabel->setHAlign(Control::LEFT); $nameLabel->setHAlign(Control::LEFT);
$nameLabel->setPosition($width * -0.46, $y); $nameLabel->setX($width * -0.46);
$nameLabel->setSize($width * 0.4, $settingHeight); $nameLabel->setSize($width * 0.4, $settingHeight);
$nameLabel->setStyle($labelStyleSetting); $nameLabel->setStyle($labelStyleSetting);
$nameLabel->setTextSize($labelTextSize); $nameLabel->setTextSize($labelTextSize);
$nameLabel->setText($settingName); $nameLabel->setText($settingName);
$entry = new Entry();
$settingFrame->add($entry);
$entry->setHAlign(Control::RIGHT);
$entry->setX($width * 0.44);
$entry->setSize($width * 0.43, $settingHeight);
$entry->setName(self::NAME_PREFIX . $settingName);
$settingValue = $scriptSettings[$settingName];
if ($settingValue === false) {
$settingValue = 0;
}
$entry->setDefault($settingValue);
$decriptionLabel = new Label(); $decriptionLabel = new Label();
$pageFrame->add($decriptionLabel); $pageFrame->add($decriptionLabel);
$decriptionLabel->setHAlign(Control::LEFT); $decriptionLabel->setHAlign(Control::LEFT);
@ -130,18 +146,6 @@ class ScriptSettings implements ConfiguratorMenu {
$decriptionLabel->setText($scriptParam['Desc']); $decriptionLabel->setText($scriptParam['Desc']);
$tooltips->add($nameLabel, $decriptionLabel); $tooltips->add($nameLabel, $decriptionLabel);
$entry = new Entry();
$pageFrame->add($entry);
$entry->setHAlign(Control::RIGHT);
$entry->setPosition($width * 0.46, $y);
$entry->setSize($width * 0.45, $settingHeight);
$entry->setName(self::NAME_PREFIX . $settingName);
$settingValue = $scriptSettings[$settingName];
if ($settingValue === false) {
$settingValue = 0;
}
$entry->setDefault($settingValue);
$y -= $settingHeight; $y -= $settingHeight;
if ($index % $pageMaxCount == $pageMaxCount - 1) { if ($index % $pageMaxCount == $pageMaxCount - 1) {
unset($pageFrame); unset($pageFrame);