コード例 #1
0
 function clearItems()
 {
     $this->container->clearComponents();
     foreach ($this->actions as $action) {
         ActionHandler::getInstance()->deleteAction($action);
     }
     $this->actions = array();
     foreach ($this->items as $item) {
         $item->destroy();
     }
     $this->items = array();
 }
コード例 #2
0
 function addSubitem($name, $callback)
 {
     if (!is_callable($callback)) {
         return;
     }
     $action = ActionHandler::getInstance()->createAction($callback);
     $this->actions[] = $action;
     $item = new Subitem($name);
     $item->setAction($action);
     $this->container->addComponent($item);
     $this->subitems[] = $item;
 }
コード例 #3
0
 static function Unload()
 {
     ActionHandler::getInstance()->deleteAction(self::$good->getAction());
     ActionHandler::getInstance()->deleteAction(self::$bad->getAction());
     self::$mapVote = null;
     self::$background = null;
     self::$title = null;
     self::$description = null;
     self::$scoreImage = null;
     self::$score = null;
     self::$good = null;
     self::$bad = null;
 }
コード例 #4
0
 function __construct()
 {
     $this->setTitle('Plugins');
     $this->pluginItems = array();
     $this->managerButton = new Button();
     $this->managerButton->setHalign('center');
     $this->managerButton->setStyle(Button::CardButtonSmallWide);
     $this->managerButton->setText('click here to manage your plugins');
     $this->managerButton->setAction(ActionHandler::getInstance()->createAction(array($this, 'showPluginManager')));
     $this->addComponent($this->managerButton);
     $this->pluginsPager = new Pager();
     $this->pluginsPager->setStretchContentX(true);
     $this->addComponent($this->pluginsPager);
     foreach (PluginHandler::getInstance()->getLoadedPluginsList() as $plugin) {
         $this->onPluginLoaded($plugin);
     }
     Dispatcher::register(PluginEvent::getClass(), $this);
 }
コード例 #5
0
ファイル: Window.php プロジェクト: ketsuekiro/manialive
 function createAction($callback)
 {
     $action = call_user_func_array(array(ActionHandler::getInstance(), 'createAction'), func_get_args());
     $this->actions[] = $action;
     return $action;
 }
コード例 #6
0
 function onUnload()
 {
     $this->queueable = array();
     $this->queue = array();
     $this->lastWorst = array();
     $this->mapsPlayed = array();
     $this->lastActivityTime = array();
     ActionHandler::getInstance()->deleteAction($this->enterQueueAction);
     ActionHandler::getInstance()->deleteAction($this->leaveQueueAction);
     Queue::EraseAll();
     Queue::Clear();
     FreeSpot::EraseAll();
     parent::onUnload();
 }
コード例 #7
0
 static function Erase($channelId)
 {
     if ($channel = self::GetById($channelId)) {
         unset(self::$byId[$channelId]);
         $const = array_search($channelId, self::$serverIds, true);
         if ($const !== false) {
             self::$serverIds[$const] = 0;
             if ($const != self::PATH) {
                 \ManiaLive\Gui\ActionHandler::getInstance()->deleteAction(self::$moveActions[$const]);
                 self::$moveActions[$const] = null;
             }
         }
     }
 }
コード例 #8
0
 /**
  * Use the static Create method to instanciate
  * a new object of that class.
  */
 protected function onConstruct()
 {
     parent::onConstruct();
     $this->oldSizeX = null;
     $this->oldSizeY = null;
     // create minimize button ...
     $this->buttonMin = new Label();
     $this->buttonMin->setStyle(Label::TextCardRaceRank);
     $this->buttonMin->setPosY(-2.5);
     $this->buttonMin->setText('$000_');
     $this->buttonMin->setAction(ActionHandler::getInstance()->createAction(array(GuiHandler::getInstance(), 'sendToTaskbar')));
     $this->addComponent($this->buttonMin);
     $this->buttonMax = new Icons128x32_1(8);
     $this->buttonMax->setSubStyle(Icons128x32_1::Windowed);
     $this->buttonMax->setPosition(9, -2.5);
     $this->buttonMax->setAction($this->createAction(array($this, 'maximize')));
     $this->addComponent($this->buttonMax);
     $this->setMaximizable(false);
 }
コード例 #9
0
 function onPlayerNeedAlliesHelp($login)
 {
     $this->gui->hideWaitingScreen($login);
     $this->gui->showAlliesHelp($login, \ManiaLive\Gui\ActionHandler::getInstance()->createAction(array($this, 'onCloseAlliesHelp')));
 }
コード例 #10
0
 final function showDemoPlayDialog($login, $answerYesCallBack, $answerNoCallback)
 {
     $ah = \ManiaLive\Gui\ActionHandler::getInstance();
     $window = Windows\AlertPlay::Create($login);
     $window->yesAction = $ah->createAction($answerYesCallBack);
     $window->noAction = $ah->createAction($answerNoCallback);
     $window->show();
 }