mx button auf mapwidget

This commit is contained in:
kremsy 2013-12-31 00:32:50 +01:00
parent 3b3bac2b0d
commit eafab8deee
3 changed files with 25 additions and 12 deletions

View File

@ -88,5 +88,6 @@ class Map {
$serverInfo = $this->maniaControl->server->getSystemInfo(); $serverInfo = $this->maniaControl->server->getSystemInfo();
$title = strtoupper(substr($serverInfo['TitleId'], 0, 2)); $title = strtoupper(substr($serverInfo['TitleId'], 0, 2));
$this->mx = new \MXInfoFetcher($title, $this->uid, false); $this->mx = new \MXInfoFetcher($title, $this->uid, false);
} }
} }

View File

@ -91,12 +91,13 @@ class ChatMessagePlugin implements CommandListener, Plugin {
public function chat_hi(array $chat, Player $player){ public function chat_hi(array $chat, Player $player){
$command = explode(" ", $chat[1][2]); $command = explode(" ", $chat[1][2]);
if(isset($command[1])){ 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{ }else{
$msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHello All!'; $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHello All!';
} }
//TODO why not italic?
$this->maniaControl->chat->sendChat($msg, null, false); $this->maniaControl->chat->sendChat($msg, null, false);
} }
@ -109,7 +110,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
$command = explode(" ", $chat[1][2]); $command = explode(" ", $chat[1][2]);
if(isset($command[1])){ 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{ }else{
$msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iI have to go... Bye All!'; $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]); $command = explode(" ", $chat[1][2]);
if(isset($command[1])){ 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{ }else{
$msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iThanks All!'; $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iThanks All!';
} }
@ -144,7 +145,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
$command = explode(" ", $chat[1][2]); $command = explode(" ", $chat[1][2]);
if(isset($command[1])){ 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{ }else{
$msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Game All!'; $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Game All!';
} }
@ -161,7 +162,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
$command = explode(" ", $chat[1][2]); $command = explode(" ", $chat[1][2]);
if(isset($command[1])){ 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{ }else{
$msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Luck All!'; $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Luck All!';
} }
@ -178,7 +179,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
$command = explode(" ", $chat[1][2]); $command = explode(" ", $chat[1][2]);
if(isset($command[1])){ 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{ }else{
$msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHave Fun All!'; $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iHave Fun All!';
} }
@ -195,7 +196,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
$command = explode(" ", $chat[1][2]); $command = explode(" ", $chat[1][2]);
if(isset($command[1])){ 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{ }else{
$msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iGood Luck and Have Fun All!'; $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]); $command = explode(" ", $chat[1][2]);
if(isset($command[1])){ 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{ }else{
$msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice Shot!'; $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice Shot!';
} }
@ -229,7 +230,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
$command = explode(" ", $chat[1][2]); $command = explode(" ", $chat[1][2]);
if(isset($command[1])){ 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{ }else{
$msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice One!'; $msg = '$g[$<' . $player->nickname . '$>$s] $ff0$iNice One!';
} }

View File

@ -1,8 +1,11 @@
<?php <?php
use FML\Controls\Control; use FML\Controls\Control;
use FML\Controls\Frame; use FML\Controls\Frame;
use FML\Controls\Labels\Label_Button;
use FML\Controls\Labels\Label_Text; use FML\Controls\Labels\Label_Text;
use FML\Controls\Quad; use FML\Controls\Quad;
use FML\Controls\Quads\Quad_Bgs1;
use FML\Controls\Quads\Quad_Bgs1InRace;
use FML\Controls\Quads\Quad_Icons128x128_1; use FML\Controls\Quads\Quad_Icons128x128_1;
use FML\Controls\Quads\Quad_Icons64x64_1; use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\ManiaLink; use FML\ManiaLink;
@ -310,7 +313,6 @@ class WidgetPlugin implements CallbackListener, Plugin {
$playerCount++; $playerCount++;
} }
//Player Quad / Label //Player Quad / Label
$label = new Label_Text(); $label = new Label_Text();
$frame->add($label); $frame->add($label);
@ -355,7 +357,6 @@ class WidgetPlugin implements CallbackListener, Plugin {
$quad->setHAlign(Control::CENTER); $quad->setHAlign(Control::CENTER);
// Send manialink // Send manialink
$manialinkText = $maniaLink->render()->saveXML(); $manialinkText = $maniaLink->render()->saveXML();
$this->maniaControl->manialinkManager->sendManialink($manialinkText, $login); $this->maniaControl->manialinkManager->sendManialink($manialinkText, $login);
@ -412,6 +413,16 @@ class WidgetPlugin implements CallbackListener, Plugin {
$label->setText($map->authorLogin); $label->setText($map->authorLogin);
$label->setTextColor("FFF"); $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 // Send manialink
$manialinkText = $maniaLink->render()->saveXML(); $manialinkText = $maniaLink->render()->saveXML();
$this->maniaControl->manialinkManager->sendManialink($manialinkText, $login); $this->maniaControl->manialinkManager->sendManialink($manialinkText, $login);