Esempio n. 1
0
 def selectall(self):
     snd.play('select_choose')
     self.clearactionlist()
     if NOEVENT not in input.translations:
         input.translations[NOEVENT] = {}
     input.translations[NOEVENT][KEYDOWN] = input.actions_order[self.currentaction]
     input.translations[NOEVENT][JOYBUTTONDOWN] = input.actions_order[self.currentaction]
     self.display = input.getdisplay()
     self.buildactionlist()
     self.drawactionlist()
     self.inputstate = BUTTONS
     self.moveto(self.targetbutton())
Esempio n. 2
0
 def selectall(self):
     snd.play('select_choose')
     self.clearactionlist()
     if not input.translations.has_key(pygame.NOEVENT):
         input.translations[pygame.NOEVENT] = {}
     input.translations[pygame.NOEVENT][pygame.KEYDOWN] = input.actions_order[self.currentaction]
     input.translations[pygame.NOEVENT][pygame.JOYBUTTONDOWN] = input.actions_order[self.currentaction]
     self.display = input.getdisplay()
     self.buildactionlist()
     self.drawactionlist()
     self.inputstate = BUTTONS
     self.moveto(self.targetbutton())
Esempio n. 3
0
    def buildactionlist(self):
        clr = 160, 200, 250
        clr2 = 200, 200, 200
        offsety = 90
        sizey = 75
        sizex = 800
        self.actionlist = []
        self.display = input.getdisplay()
        for a in input.actions_order:
            if gfx.surface.get_bitsize() > 8:
                img = pygame.Surface((sizex, sizey))
            else:
                img = pygame.Surface((sizex, sizey), 0, 32)

            subimgs = []

            subimgs.append((namefont.render(input.actions_text[a], 1,
                                            clr), (80, 0)))

            for l in range(len(self.display[a])):
                text = input.input_text(self.display[a][l][0],
                                        self.display[a][l][1])
                subimg = textfont.render(text, 1, clr2)
                r = subimg.get_rect()
                r.topleft = self.controlrectlist[l].topleft
                subimgs.append((subimg, r))

            for b in self.buttonlist:
                subimgs.append(b)

            bgd = 0, 0, 0
            img.fill(bgd)
            for sub, pos in subimgs:
                img.blit(sub, pos)
            img.set_colorkey(bgd, RLEACCEL)
            #img = img.convert()
            rect = img.get_rect().move(0, offsety)

            self.actionlist.append((img, rect))
            offsety += sizey
Esempio n. 4
0
    def buildactionlist(self):
        clr = 160, 200, 250
        clr2 = 200, 200, 200
        offsety = 90
        sizey = 75
        sizex = 800
        self.actionlist = []
        self.display = input.getdisplay()
        for a in input.actions_order:
            if gfx.surface.get_bitsize() > 8:
                img = pygame.Surface((sizex, sizey))
            else:
                img = pygame.Surface((sizex, sizey), 0, 32)

            subimgs = []

            subimgs.append((namefont.render(input.actions_text[a], 1, clr), (80, 0)))

            for l in range(len(self.display[a])):
                text = input.input_text(self.display[a][l][0],self.display[a][l][1])
                subimg = textfont.render(text, 1, clr2)
                r = subimg.get_rect()
                r.topleft = self.controlrectlist[l].topleft
                subimgs.append((subimg, r))

            for b in self.buttonlist:
                subimgs.append(b)

            bgd = 0, 0, 0
            img.fill(bgd)
            for sub, pos in subimgs:
                img.blit(sub, pos)
            img.set_colorkey(bgd, pygame.RLEACCEL)
            rect = img.get_rect().move(0, offsety)

            self.actionlist.append((img, rect))
            offsety += sizey