Changeset 259


Ignore:
Timestamp:
03/24/12 06:28:46 (3 years ago)
Author:
mmorton
Message:
 
Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/fileio.py

    r234 r259  
    2323
    2424buildingDir = dataDir + os.sep + "buildings" + os.sep
     25
     26arrowsDir = imageDir + os.sep + 'arrows' + os.sep
  • src/main.py

    r258 r259  
    1818import menuEntry
    1919import map
     20import spinner
    2021from buildables import buildingLUT
    21 import spinner
     22
    2223
    2324def Initialize():
  • src/menuEntry.py

    r248 r259  
    1515class MenuEntry(Window):
    1616    def __init__(self, pos, visible, description):
     17        print 'window entry: ' + str(self)
    1718        Window.__init__(self, pos, visible)
    1819
  • src/spinner.py

    r258 r259  
    1414class Spinner(Window):
    1515   
    16     def __init___(self, pos, visible, startValue = 0, max = 1000, min = 0, step = 10):
     16    def __init__(self, pos, visible, startValue = 0, maximum = 1000, minimum = 0, step = 10):
     17        print 'initialized spinner early: ' + str(self)
    1718        Window.__init__(self, pos, visible)
     19        print 'initialized spinner: ' + str(self)
    1820        self.value = startValue
    19         self.max = max
    20         self.min = min
     21        self.max = maximum
     22        self.min = minimum
    2123        self.step = step
    2224       
    2325        up = UpDown(self.pos, False, True)
    2426        down = UpDown((self.pos[0], self.pos[1] + 50), True, False)
    25         up.addResponse((self.updatevalue,True))
    26         down.addResponse((self.updatevalue,False))
     27        up.addResponse((self.updateValue,True))
     28        down.addResponse((self.updateValue,False))
     29
    2730
    2831        self.subwindows.append(up)
    2932        self.subwindows.append(down)
    3033        self.text.append(Text((60, 25), str(self.value), MD_TEXT, CYAN))
    31         self.addRectangle(Rect((0,0) , 300, 300, BLUE))
     34        #self.addRectangle(Rect((0,0) , 300, 300, BLUE))
    3235
    3336    def updateValue(self,isUp):
    34         if isUp and (self.value + self.step) <= max:
     37        if isUp and (self.value + self.step) <= self.max:
    3538            self.value += self.step
    36         elif (self.value - self.step) >= 0:
     39        elif (self.value - self.step) >= self.min:
    3740            self.value -= self.step
    3841
  • src/upDown.py

    r258 r259  
    1414        Window.__init__(self, pos, visible)
    1515        if isUp:
    16             icon = pygame.image.load(mapDir + "left.png")
     16            icon = pygame.image.load(arrowsDir + "up.png")
    1717        else:
    18             icon = pygame.image.load(mapDir+ "right.png")
     18            icon = pygame.image.load(arrowsDir + "down.png")
    1919
    20         self.images.append(Image((self.pos, self.pos), 44, 44, icon))
     20        self.images.append(Image(self.pos, 44, 44, icon))
Note: See TracChangeset for help on using the changeset viewer.