check if pause exists
This commit is contained in:
parent
41dabc21a3
commit
00813d66d7
@ -609,8 +609,21 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
|||||||
$script->addTooltip($itemQuad, $descriptionLabel, array(Script::OPTION_TOOLTIP_TEXT => $description));
|
$script->addTooltip($itemQuad, $descriptionLabel, array(Script::OPTION_TOOLTIP_TEXT => $description));
|
||||||
$x -= $itemSize * 1.05;
|
$x -= $itemSize * 1.05;
|
||||||
|
|
||||||
|
//Check if Pause exists in current gamemode
|
||||||
|
$this->maniaControl->client->query('GetModeScriptInfo');
|
||||||
|
$scriptInfos = $this->maniaControl->client->getResponse();
|
||||||
|
|
||||||
|
$pauseExists = false;
|
||||||
|
foreach($scriptInfos["CommandDescs"] as $param) {
|
||||||
|
if($param['Name'] == "Command_ForceWarmUp") {
|
||||||
|
$pauseExists = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($pauseExists) {
|
||||||
// Set Pause
|
// Set Pause
|
||||||
$itemQuad = new Quad_Icons128x32_1(); //TODO check if mode supports it
|
$itemQuad = new Quad_Icons128x32_1();
|
||||||
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_ManiaLinkSwitch);
|
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_ManiaLinkSwitch);
|
||||||
$popoutFrame->add($itemQuad);
|
$popoutFrame->add($itemQuad);
|
||||||
$itemQuad->setAction(self::ACTION_START_VOTE . 'pausegame');
|
$itemQuad->setAction(self::ACTION_START_VOTE . 'pausegame');
|
||||||
@ -620,7 +633,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
|||||||
$description = '$s' . 'Vote for a pause of Current Game';
|
$description = '$s' . 'Vote for a pause of Current Game';
|
||||||
$script->addTooltip($itemQuad, $descriptionLabel, array(Script::OPTION_TOOLTIP_TEXT => $description));
|
$script->addTooltip($itemQuad, $descriptionLabel, array(Script::OPTION_TOOLTIP_TEXT => $description));
|
||||||
$x -= $itemSize * 1.05;
|
$x -= $itemSize * 1.05;
|
||||||
|
}
|
||||||
|
|
||||||
// Vote RestartMap
|
// Vote RestartMap
|
||||||
$itemQuad = new Quad_UIConstruction_Buttons();
|
$itemQuad = new Quad_UIConstruction_Buttons();
|
||||||
|
Loading…
Reference in New Issue
Block a user