Changeset 763


Ignore:
Timestamp:
06/05/2012 04:07:21 PM (3 years ago)
Author:
ecoughlan
Message:

Fixed research values bug -- Tutorial is still broken

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/info.py

    r673 r763  
    7373        """
    7474        self.title = CAT_LUT[researchCat]
    75         if not nextUnlock[0] == "":
     75        if not nextUnlock[0] == "" and not nextUnlock[0] == "NO":
    7676            if isDetailed:
    7777                self.text = STR.WILL_UNLOCK % (nextUnlock[0], nextUnlock[1])
    7878            else:
    7979                self.text = STR.NEXT_UNLOCK % nextUnlock[0]
     80        elif nextUnlock[0] == "NO":
     81            self.text = STR.NO_MONEY
    8082        else:
    8183            self.text = STR.NO_UNLOCK
  • src/main.py

    r758 r763  
    1212import pygame
    1313from pygame.locals import *
    14 #import pygame._view # uncomment to use pygame2exe.py
     14import pygame._view # uncomment to use pygame2exe.py
    1515
    1616from top import Top
     
    228228
    229229    ###########################################################################
     230    """
    230231    # Setup tutorial
    231232    tutorial = Tutorial()
     
    239240
    240241    # Research power description research button
    241     tutorial.addWindow(TutBut(rCatMenu.subwindows[rPowButtonIndex].getElementByAttrRecursive(SimpleButton, "affirmative")))
     242    tutRButton = rCatMenu.subwindows[rPowButtonIndex].getElementByAttrRecursive(SimpleButton, "affirmative")
     243    #tutRButton = rCatMenu.subwindows[rPowButtonIndex].subwindows[0].subwindows[0]
     244    tutorial.addWindow(TutBut(tutRButton))
    242245
    243246    # Build Button
     
    261264
    262265    top.addTutorialWindow(tutorial)
     266    """
    263267
    264268    top.addGameWindow(gameBackground)
  • src/researchDescription.py

    r758 r763  
    1818        """
    1919        DetailedDescription.__init__(self, visible, True, info)
     20        if unlock[0] == "NO" or unlock[0] == "":
     21            print "no research button"
     22            yesButtonIndex = self.getElementByAttr(SimpleButton, "affirmative")
     23            self.subwindows.pop(yesButtonIndex)
    2024        self.unlock = unlock
    2125
     
    3236            self.subwindows[yesButtonIndex].addResponse((response[0], response[1],
    3337                                                         self.unlock[1]))
    34 
    35     def returnUnlock(self):
    36         return self.unlock[1]
  • src/state.py

    r759 r763  
    310310
    311311        else:
     312            currentSpec = self.specValues + self.specDelta
    312313            # find the min amount
    313314            minimum = ("", float("inf"))
     
    315316                if value < minimum[1]:
    316317                    minimum = (name, value)
    317             return minimum
     318            if currentSpec.getMoney() - minimum[1] < 0:
     319                return ("NO", float("inf"))
     320            else:
     321                return minimum
    318322
    319323    def checkThresh(self, buildingName):
  • src/strings.py

    r631 r763  
    2828COST = "Costs\n%s"
    2929NO_UNLOCK = "Nothing more to unlock."
     30NO_MONEY = "You don't have enough money to unlock this."
    3031NEXT_UNLOCK = "Next unlock is a %s."
    3132WILL_UNLOCK = "You will unlock a %s in %d dollars."
Note: See TracChangeset for help on using the changeset viewer.