diff --git a/application/core/Server/VoteRatiosMenu.php b/application/core/Server/VoteRatiosMenu.php index 754233ec..0448ceeb 100644 --- a/application/core/Server/VoteRatiosMenu.php +++ b/application/core/Server/VoteRatiosMenu.php @@ -56,15 +56,13 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene * @see \ManiaControl\Configurators\ConfiguratorMenu::getMenu() */ public function getMenu($width, $height, Script $script, Player $player) { - $voteRatioCommands = VoteRatio::getCommands(); - $voteRatios = $this->maniaControl->client->getCallVoteRatios(); - - $frame = new Frame(); - + $frame = new Frame(); $posY = $height * 0.41; $lineHeight = 5.; $index = 0; + $voteRatioCommands = $this->getVoteCommands(); + $voteRatios = $this->maniaControl->client->getCallVoteRatios(); foreach ($voteRatioCommands as $voteRatioCommand => $voteRatioDescription) { $voteRatioFrame = new Frame(); $frame->add($voteRatioFrame); @@ -102,6 +100,15 @@ class VoteRatiosMenu implements CallbackListener, ConfiguratorMenu, TimerListene return $frame; } + /** + * Get the list of available vote commands + * + * @return string[] + */ + private function getVoteCommands() { + return array(VoteRatio::COMMAND_DEFAULT => 'Default', VoteRatio::COMMAND_RESTART_MAP => 'Restart Map', VoteRatio::COMMAND_NEXT_MAP => 'Skip Map', VoteRatio::COMMAND_SET_NEXT_MAP => 'Set next Map', VoteRatio::COMMAND_JUMP_MAP => 'Jump to Map', VoteRatio::COMMAND_TEAM_BALANCE => 'Balance Teams', VoteRatio::COMMAND_SCRIPT_SETTINGS => 'Change Script Settings and Commands', VoteRatio::COMMAND_KICK => 'Kick Players', VoteRatio::COMMAND_BAN => 'Ban Players'); + } + /** * Return the vote ratio for the given command *