solved ui probs
This commit is contained in:
parent
b84ba8bb07
commit
34989d233d
@ -82,10 +82,11 @@ class CustomUIManager implements CallbackListener, TimerListener {
|
|||||||
*/
|
*/
|
||||||
public function handlePlayerJoined(Player $player) {
|
public function handlePlayerJoined(Player $player) {
|
||||||
$this->updateManialink($player);
|
$this->updateManialink($player);
|
||||||
//send it again after 5 secs
|
|
||||||
|
//send it again after 500ms
|
||||||
$this->maniaControl->timerManager->registerOneTimeListening($this, function($time) use (&$player){
|
$this->maniaControl->timerManager->registerOneTimeListening($this, function($time) use (&$player){
|
||||||
$this->updateManialink($player);
|
$this->updateManialink($player);
|
||||||
},5000);
|
},500);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,6 +131,9 @@ class ManialinkManager implements ManialinkPageAnswerListener, CallbackListener
|
|||||||
public function sendManialink($manialinkText, $logins = null, $timeout = 0, $hideOnClick = false) {
|
public function sendManialink($manialinkText, $logins = null, $timeout = 0, $hideOnClick = false) {
|
||||||
$manialinkText = (string) $manialinkText;
|
$manialinkText = (string) $manialinkText;
|
||||||
|
|
||||||
|
if(!$manialinkText)
|
||||||
|
return true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!$logins) {
|
if (!$logins) {
|
||||||
return $this->maniaControl->client->sendDisplayManialinkPage(null, $manialinkText, $timeout, $hideOnClick);
|
return $this->maniaControl->client->sendDisplayManialinkPage(null, $manialinkText, $timeout, $hideOnClick);
|
||||||
|
@ -203,9 +203,8 @@ class PlayerManager implements CallbackListener, TimerListener {
|
|||||||
$player->updateSpectatorStatus($callback[1][0]["SpectatorStatus"]);
|
$player->updateSpectatorStatus($callback[1][0]["SpectatorStatus"]);
|
||||||
|
|
||||||
//Check if Player finished joining the game
|
//Check if Player finished joining the game
|
||||||
if($player->hasJoinedGame && !$prevJoinState){
|
if ($player->hasJoinedGame && !$prevJoinState) {
|
||||||
//Delay join on 5secs to avoid the non appearing widgets in tm
|
|
||||||
$this->maniaControl->timerManager->registerOneTimeListening($this, function($time) use (&$player){
|
|
||||||
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_JOIN_LEAVE_MESSAGES) && !$player->isFakePlayer()) {
|
if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_JOIN_LEAVE_MESSAGES) && !$player->isFakePlayer()) {
|
||||||
$string = array(0 => '$0f0Player', 1 => '$0f0Moderator', 2 => '$0f0Admin', 3 => '$0f0SuperAdmin', 4 => '$0f0MasterAdmin');
|
$string = array(0 => '$0f0Player', 1 => '$0f0Moderator', 2 => '$0f0Admin', 3 => '$0f0SuperAdmin', 4 => '$0f0MasterAdmin');
|
||||||
$chatMessage = '$s$0f0' . $string[$player->authLevel] . ' $fff' . $player->nickname . '$z$s$0f0 Nation:$fff ' . $player->getCountry() . ' $z$s$0f0joined!';
|
$chatMessage = '$s$0f0' . $string[$player->authLevel] . ' $fff' . $player->nickname . '$z$s$0f0 Nation:$fff ' . $player->getCountry() . ' $z$s$0f0joined!';
|
||||||
@ -221,7 +220,7 @@ class PlayerManager implements CallbackListener, TimerListener {
|
|||||||
|
|
||||||
// Trigger own PlayerJoined callback
|
// Trigger own PlayerJoined callback
|
||||||
$this->maniaControl->callbackManager->triggerCallback(self::CB_PLAYERCONNECT, $player);
|
$this->maniaControl->callbackManager->triggerCallback(self::CB_PLAYERCONNECT, $player);
|
||||||
}, 2000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger own callback
|
// Trigger own callback
|
||||||
|
Loading…
Reference in New Issue
Block a user