Changeset 248


Ignore:
Timestamp:
03/24/2012 04:02:40 AM (3 years ago)
Author:
mmorton
Message:
 
Location:
src
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/inGameMenu.py

    r239 r248  
    2727        self.images.append(Image((120,10),IMG_SM,IMG_SM,art))
    2828        self.images.append(Image((345,10),IMG_SM,IMG_SM,art))
     29       
     30    def openWindow(self):
     31        """
     32            opens the window, rendering it visible.
     33           
     34            input type: none
     35            return type: none
     36        """
     37        self.visible = True
     38        for window in self.subwindows:
     39            window.openWindow()
    2940                         
    3041       
  • src/main.py

    r244 r248  
    1515import inGameMenu
    1616import sys
     17import description
     18import menuEntry
    1719
    1820def Initialize():
     
    3234    newBackground = background.Background((0,0),True,'background.png')
    3335   
     36    ###########################################################################################################
     37       
     38    buildPowerDescription = description.Description('power',
     39                                                    "This is where the text would go.",
     40                                                    pygame.image.load(os.path.abspath(iconDir + "power.png")))
     41    buildPowerButton = menuEntry.MenuEntry((20,100+ENTRY_SHIFT*0),False,buildPowerDescription)
     42   
     43    buildTransportationDescription = description.Description('transportation',
     44                                                    "This is where the text would go.",
     45                                                    pygame.image.load(os.path.abspath(iconDir + "transportation.png")))
     46    buildTransportationButton = menuEntry.MenuEntry((20,100+ENTRY_SHIFT*1),False,buildTransportationDescription)
     47   
     48    buildMaterialDescription = description.Description('material',
     49                                                    "This is where the text would go.",
     50                                                    pygame.image.load(os.path.abspath(iconDir + "material.png")))
     51    buildMaterialButton = menuEntry.MenuEntry((20,100+ENTRY_SHIFT*2),False,buildMaterialDescription)
     52   
    3453    buildMenu = inGameMenu.InGameMenu((20,20),False,'BUILD EMU','build.png')
     54    buildMenu.addWindow(buildPowerButton)
     55    buildMenu.addWindow(buildTransportationButton)
     56    buildMenu.addWindow(buildMaterialButton)
     57   
     58    ###########################################################################################################
     59   
     60    researchPowerDescription = description.Description('power',
     61                                                    "This is where the text would go.",
     62                                                    pygame.image.load(os.path.abspath(iconDir + "power.png")))
     63    researchPowerButton = menuEntry.MenuEntry((20,100+ENTRY_SHIFT*0),False,researchPowerDescription)
     64   
     65    researchTransportationDescription = description.Description('transportation',
     66                                                    "This is where the text would go.",
     67                                                    pygame.image.load(os.path.abspath(iconDir + "transportation.png")))
     68    researchTransportationButton = menuEntry.MenuEntry((20,100+ENTRY_SHIFT*1),False,researchTransportationDescription)
     69   
     70    researchMaterialDescription = description.Description('material',
     71                                                    "This is where the text would go.",
     72                                                    pygame.image.load(os.path.abspath(iconDir + "material.png")))
     73    researchMaterialButton = menuEntry.MenuEntry((20,100+ENTRY_SHIFT*2),False,researchMaterialDescription)
    3574
    3675    researchMenu = inGameMenu.InGameMenu((20,20),False,'RESEARCH EMU','research.png')
     76    researchMenu.addWindow(researchPowerButton)
     77    researchMenu.addWindow(researchTransportationButton)
     78    researchMenu.addWindow(researchMaterialButton)
     79   
     80    ###########################################################################################################
    3781
    3882    researchButton = onScreenButton.OnScreenButton((20 + 169,720), True,'RESEARCH')
    3983    researchButton.addWindow(researchMenu)   
    4084    researchButton.addResponse((researchMenu.toggle,))
    41     researchButton.addResponse((buildMenu.closeWindow,))
    42    
    43    
    44     undoButton = onScreenButton.OnScreenButton((20 + 169*2,720), True,'UNDO TURN')
    45    
    46    
    47    
     85    researchButton.addResponse((buildMenu.closeWindow,))
    4886   
    4987    buildButton = onScreenButton.OnScreenButton((20,720),True,'BUILD')
     
    5189    buildButton.addResponse((buildMenu.toggle,))
    5290    buildButton.addResponse((researchMenu.closeWindow,))
     91   
     92    undoButton = onScreenButton.OnScreenButton((20 + 169*2,720), True,'UNDO TURN')
     93   
     94    map
    5395   
    5496    ############################################################################################
  • src/map.py

    r245 r248  
    1010from text import Text
    1111from globals import *
     12from block import Block
    1213
    1314class Map(Window):
  • src/window.py

    r243 r248  
    184184        """
    185185        if self.visible == False:
    186             self.visible = True
    187         else:
    188             self.visible = False
     186            self.openWindow()
     187        else:
     188            self.closeWindow()
    189189       
    190190    def openWindow(self):
Note: See TracChangeset for help on using the changeset viewer.