vote plugin, possability to react on trigger events, now built in only for map ralated votes

This commit is contained in:
kremsy
2014-07-04 11:34:17 +02:00
parent 82f639be46
commit 2709df4d7e
3 changed files with 78 additions and 10 deletions

View File

@ -622,10 +622,9 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$message = $player->getEscapedNickname() . '$s started a vote to switch to ' . $map->getEscapedName() . '!';
$votesPlugin->defineVote('switchmap', "Goto " . $map->name, true, $message);
$votesPlugin->defineVote('switchmap', "Goto " . $map->name, true, $message)->setStopCallback(Callbacks::ENDMAP);
$votesPlugin->startVote($player, 'switchmap', function ($result) use (&$votesPlugin, &$map) {
// TODO: $result isn't used -> bug? does it skip even if vote is not successful?
$votesPlugin->undefineVote('switchmap');
//Don't queue on Map-Change