update visibility when receiving callback from MatchManagerCore

This commit is contained in:
Beu 2024-06-06 11:20:08 +02:00
parent 4f18b51cba
commit edbe75c39e
2 changed files with 28 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class MatchManagerPlayersPause implements ManialinkPageAnswerListener, CommandLi
* Constants * Constants
*/ */
const PLUGIN_ID = 159; const PLUGIN_ID = 159;
const PLUGIN_VERSION = 1.3; const PLUGIN_VERSION = 1.4;
const PLUGIN_NAME = 'MatchManager Players Pause'; const PLUGIN_NAME = 'MatchManager Players Pause';
const PLUGIN_AUTHOR = 'Beu'; const PLUGIN_AUTHOR = 'Beu';
@ -138,6 +138,10 @@ class MatchManagerPlayersPause implements ManialinkPageAnswerListener, CommandLi
$this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'handlePlayerDisconnect'); $this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'handlePlayerDisconnect');
$this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'displayPauseWidgetIfNeeded'); $this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'displayPauseWidgetIfNeeded');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_STARTMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_ENDMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_STOPMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(Callbacks::MP_STARTROUNDSTART, $this, 'handleBeginRoundCallback'); $this->maniaControl->getCallbackManager()->registerCallbackListener(Callbacks::MP_STARTROUNDSTART, $this, 'handleBeginRoundCallback');
@ -328,6 +332,15 @@ class MatchManagerPlayersPause implements ManialinkPageAnswerListener, CommandLi
} }
} }
/**
* handleMatchManagerCoreCallback
*
* @return void
*/
public function handleMatchManagerCoreCallback() {
$this->displayPauseWidgetIfNeeded();
}
/** /**
* Generate Manialinks variables * Generate Manialinks variables
*/ */

View File

@ -17,7 +17,7 @@ use ManiaControl\Plugins\PluginManager;
use ManiaControl\Settings\Setting; use ManiaControl\Settings\Setting;
use ManiaControl\Settings\SettingManager; use ManiaControl\Settings\SettingManager;
use ManiaControl\Commands\CommandListener; use ManiaControl\Commands\CommandListener;
use Maniaplanet\DedicatedServer\InvalidArgumentException;
if (!class_exists('MatchManagerSuite\MatchManagerCore')) { if (!class_exists('MatchManagerSuite\MatchManagerCore')) {
$this->maniaControl->getChat()->sendErrorToAdmins('MatchManager Core is required to use one of MatchManager plugin. Install it and restart Maniacontrol'); $this->maniaControl->getChat()->sendErrorToAdmins('MatchManager Core is required to use one of MatchManager plugin. Install it and restart Maniacontrol');
@ -37,7 +37,7 @@ class MatchManagerReadyButton implements ManialinkPageAnswerListener, CommandLis
* Constants * Constants
*/ */
const PLUGIN_ID = 158; const PLUGIN_ID = 158;
const PLUGIN_VERSION = 1.3; const PLUGIN_VERSION = 1.4;
const PLUGIN_NAME = 'MatchManager Ready Button'; const PLUGIN_NAME = 'MatchManager Ready Button';
const PLUGIN_AUTHOR = 'Beu'; const PLUGIN_AUTHOR = 'Beu';
@ -135,6 +135,10 @@ class MatchManagerReadyButton implements ManialinkPageAnswerListener, CommandLis
$this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'handlePlayerDisconnect'); $this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'handlePlayerDisconnect');
$this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'displayReadyWidgetIfNeeded'); $this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'displayReadyWidgetIfNeeded');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_STARTMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_ENDMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_STOPMATCH, $this, 'handleMatchManagerCoreCallback');
// Register ManiaLink Pages // Register ManiaLink Pages
$this->maniaControl->getManialinkManager()->registerManialinkPageAnswerListener(self::ACTION_READY, $this, 'handleReady'); $this->maniaControl->getManialinkManager()->registerManialinkPageAnswerListener(self::ACTION_READY, $this, 'handleReady');
@ -300,6 +304,14 @@ class MatchManagerReadyButton implements ManialinkPageAnswerListener, CommandLis
} }
} }
/**
* handleMatchManagerCoreCallback
*
* @return void
*/
public function handleMatchManagerCoreCallback() {
$this->displayReadyWidgetIfNeeded();
}
/** /**
* Generate Manialinks variables * Generate Manialinks variables