Exemple #1
0
 def createFlowerPicker(self):
     if not hasattr(self, 'picker'):
         self.picker = FlowerPicker.FlowerPicker(self)
         self.picker.setPos(-0.55500000000000005, 0, 0.10000000000000001)
         self.picker.setScale(0.94999999999999996)
         self.FUDGE_FACTOR = 0.01
         self.barLength = 1.1000000000000001
         self.shovelBar = DirectWaitBar(parent = self.picker, pos = (0.94999999999999996, 0, -0.55000000000000004), relief = DGG.SUNKEN, frameSize = (-0.65000000000000002, 1.05, -0.10000000000000001, 0.10000000000000001), borderWidth = (0.025000000000000001, 0.025000000000000001), scale = 0.45000000000000001, frameColor = (0.80000000000000004, 0.80000000000000004, 0.69999999999999996, 1), barColor = (0.59999999999999998, 0.40000000000000002, 0.20000000000000001, 1), range = self.barLength + self.FUDGE_FACTOR, value = self.barLength * 0.5 + self.FUDGE_FACTOR, text = ' ' + TTLocalizer.Laff, text_scale = 0.11, text_fg = (0.050000000000000003, 0.14000000000000001, 0.20000000000000001, 1), text_align = TextNode.ALeft, text_pos = (-0.56999999999999995, -0.035000000000000003))
         self.wateringCanBar = DirectWaitBar(parent = self.picker, pos = (0.94999999999999996, 0, -0.75), relief = DGG.SUNKEN, frameSize = (-0.65000000000000002, 1.05, -0.10000000000000001, 0.10000000000000001), borderWidth = (0.025000000000000001, 0.025000000000000001), scale = 0.45000000000000001, frameColor = (0.80000000000000004, 0.80000000000000004, 0.69999999999999996, 1), barColor = (0.40000000000000002, 0.59999999999999998, 1.0, 1), range = self.barLength + self.FUDGE_FACTOR, value = self.barLength * 0.5 + self.FUDGE_FACTOR, text = ' ' + TTLocalizer.Laff, text_scale = 0.11, text_fg = (0.050000000000000003, 0.14000000000000001, 0.20000000000000001, 1), text_align = TextNode.ALeft, text_pos = (-0.56999999999999995, -0.035000000000000003))
 def __init__(self, doneEvent):
     DirectFrame.__init__(self,
                          relief=None,
                          state='normal',
                          geom=DGG.getDefaultDialogGeom(),
                          geom_color=ToontownGlobals.GlobalDialogColor,
                          geom_scale=(2.0, 1, 1.5),
                          frameSize=(-1, 1, -1, 1),
                          pos=(0, 0, 0),
                          text='',
                          text_wordwrap=26,
                          text_scale=TTLocalizer.FSGUIdirectFrame,
                          text_pos=(0, 0.65))
     self.initialiseoptions(FlowerSellGUI)
     self.doneEvent = doneEvent
     self.picker = FlowerPicker.FlowerPicker(self)
     self.picker.load()
     self.picker.setPos(-0.59, 0, 0.03)
     self.picker.setScale(0.93)
     newBasketFlower = base.localAvatar.flowerBasket.getFlower()
     self.picker.update(newBasketFlower)
     self.picker.show()
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     okImageList = (buttons.find('**/ChtBx_OKBtn_UP'),
                    buttons.find('**/ChtBx_OKBtn_DN'),
                    buttons.find('**/ChtBx_OKBtn_Rllvr'))
     cancelImageList = (buttons.find('**/CloseBtn_UP'),
                        buttons.find('**/CloseBtn_DN'),
                        buttons.find('**/CloseBtn_Rllvr'))
     self.cancelButton = DirectButton(
         parent=self,
         relief=None,
         image=cancelImageList,
         pos=(0.3, 0, -0.58),
         text=TTLocalizer.FlowerGuiCancel,
         text_scale=TTLocalizer.FSGUIcancelButton,
         text_pos=(0, -0.1),
         command=self.__cancel)
     self.okButton = DirectButton(parent=self,
                                  relief=None,
                                  image=okImageList,
                                  pos=(0.6, 0, -0.58),
                                  text=TTLocalizer.FlowerGuiOk,
                                  text_scale=TTLocalizer.FSGUIokButton,
                                  text_pos=(0, -0.1),
                                  command=self.__sellFlower)
     buttons.removeNode()
     self.__updateFlowerValue()
     base.cr.playGame.getPlace().detectedFlowerSellUse()
Exemple #3
0
    def createFlowerPicker(self):
        """
        Baseket Tab
        """
        if not hasattr(self, "picker"):
            # create the various display elements
            self.picker = FlowerPicker.FlowerPicker(self)
            self.picker.setPos(-0.555, 0, 0.1)
            self.picker.setScale(0.95)


            # shovel info
            #self.shovel = DirectLabel(
            #    parent = self.picker,
            #    relief = None,
            #    text = "",
            #    text_align = TextNode.ALeft,
            #    text_scale = 0.06,
            #    pos = (0.65,0,-0.65),
            #    )

            self.FUDGE_FACTOR = 0.01
            self.barLength = 1.1
            self.shovelBar = DirectWaitBar(
                            parent = self.picker,
                            pos = (0.95,0,-0.55),
                            relief = DGG.SUNKEN,
                            frameSize = (-0.65,1.05,-0.1,0.1),
                            borderWidth = (0.025,0.025),
                            scale = 0.45,
                            frameColor = (0.8,0.8,0.7,1),
                            barColor = (0.6,0.4,0.2,1),
                            # A small number was added to these to prevent small
                            # values from not being rendered at odd resolutions.
                            range = self.barLength + self.FUDGE_FACTOR,
                            value = (self.barLength * 0.5) + self.FUDGE_FACTOR,
                            text = " " + TTLocalizer.Laff,
                            text_scale = 0.11,
                            text_fg = (0.05,0.14,0.2,1),
                            text_align = TextNode.ALeft,
                            text_pos = (-0.57,-0.035),
                            )

            self.wateringCanBar = DirectWaitBar(
                            parent = self.picker,
                            pos = (0.95,0,-0.75),
                            relief = DGG.SUNKEN,
                            frameSize = (-0.65,1.05,-0.1,0.1),
                            borderWidth = (0.025,0.025),
                            scale = 0.45,
                            frameColor = (0.8,0.8,0.7,1),
                            barColor = (0.4,0.6,1.0,1),
                            # A small number was added to these to prevent small
                            # values from not being rendered at odd resolutions.
                            range = self.barLength + self.FUDGE_FACTOR,
                            value = (self.barLength * 0.5)  + self.FUDGE_FACTOR,
                            text = " " + TTLocalizer.Laff,
                            text_scale = 0.11,
                            text_fg = (0.05,0.14,0.2,1),
                            text_align = TextNode.ALeft,
                            text_pos = (-0.57,-0.035),
                            )