Changeset 267 for src/story.py


Ignore:
Timestamp:
06/12/2012 05:03:41 PM (3 years ago)
Author:
andefodahl
Message:

Hopefully revamped hover system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/story.py

    r262 r267  
    209209    def update(self, valueChange):
    210210        """updates a Puzzle"""
     211        for toggle in range(len(self.toggleList)):
     212            if toggle == self.selectedToggle:
     213                print str(self.selectedToggle)
     214                self.toggleList[self.selectedToggle].hover = True
     215                self.toggleList[self.selectedToggle].play = True
     216            else:
     217                self.toggleList[toggle].hover = False
     218                self.toggleList[toggle].play = False
    211219        if valueChange == "Continue": #Mode is Intro, Victory, or End
    212220            if self.puzzleState == BBUILDER.INTRO:
     
    245253        """changes location of cursor. Called by EventHandler."""
    246254        if self.selectedToggle != None:
    247             self.toggleList[self.selectedToggle].hover = False
    248             self.toggleList[self.selectedToggle].play = False
    249255            if self.selectedToggle != 0:
    250256                self.selectedToggle += -1
    251257            else: self.selectedToggle = len(self.toggleList) - 1
    252             self.toggleList[self.selectedToggle].hover = True
    253             self.toggleList[self.selectedToggle].play = True
    254258        else:
    255259            self.selectedToggle = 0
    256             self.toggleList[self.selectedToggle].hover = True
    257             self.toggleList[self.selectedToggle].play = True
    258260
    259261    def selectToggleNext(self):
    260262        """changes location of cursor. Called by EventHandler."""
    261263        if self.selectedToggle != None:
    262             self.toggleList[self.selectedToggle].hover = False
    263             self.toggleList[self.selectedToggle].play = False
    264264            if self.selectedToggle != len(self.toggleList) - 1:
    265265                self.selectedToggle += 1
    266266            else: self.selectedToggle = 0
    267             self.toggleList[self.selectedToggle].hover = True
    268             self.toggleList[self.selectedToggle].play = True
    269267        else:
    270268            self.selectedToggle = 0
    271             self.toggleList[self.selectedToggle].hover = True
    272             self.toggleList[self.selectedToggle].play = True
    273269
    274270    def draw(self):
    275         """draws a Puzzle by calling the appropriate function"""
     271        """draws a Puzzle by calling the appropriate function""" 
    276272        if self.puzzleState == BBUILDER.INTRO:
    277273            self.drawIntro()
Note: See TracChangeset for help on using the changeset viewer.