示例#1
0
 def dispossessUI(self):
     self.__flashCall(BTMS_COMMANDS.ClearMessages())
     if self.__ui:
         self.__ui.removeExternalCallbacks(
             BTMS_COMMANDS.PopulateUI(),
             BTMS_COMMANDS.CheckCooldownPeriod(),
             BTMS_COMMANDS.SendMessage(), BTMS_COMMANDS.ChangeFocus(),
             BTMS_COMMANDS.AddToFriends(),
             BTMS_COMMANDS.RemoveFromFriends(),
             BTMS_COMMANDS.AddToIgnored(),
             BTMS_COMMANDS.RemoveFromIgnored(), BTMS_COMMANDS.AddMuted(),
             BTMS_COMMANDS.RemoveMuted(), BTMS_COMMANDS.upHistory(),
             BTMS_COMMANDS.downHistory(), BTMS_COMMANDS.GetLatestHistory())
     if self.__view:
         self.__view.dispossessUI()
         self.__view = None
     self.__ui = None
示例#2
0
    def populateUI(self, parentUI):
        self.__ui = parentUI
        self.__ui.addExternalCallbacks({
            BTMS_COMMANDS.PopulateUI():
            self.__onPopulateUI,
            BTMS_COMMANDS.ChangeFocus():
            self.__onChangeFocus,
            BTMS_COMMANDS.AddToFriends():
            self.__onAddToFriends,
            BTMS_COMMANDS.RemoveFromFriends():
            self.__onRemoveFromFriends,
            BTMS_COMMANDS.AddToIgnored():
            self.__onAddToIgnored,
            BTMS_COMMANDS.RemoveFromIgnored():
            self.__onRemoveFromIgnored,
            BTMS_COMMANDS.AddMuted():
            self.__onSetMuted,
            BTMS_COMMANDS.RemoveMuted():
            self.__onUnsetMuted,
            BTMS_COMMANDS.upHistory():
            self.__upHistory,
            BTMS_COMMANDS.downHistory():
            self.__downHistory,
            BTMS_COMMANDS.GetLatestHistory():
            self.__getLatestHistory,
            BTMS_COMMANDS.GetLastMessages():
            self.__getLatestMessages
        })
        self.__flashCall(BTMS_COMMANDS.RefreshUI())
        self.__view = BattleChannelView(self.__sharedHistory)
        self.__view.populateUI(parentUI)
        if self.__channelsCtrl:
            for controller in self.__channelsCtrl.getControllersIterator():
                controller.setView(self.__view)

            self.__updateHistoryControls()
        if BATTLE_CHANNEL.isInitialized(self.__initialized):
            self.enable()