Ejemplo n.º 1
0
    def __init__(self, world):

        UIBase.__init__(self, world)

        #add frame border (temp!!!!!)
        self.border = DirectFrame(image=("./LEGameAssets/Textures/border.png"),
                                  frameColor=(0, 0, 0, 0),
                                  image_scale=(1, 1, 1),
                                  image_pos=(0, 0, 0),
                                  frameSize=(-1, 1, -1, 1),
                                  pos=(0, 0, 0))
        self.border.setTransparency(1)
        self.border.reparentTo(render2d)

        self.journalUI = JournalUI(world)
        self.conversationUI = ConversationUI(world)

        self.lifebarUI = LifebarUI(world)
        self.offensiveSpellUI = OffensiveSpellUI(world)
        self.modifierSporeUI = ModifierSporeUI(world)
        self.defensiveSpellUI = DefensiveSpellUI(world)
        taskMgr.add(self.update, "updateUI")

        # change the conversationUI position
        self.world.accept('u', self.conversationUI.repositionUp)
        self.world.accept('j', self.conversationUI.repositionDown)

        # health bars
        self.healthBars = {}
Ejemplo n.º 2
0
 def __init__(self,world):
     UIBase.__init__(self,world)
     
     #add frame border (temp!!!!!)
     self.border = DirectFrame(image = ("./LEGameAssets/Textures/border.png"), frameColor=(0, 0, 0, 0),
                           image_scale = (1,1,1),image_pos = (0, 0, 0),frameSize=(-1,1,-1,1),pos=(0,0,0))
     self.border.setTransparency(1)
     self.border.reparentTo(render2d)
     
     self.journalUI = JournalUI(world)
     self.pauseUI = PauseUI(world)
     #self.shroomUI = ShroomUI(world)
     self.conversationUI = ConversationUI(world)
     self.timerUI = TimerUI(world);
     self.timerUI.killTimer();
     
     #self.lifebarUI = LifebarUI(world)
     #self.offensiveSpellUI = OffensiveSpellUI(world)
     #self.modifierSporeUI = ModifierSporeUI(world)
     #self.defensiveSpellUI = DefensiveSpellUI(world)
     taskMgr.add(self.update, "updateUI")
     
     # change the conversationUI position
     #self.world.accept('u', self.conversationUI.repositionUp)
     #self.world.accept('j', self.conversationUI.repositionDown)
     
     
     # health bars
     self.healthBars = {}
Ejemplo n.º 3
0
    def show_invite_dialog(self, conversation=None):
        '''show the invite dialog for conversation, if conversation is
        None, then the current conversation is used'''
        if not self.controller or not self.controller.contacts \
            or not self.controller.msn:
            return

        conversation = conversation or self.conversation

        online_contacts = self.controller.contacts.get_online_list()
        dictionary = {}

        for i in online_contacts:
            dictionary[i.account] = i

        members = {}

        for mail in conversation.getMembers() + [conversation.getUser()]:
            contact = self.controller.getContact(mail)
            if contact:
                members[mail] = contact

        ConversationUI.InviteWindow(self.controller, None, dictionary, members,
                                    self.controller.theme,
                                    conversation.inviteUser).run()
Ejemplo n.º 4
0
    def __init__(self, controller, switchboard):
        '''Constructor'''
        gobject.GObject.__init__(self)

        self.callbackIdList = []
        self.P2PSignals = {}

        self.ui = None
        self.switchboard = None
        self.setSwitchboard(switchboard)
        msn = switchboard.msn
        self.controller = controller
        self.parser = controller.unifiedParser
        self.config = controller.config
        self.title = ""

        self.hasMessageWaiting = False
        self.lastMessageMail = '' # the mail of the user who sent the last message
        self.isCurrent = False # if True this is the tab that has the focus
        self.closed = False
        self.textBuffer = gtk.TextBuffer()
        self.autoreplySent = False # if true we allready sent the autoreply message
        self.inputText = ''
        self.theme = controller.theme
        self.parentConversationWindow = None
        
        self.enabledEncrypt = False
        self.encoderDecoder = None
        
        # do this for automagic reconnection if user comes online 
        # and there's no avail switchboard
        self.userMail = self.switchboard.firstUser
        self.userOldStatus = remoteStatus = self.controller.contacts.\
            get_status(self.userMail)
        # update self.userOldStatus in self.onUserAttrChanged
        msn.connect('user-attr-changed', self.onUserAttrChanged)
        msn.connect('custom-emoticon-transfered', self.onCustomEmoticonTransfered)

        #TODO: from now on this signals will be emitted by conversation window or conversationUI
        controller.connect('color-changed', self.onColorChanged)
        controller.connect('font-changed', self.onFontChanged)

        self.ui = ConversationUI.ConversationUI(self.controller, self)
        self.customEmoticons = CustomEmoticons()
        self.parser = self.controller.unifiedParser

        self.sendOffline = False
        self.lastSpeaker = ''
        self.user = switchboard.user

        self.transfers = []
        
        self.accept_or_not = False
        self.myWebcam = None
        
        if self.config.user['sendKeepalive']:
            # 8000: this magic value has been told by 
            # his majesty dequis himself
            # if you don't like it, stfu and gtfo
            gobject.timeout_add(8000, self.sendKeepalive)
Ejemplo n.º 5
0
class GameplayUI(UIBase):
    
    def __init__(self,world):
        UIBase.__init__(self,world)
        
        #add frame border (temp!!!!!)
        self.border = DirectFrame(image = ("./LEGameAssets/Textures/border.png"), frameColor=(0, 0, 0, 0),
                              image_scale = (1,1,1),image_pos = (0, 0, 0),frameSize=(-1,1,-1,1),pos=(0,0,0))
        self.border.setTransparency(1)
        self.border.reparentTo(render2d)
        
        self.journalUI = JournalUI(world)
        self.pauseUI = PauseUI(world)
        #self.shroomUI = ShroomUI(world)
        self.conversationUI = ConversationUI(world)
        self.timerUI = TimerUI(world);
        self.timerUI.killTimer();
        
        #self.lifebarUI = LifebarUI(world)
        #self.offensiveSpellUI = OffensiveSpellUI(world)
        #self.modifierSporeUI = ModifierSporeUI(world)
        #self.defensiveSpellUI = DefensiveSpellUI(world)
        taskMgr.add(self.update, "updateUI")
        
        # change the conversationUI position
        #self.world.accept('u', self.conversationUI.repositionUp)
        #self.world.accept('j', self.conversationUI.repositionDown)
        
        
        # health bars
        self.healthBars = {}
        
    def removeAllHealthBars(self):
        for name, healthbar in self.healthBars.iteritems():
            healthbar.removeNode()
        self.healthBars = {}
    
    def showHealthBar(self, gameObj):
        if gameObj.getName() in self.healthBars:
            self.healthBars[gameObj.getName()].show()
        else:
            healthBar = HealthBar(gameObj)
            healthBar.setLight(self.world.overlayAmbientLightNP)
            self.healthBars[gameObj.getName()] = healthBar
    
    def hideHealthBar(self, gameObj):
        if gameObj.getName() in self.healthBars:
            self.healthBars[gameObj.getName()].hide()
    
    def removeHealthBar(self, gameObj):
        if gameObj.getName() in self.healthBars:
            self.healthBars[gameObj.getName()].removeNode()
            del self.healthBars[gameObj.getName()]
    
    def update(self, task):
        self.journalUI.update()
        self.conversationUI.update()
        self.pauseUI.update()
        self.timerUI.update()
        #self.inventoryUI.update()
        #self.lifebarUI.update()
        #self.offensiveSpellUI.update()
        #self.modifierSporeUI.update()
        #self.defensiveSpellUI.update()
        for gameObjName, healthBar in self.healthBars.iteritems():
            healthBar.refresh()
        
        return task.cont
    def hideAll(self):
        #self.shroomUI.hideAll()
        self.pauseUI.hideAll()
        self.journalUI.hideAll()
        self.border.hide()
#        self.journalUI.hide()
#        self.conversationUI.hide()
#        self.lifebarUI.hide()
#        self.offensiveSpellUI.hide()
#        self.modifierSporeUI.hide()
#        self.defensiveSpellUI.hide()
        
    def showAll(self):
        self.pauseUI.showAll()
        #self.shroomUI.showAll();
        self.journalUI.showAll()
        self.border.show()
#        self.journalUI.show()
#        self.conversationUI.show()
#        self.lifebarUI.show()
#        self.offensiveSpellUI.show()
#        self.modifierSporeUI.show()
#        self.defensiveSpellUI.show()
        
    
    def stop(self):
        taskMgr.remove("updateUI")
    
    def start(self):
        taskMgr.add(self.update, "updateUI")
Ejemplo n.º 6
0
class GameplayUI(UIBase):
    def __init__(self, world):

        UIBase.__init__(self, world)

        #add frame border (temp!!!!!)
        self.border = DirectFrame(image=("./LEGameAssets/Textures/border.png"),
                                  frameColor=(0, 0, 0, 0),
                                  image_scale=(1, 1, 1),
                                  image_pos=(0, 0, 0),
                                  frameSize=(-1, 1, -1, 1),
                                  pos=(0, 0, 0))
        self.border.setTransparency(1)
        self.border.reparentTo(render2d)

        self.journalUI = JournalUI(world)
        self.conversationUI = ConversationUI(world)

        self.lifebarUI = LifebarUI(world)
        self.offensiveSpellUI = OffensiveSpellUI(world)
        self.modifierSporeUI = ModifierSporeUI(world)
        self.defensiveSpellUI = DefensiveSpellUI(world)
        taskMgr.add(self.update, "updateUI")

        # change the conversationUI position
        self.world.accept('u', self.conversationUI.repositionUp)
        self.world.accept('j', self.conversationUI.repositionDown)

        # health bars
        self.healthBars = {}

    def removeAllHealthBars(self):
        for name, healthbar in self.healthBars.iteritems():
            healthbar.removeNode()
        self.healthBars = {}

    def showHealthBar(self, gameObj):
        if gameObj.getName() in self.healthBars:
            self.healthBars[gameObj.getName()].show()
        else:
            healthBar = HealthBar(gameObj)
            healthBar.setLight(self.world.overlayAmbientLightNP)
            self.healthBars[gameObj.getName()] = healthBar

    def hideHealthBar(self, gameObj):
        if gameObj.getName() in self.healthBars:
            self.healthBars[gameObj.getName()].hide()

    def removeHealthBar(self, gameObj):
        if gameObj.getName() in self.healthBars:
            self.healthBars[gameObj.getName()].removeNode()
            del self.healthBars[gameObj.getName()]

    def update(self, task):
        self.journalUI.update()
        self.conversationUI.update()
        #self.inventoryUI.update()
        self.lifebarUI.update()
        self.offensiveSpellUI.update()
        self.modifierSporeUI.update()
        self.defensiveSpellUI.update()
        for gameObjName, healthBar in self.healthBars.iteritems():
            healthBar.refresh()

        return task.cont

    def hideAll(self):
        self.border.hide()
#        self.journalUI.hide()
#        self.conversationUI.hide()
#        self.lifebarUI.hide()
#        self.offensiveSpellUI.hide()
#        self.modifierSporeUI.hide()
#        self.defensiveSpellUI.hide()

    def showAll(self):
        self.border.show()
#        self.journalUI.show()
#        self.conversationUI.show()
#        self.lifebarUI.show()
#        self.offensiveSpellUI.show()
#        self.modifierSporeUI.show()
#        self.defensiveSpellUI.show()

    def stop(self):
        taskMgr.remove("updateUI")

    def start(self):
        taskMgr.add(self.update, "updateUI")