map eraseing button in list
This commit is contained in:
parent
11d966a6ca
commit
6f69ab30a0
@ -253,8 +253,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$eraseQuad->setZ(0.2);
|
$eraseQuad->setZ(0.2);
|
||||||
$eraseQuad->setSize(4,4);
|
$eraseQuad->setSize(4,4);
|
||||||
$eraseQuad->setSubStyle($eraseQuad::SUBSTYLE_Erase);
|
$eraseQuad->setSubStyle($eraseQuad::SUBSTYLE_Erase);
|
||||||
$eraseQuad->setAction(self::ACTION_ERASE_MAP . "." .($id-1));
|
$eraseQuad->setAction(self::ACTION_ERASE_MAP . "." .($id-1) . "." . $map->uid);
|
||||||
//TODO bestätigung?
|
|
||||||
|
|
||||||
//Description Label
|
//Description Label
|
||||||
$descriptionLabel = new Label();
|
$descriptionLabel = new Label();
|
||||||
@ -276,7 +275,6 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
$switchToQuad->setSize(4, 4);
|
$switchToQuad->setSize(4, 4);
|
||||||
$switchToQuad->setSubStyle($switchToQuad::SUBSTYLE_ArrowFastNext);
|
$switchToQuad->setSubStyle($switchToQuad::SUBSTYLE_ArrowFastNext);
|
||||||
$switchToQuad->setAction(self::ACTION_SWITCH_MAP . "." .($id-1));
|
$switchToQuad->setAction(self::ACTION_SWITCH_MAP . "." .($id-1));
|
||||||
//TODO bestätigung?
|
|
||||||
|
|
||||||
$descriptionLabel = new Label();
|
$descriptionLabel = new Label();
|
||||||
$frame->add($descriptionLabel);
|
$frame->add($descriptionLabel);
|
||||||
@ -358,12 +356,19 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
|
|||||||
|
|
||||||
$actionArray = explode(".", $actionId);
|
$actionArray = explode(".", $actionId);
|
||||||
|
|
||||||
if($addMap){ //TODO log and chat message
|
$player = $this->maniaControl->playerManager->getPlayer($callback[1][1]);
|
||||||
$this->maniaControl->mapManager->addMapFromMx($actionArray[2],$callback[1][1]);
|
|
||||||
}else if($eraseMap){
|
|
||||||
|
|
||||||
|
if($addMap){ //TODO log and chat message
|
||||||
|
$this->maniaControl->mapManager->addMapFromMx($actionArray[2],$callback[1][1]); //TODO bestätigung
|
||||||
|
}else if($eraseMap){ //TODO log and chat message
|
||||||
|
$this->maniaControl->mapManager->eraseMap(intval($actionArray[2]), $actionArray[3]); //TODO bestätigung
|
||||||
|
$this->showMapList($player);
|
||||||
}else if($switchMap){ //TODO log and chat message
|
}else if($switchMap){ //TODO log and chat message
|
||||||
$this->maniaControl->client->query('JumpToMapIndex', intval($actionArray[2]));
|
$this->maniaControl->client->query('JumpToMapIndex', intval($actionArray[2])); //TODO bestätigung
|
||||||
|
$mapList = $this->maniaControl->mapManager->getMapList();
|
||||||
|
|
||||||
|
$this->maniaControl->chat->sendSuccess('Map switched to $z$<' . $mapList[$actionArray[2]]->name . '$>!'); //TODO specified message, who done it?
|
||||||
|
$this->maniaControl->log('Skipped to $z$<' . $mapList[$actionArray[2]]->name . '$>!');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,21 @@ class MapManager implements CallbackListener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erases a Map
|
||||||
|
* @param $id
|
||||||
|
* @param $uid
|
||||||
|
*/
|
||||||
|
public function eraseMap($id, $uid) {
|
||||||
|
$map = $this->mapListUids[$uid];
|
||||||
|
$this->maniaControl->client->query('RemoveMap', $map->fileName);
|
||||||
|
$this->maniaControl->chat->sendSuccess('Map $<' . $map->name . '$> removed!'); //TODO specified message, who done it?
|
||||||
|
$this->maniaControl->log('Map $<' . $map->name . '$> removed!');
|
||||||
|
unset($this->mapListUids[$uid]);
|
||||||
|
unset($this->mapList[$id]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the full Map list, needed on Init, addMap and on ShuffleMaps
|
* Updates the full Map list, needed on Init, addMap and on ShuffleMaps
|
||||||
* @return null
|
* @return null
|
||||||
|
Loading…
Reference in New Issue
Block a user