Ejemplo n.º 1
0
    def __messagesChanged(self):
        self.clearMenu()
        try:
            lt = base.localAvatar
        except:
            return

        for section in IdesOfMarchMenu:
            if section[0] == -1:
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print 'warning: tried to link IdesOfMarch phrase %s which does not seem to exist' % phrase
                        break
                    self.append(SCStaticTextTerminal(phrase))

            else:
                menu = SCMenu()
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print 'warning: tried to link IdesOfMarch phrase %s which does not seem to exist' % phrase
                        break
                    menu.append(SCStaticTextTerminal(phrase))

                menuName = str(section[0])
                self.append(SCMenuHolder(menuName, menu))
Ejemplo n.º 2
0
    def __boardingMessagesChanged(self, zoneId):
        self.clearMenu()
        try:
            lt = base.localAvatar
        except:
            return

        for count in xrange(len(BoardingMenuGuide)):
            section = BoardingMenuGuide[count]
            if section[0] == -1:
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print 'warning: tried to link boarding phrase %s which does not seem to exist' % phrase
                        break
                    self.append(SCStaticTextTerminal(phrase))

            else:
                menu = SCMenu()
                phrases = ZoneIdsToMsgs[zoneId][count]
                for phrase in phrases:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print 'warning: tried to link boarding phrase %s which does not seem to exist' % phrase
                        break
                    menu.append(SCStaticTextTerminal(phrase))

                menuName = str(section[0])
                self.append(SCMenuHolder(menuName, menu))
Ejemplo n.º 3
0
    def __SillyPhaseFourMessagesChanged(self):
        # clear out everything from our menu
        self.clearMenu()

        # if local toon has not been created, don't panic
        try:
            lt = base.localAvatar
        except:
            return
        for section in SillyPhaseFourMenu:
            if section[0] == -1:
                #This is not a submenu but a terminal!
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print ('warning: tried to link Silly PhaseFour phrase %s which does not seem to exist' % phrase)
                        break
                    self.append(SCStaticTextTerminal(phrase))
            else: #this should be a submenu
                menu = SCMenu()
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print ('warning: tried to link Silly PhaseFour phrase %s which does not seem to exist' % phrase)
                        break
                    menu.append(SCStaticTextTerminal(phrase))

                menuName = str(section[0])
                self.append( SCMenuHolder(menuName, menu) )
Ejemplo n.º 4
0
    def __resistanceMessagesChanged(self):
        # clear out everything from our menu
        self.clearMenu()

        # if local toon has not been created, don't panic
        try:
            lt = base.localAvatar
        except:
            return

        #create the necessary items in the appropriate submenus
        phrases = lt.resistanceMessages
        #create the menus
        for menuIndex in ResistanceChat.resistanceMenu:
            # build a submenu of a particular type (toonup, etc)
            menu = SCMenu()
            for itemIndex in ResistanceChat.getItems(menuIndex):
                textId = ResistanceChat.encodeId(menuIndex, itemIndex)
                charges = lt.getResistanceMessageCharges(textId)
                if charges > 0:
                    menu.append(TTSCResistanceTerminal(textId, charges))

            # add the menu to self (SpeedChat won't display empty menus)
            textId = ResistanceChat.encodeId(menuIndex, 0)
            menuName = ResistanceChat.getMenuName(textId)
            self.append(SCMenuHolder(menuName, menu))
    def __messagesChanged(self, carol):
        self.clearMenu()
        try:
            lt = base.localAvatar
        except:
            return

        winterMenu = []
        if carol:
            winterMenu.append(WinterMenu[0])
        winterMenu.append(WinterMenu[1])
        for section in winterMenu:
            if section[0] == -1:
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print 'warning: tried to link Winter phrase %s which does not seem to exist' % phrase
                        break
                    self.append(SCStaticTextTerminal(phrase))

            else:
                menu = SCMenu()
                for phrase in section[1].keys():
                    blatherTxt = section[1][phrase]
                    if blatherTxt not in OTPLocalizer.SpeedChatStaticText:
                        print 'warning: tried to link Winter phrase %s which does not seem to exist' % phrase
                        break
                    menu.append(
                        TTSCIndexedTerminal(
                            OTPLocalizer.SpeedChatStaticText.get(phrase, None),
                            blatherTxt))

                menuName = str(section[0])
                self.append(SCMenuHolder(menuName, menu))

        return
Ejemplo n.º 6
0
    def __messagesChanged(self, inSellbotFieldOffice):
        self.clearMenu()
        try:
            lt = base.localAvatar
        except:
            return

        for section in SellbotFieldOfficeMenu:
            if section[0] == -1:
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print('warning: tried to link Winter phrase %s which does not seem to exist' % phrase)
                        break
                    self.append(SCStaticTextTerminal(phrase))

            elif inSellbotFieldOffice:
                menu = SCMenu()
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print('warning: tried to link Halloween phrase %s which does not seem to exist' % phrase)
                        break
                    menu.append(SCStaticTextTerminal(phrase))

                menuName = str(section[0])
                self.append(SCMenuHolder(menuName, menu))
Ejemplo n.º 7
0
    def __boardingMessagesChanged(self, zoneId):
        # Clear out everything from our menu
        self.clearMenu()
        # If local toon has not been created, don't panic
        try:
            lt = base.localAvatar
        except:
            return
        for count in xrange(len(BoardingMenuGuide)):
            section = BoardingMenuGuide[count]
            if section[0] == -1:
                # This is not a submenu but a terminal!
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print(
                            'warning: tried to link boarding phrase %s which does not seem to exist'
                            % phrase)
                        break
                    self.append(SCStaticTextTerminal(phrase))
            else:
                # This should be a submenu, get the list of phrases from the corresponding zoneId
                menu = SCMenu()
                phrases = ZoneIdsToMsgs[zoneId][count]
                for phrase in phrases:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print(
                            'warning: tried to link boarding phrase %s which does not seem to exist'
                            % phrase)
                        break
                    menu.append(SCStaticTextTerminal(phrase))

                # add the menu to self (SpeedChat won't display empty menus)
                menuName = str(section[0])
                self.append(SCMenuHolder(menuName, menu))
Ejemplo n.º 8
0
    def __init__(self):
        SCMenu.__init__(self)
        self.meetMenuHolder = None
        zoneId = base.cr.playGame.getPlaceId()
        if zoneId and zoneId == 11000:
            meetMenu = SCMenu()
            for msgIndex in OTPLocalizer.SCFactoryMeetMenuIndexes:
                term = SCStaticTextTerminal(msgIndex)
                meetMenu.append(term)

            self.meetMenuHolder = SCMenuHolder.SCMenuHolder(
                OTPLocalizer.SCMenuFactoryMeet, meetMenu)
            self[0:0] = [self.meetMenuHolder]
        self.accept('factoryZoneChanged', self.__zoneChanged)
        self.__zoneChanged()
    def __messagesChanged(self):
        self.clearMenu()

        try:
            lt = base.localAvatar
        except:
            return

        for section in self.sections:
            if section[0] == -1:
                self.appendPhrases(section, self)
            else:
                menu = SCMenu()

                self.appendPhrases(section, menu)
                self.append(SCMenuHolder.SCMenuHolder(str(section[0]), menu))
Ejemplo n.º 10
0
    def __init__(self):
        SCMenu.__init__(self)

        self.meetMenuHolder = None
        # the meet menu really only makes sense for Sellbot HQ
        zoneId = base.cr.playGame.getPlaceId()
        if zoneId and (zoneId == 11000):
            meetMenu = SCMenu()
            for msgIndex in OTPLocalizer.SCFactoryMeetMenuIndexes:
                term = SCStaticTextTerminal(msgIndex)
                meetMenu.append(term)
            self.meetMenuHolder = SCMenuHolder.SCMenuHolder(
                OTPLocalizer.SCMenuFactoryMeet, meetMenu)
            self[0:0] = [self.meetMenuHolder]

        # listen for changes to the factory location
        self.accept("factoryZoneChanged", self.__zoneChanged)
        self.__zoneChanged()
    def __resistanceMessagesChanged(self):
        self.clearMenu()
        try:
            lt = base.localAvatar
        except:
            return

        phrases = lt.resistanceMessages
        for menuIndex in ResistanceChat.resistanceMenu:
            menu = SCMenu()
            for itemIndex in ResistanceChat.getItems(menuIndex):
                textId = ResistanceChat.encodeId(menuIndex, itemIndex)
                charges = lt.getResistanceMessageCharges(textId)
                if charges > 0:
                    menu.append(TTSCResistanceTerminal(textId, charges))

            textId = ResistanceChat.encodeId(menuIndex, 0)
            menuName = ResistanceChat.getMenuName(textId)
            self.append(SCMenuHolder(menuName, menu))
Ejemplo n.º 12
0
    def __messagesChanged(self, carol):
        # clear out everything from our menu
        self.clearMenu()
        # if local toon has not been created, don't panic
        try:
            lt = base.localAvatar
        except:
            return
        winterMenu = []
        if carol:
            winterMenu.append(WinterMenu[0])
        winterMenu.append(WinterMenu[1])
        for section in winterMenu:
            if section[0] == -1:
                #This is not a submenu but a terminal!
                for phrase in section[1]:
                    if phrase not in OTPLocalizer.SpeedChatStaticText:
                        print((
                            'warning: tried to link Winter phrase %s which does not seem to exist'
                            % phrase))
                        break
                    self.append(SCStaticTextTerminal(phrase))
            else:  #this should be a submenu
                menu = SCMenu()
                for phrase in section[1].keys():
                    blatherTxt = section[1][phrase]
                    if blatherTxt not in OTPLocalizer.SpeedChatStaticText:
                        print((
                            'warning: tried to link Winter phrase %s which does not seem to exist'
                            % phrase))
                        break
                    menu.append(
                        TTSCIndexedTerminal(
                            OTPLocalizer.SpeedChatStaticText.get(phrase, None),
                            blatherTxt))

                menuName = str(section[0])
                self.append(SCMenuHolder(menuName, menu))