design improvements

This commit is contained in:
kremsy
2014-01-05 00:43:46 +01:00
parent 91185378b8
commit 4674392336
6 changed files with 56 additions and 15 deletions

View File

@ -5,6 +5,7 @@ namespace ManiaControl\Players;
use FML\Controls\Quads\Quad_Icons128x128_1;
use FML\Controls\Quads\Quad_Icons128x32_1;
use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Commands\CommandListener;
use ManiaControl\ManiaControl;
@ -72,10 +73,10 @@ class PlayerCommands implements CommandListener, ManialinkPageAnswerListener {
$itemQuad->setAction(self::ACTION_CANCEL_VOTE);
$this->maniaControl->actionsMenu->addMenuItem($itemQuad, false, 6);
//Action Balance Teams
//Action Open Playerlist
$this->maniaControl->manialinkManager->registerManialinkPageAnswerListener(self::ACTION_OPEN_PLAYERLIST, $this, 'command_playerList');
$itemQuad = new Quad_Icons128x128_1();
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_Buddies);
$itemQuad = new Quad_UIConstruction_Buttons();
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_Author);
$itemQuad->setAction(self::ACTION_OPEN_PLAYERLIST);
$this->maniaControl->actionsMenu->addMenuItem($itemQuad, true, 9);
}

View File

@ -48,6 +48,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
const ACTION_ADD_AS_MOD = 'PlayerList.PlayerAddAsModerator';
const ACTION_REVOKE_RIGHTS = 'PlayerList.RevokeRights';
const ACTION_OPEN_PLAYER_DETAILED = 'PlayerList.OpenPlayerDetailed';
const ACTION_SPECTATE_PLAYER = 'PlayerList.SpectatePlayer';
const SHOWN_MAIN_WINDOW = -1;
/**
* Private properties
@ -252,8 +253,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$playerQuad->setSubStyle($playerQuad::SUBSTYLE_Camera);
$playerQuad->setSize(3.8, 3.8);
$script->addTooltip($playerQuad, $descriptionLabel, array(Script::OPTION_TOOLTIP_TEXT => "Spectate " . $listPlayer->nickname));
$script->addProfileButton($playerQuad, $listPlayer->login); //TODO real action
$playerQuad->setAction(self::ACTION_SPECTATE_PLAYER);
// Player Profile Quad
$playerQuad = new Quad_UIConstruction_Buttons();
@ -585,6 +585,10 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener {
$targetLogin = $actionArray[2];
switch($action) {
case self::ACTION_SPECTATE_PLAYER: //TODO not working yet
$this->maniaControl->client->query('ForceSpectator', $adminLogin, PlayerActions::SPECTATOR_SPECTATOR);
$this->maniaControl->client->query('ForceSpectatorTarget', $adminLogin, $targetLogin, 1);
break;
case self::ACTION_OPEN_PLAYER_DETAILED:
$player = $this->maniaControl->playerManager->getPlayer($adminLogin);
$this->maniaControl->playerManager->playerDetailed->showPlayerDetailed($player, $targetLogin);