From eafab8deee77c4b1016a5c30ebd6029cfa9e62c3 Mon Sep 17 00:00:00 2001 From: kremsy Date: Tue, 31 Dec 2013 00:32:50 +0100 Subject: [PATCH] mx button auf mapwidget --- application/core/Maps/Map.php | 1 + application/plugins/ChatMessagePlugin.php | 21 +++++++++++---------- application/plugins/WidgetPlugin.php | 15 +++++++++++++-- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/application/core/Maps/Map.php b/application/core/Maps/Map.php index d43f1596..18bc75fa 100644 --- a/application/core/Maps/Map.php +++ b/application/core/Maps/Map.php @@ -88,5 +88,6 @@ class Map { $serverInfo = $this->maniaControl->server->getSystemInfo(); $title = strtoupper(substr($serverInfo['TitleId'], 0, 2)); $this->mx = new \MXInfoFetcher($title, $this->uid, false); + } } \ No newline at end of file diff --git a/application/plugins/ChatMessagePlugin.php b/application/plugins/ChatMessagePlugin.php index 1251b432..3216adb0 100644 --- a/application/plugins/ChatMessagePlugin.php +++ b/application/plugins/ChatMessagePlugin.php @@ -91,12 +91,13 @@ class ChatMessagePlugin implements CommandListener, Plugin { public function chat_hi(array $chat, Player $player){ $command = explode(" ", $chat[1][2]); + if(isset($command[1])){ - $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHello $<' . $this->getTarget($command[1]) . '$>!'; + $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHello $z$<' . $this->getTarget($command[1]) . '$>$i!'; }else{ $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHello All!'; } - + //TODO why not italic? $this->maniaControl->chat->sendChat($msg, null, false); } @@ -109,7 +110,7 @@ class ChatMessagePlugin implements CommandListener, Plugin { $command = explode(" ", $chat[1][2]); if(isset($command[1])){ - $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iBye $<' . $this->getTarget($command[1]) . '$>!'; + $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iBye $z$<' . $this->getTarget($command[1]) . '$>$i!'; }else{ $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iI have to go... Bye All!'; } @@ -127,7 +128,7 @@ class ChatMessagePlugin implements CommandListener, Plugin { $command = explode(" ", $chat[1][2]); if(isset($command[1])){ - $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iThanks $<' . $this->getTarget($command[1]) . '$>!'; + $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iThanks $z$<' . $this->getTarget($command[1]) . '$>$i!'; }else{ $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iThanks All!'; } @@ -144,7 +145,7 @@ class ChatMessagePlugin implements CommandListener, Plugin { $command = explode(" ", $chat[1][2]); if(isset($command[1])){ - $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Game $<' . $this->getTarget($command[1]) . '$>!'; + $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Game $z$<' . $this->getTarget($command[1]) . '$>$i!'; }else{ $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Game All!'; } @@ -161,7 +162,7 @@ class ChatMessagePlugin implements CommandListener, Plugin { $command = explode(" ", $chat[1][2]); if(isset($command[1])){ - $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Luck $<' . $this->getTarget($command[1]) . '$>!'; + $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Luck $z$<' . $this->getTarget($command[1]) . '$>$i!'; }else{ $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Luck All!'; } @@ -178,7 +179,7 @@ class ChatMessagePlugin implements CommandListener, Plugin { $command = explode(" ", $chat[1][2]); if(isset($command[1])){ - $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHave Fun $<' . $this->getTarget($command[1]) . '$>!'; + $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHave Fun $z$<' . $this->getTarget($command[1]) . '$>$i!'; }else{ $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHave Fun All!'; } @@ -195,7 +196,7 @@ class ChatMessagePlugin implements CommandListener, Plugin { $command = explode(" ", $chat[1][2]); if(isset($command[1])){ - $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Luck and Have Fun $<' . $this->getTarget($command[1]) . '$>!'; + $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Luck and Have Fun $z$<' . $this->getTarget($command[1]) . '$>$i!'; }else{ $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Luck and Have Fun All!'; } @@ -212,7 +213,7 @@ class ChatMessagePlugin implements CommandListener, Plugin { $command = explode(" ", $chat[1][2]); if(isset($command[1])){ - $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice Shot $<' . $this->getTarget($command[1]) . '$>!'; + $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice Shot $z$<' . $this->getTarget($command[1]) . '$>$i!'; }else{ $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice Shot!'; } @@ -229,7 +230,7 @@ class ChatMessagePlugin implements CommandListener, Plugin { $command = explode(" ", $chat[1][2]); if(isset($command[1])){ - $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice One $<' . $this->getTarget($command[1]) . '$>!'; + $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice One $z$<' . $this->getTarget($command[1]) . '$>$i!'; }else{ $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice One!'; } diff --git a/application/plugins/WidgetPlugin.php b/application/plugins/WidgetPlugin.php index c1499543..2e01d619 100644 --- a/application/plugins/WidgetPlugin.php +++ b/application/plugins/WidgetPlugin.php @@ -1,8 +1,11 @@ add($label); @@ -355,7 +357,6 @@ class WidgetPlugin implements CallbackListener, Plugin { $quad->setHAlign(Control::CENTER); - // Send manialink $manialinkText = $maniaLink->render()->saveXML(); $this->maniaControl->manialinkManager->sendManialink($manialinkText, $login); @@ -412,6 +413,16 @@ class WidgetPlugin implements CallbackListener, Plugin { $label->setText($map->authorLogin); $label->setTextColor("FFF"); + if(isset($map->mx->pageurl)){ + $quad = new Quad; + $frame->add($quad); + $quad->setImage("http://wiki.maniaplanet.com/pool/images/b/bf/ManiaExchange_logo.png"); //TODO include image into maniacontrol + $quad->setPosition(-$width / 2 + 4, -1.5, -0.5); + $quad->setSize(4,4); + $quad->setHAlign(Control::CENTER); + $quad->setUrl($map->mx->pageurl); + } + // Send manialink $manialinkText = $maniaLink->render()->saveXML(); $this->maniaControl->manialinkManager->sendManialink($manialinkText, $login);