def createGui(self): ShipFrame.createGui(self) if self['shipName']: self.nameLabel = DirectLabel( parent=self, relief=DGG.FLAT, state=DGG.DISABLED, text=self['shipName'], text_font=PiratesGlobals.getInterfaceFont(), text_align=TextNode.ALeft, text_scale=PiratesGuiGlobals.TextScaleMed, text_pos=(0.04, 0.015), text_fg=PiratesGuiGlobals.TextFG1, text_shadow=PiratesGuiGlobals.TextShadow, textMayChange=1, frameColor=PiratesGuiGlobals.ButtonColor1[3], frameSize=(self['frameSize'][0] + 0.02, self['frameSize'][1] - 0.02, 0, 0.05), pos=(0, 0, self['frameSize'][3] - 0.06)) if self['shipClass']: self.classLabel = DirectLabel( parent=self.nameLabel, relief=None, state=DGG.DISABLED, text=PLocalizer.ShipClassNames.get(self['shipClass']), text_scale=PiratesGuiGlobals.TextScaleMed, text_align=TextNode.ARight, text_fg=PiratesGuiGlobals.TextFG2, text_shadow=(0, 0, 0, 1), text_wordwrap=15, textMayChange=0, text_pos=(self.nameLabel['frameSize'][1] - 0.02, 0.015), text_font=PiratesGlobals.getInterfaceFont()) return
def setPos(self, *args, **kwargs): ShipFrame.setPos(self, *args, **args) if self.statTrigger: self.statTrigger.reparentTo(self) self.statTrigger.setPos(self.statFrame.getPos()) self.statTrigger.wrtReparentTo(self.getParent()) self.reparentTo(self.getParent())
def __init__(self, parent, **kw): gui = loader.loadModel('models/gui/toplevel_gui') image = (gui.find('**/generic_button'), gui.find('**/generic_button_down'), gui.find('**/generic_button_over'), gui.find('**/generic_button_disabled')) optiondefs = (('relief', 0, None), ('frameSize', (0.0, 0.9, 0.0, 0.42), None), ('image', image[3], None), ('image_pos', (0.45, 0.0, 0.208), None), ('image_scale', (0.94, 1, 1.1), None), ('image_color', (0.8, 0.8, 0.8, 1), None), ('frameColor', (1, 1, 1, 0.9), None), ('snapShotPos', (-0.04, 0, -0.08), None), ('shipPos', VBase3(0.2, 0, 0.08), None), ('shipHpr', VBase3(-70, 6, 15), None), ('shipScale', VBase3(0.55), None), ('time', 0, None), ('command', None, None), ('extraArgs', [], None)) self.nameLabel = None self.classLabel = None self.typeLabel = None self.stateLabel = None self.button = None self.snapShot = None self.defineoptions(kw, optiondefs) ShipFrame.__init__(self, parent, **kw) self.initialiseoptions(ShipFrameBoard) return None
def setPos(self, *args, **kwargs): ShipFrame.setPos(self, *args, **kwargs) if self.statTrigger: self.statTrigger.reparentTo(self) self.statTrigger.setPos(self.statFrame.getPos()) self.statTrigger.wrtReparentTo(self.getParent()) self.reparentTo(self.getParent())
def createGui(self): ShipFrame.createGui(self) if self['shipName']: self.nameLabel = DirectLabel(parent = self, relief = DGG.FLAT, state = DGG.DISABLED, text = self['shipName'], text_font = PiratesGlobals.getInterfaceFont(), text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleMed, text_pos = (0.040000000000000001, 0.014999999999999999), text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, frameColor = PiratesGuiGlobals.ButtonColor1[3], frameSize = (self['frameSize'][0] + 0.02, self['frameSize'][1] - 0.02, 0, 0.050000000000000003), pos = (0, 0, self['frameSize'][3] - 0.059999999999999998)) if self['shipClass']: self.classLabel = DirectLabel(parent = self.nameLabel, relief = None, state = DGG.DISABLED, text = PLocalizer.ShipClassNames.get(self['shipClass']), text_scale = PiratesGuiGlobals.TextScaleMed, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = (0, 0, 0, 1), text_wordwrap = 15, textMayChange = 0, text_pos = (self.nameLabel['frameSize'][1] - 0.02, 0.014999999999999999), text_font = PiratesGlobals.getInterfaceFont())
def destroy(self): self.nameLabel = None self.classLabel = None self.typeLabel = None self.stateLabel = None self.button = None self.snapShot = None ShipFrame.destroy(self)
def createGui(self): ShipFrame.createGui(self) self.nameLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = PLocalizer.makeHeadingString(self['shipName'], 2), text_align = TextNode.ALeft, text_scale = 0.050000000000000003, text_pos = (0.059999999999999998, 0.014999999999999999), text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, frameColor = PiratesGuiGlobals.ButtonColor1[3], frameSize = (self['frameSize'][0] + 0.040000000000000001, self['frameSize'][1] - 0.029999999999999999, -0.0, 0.050000000000000003), pos = (0, 0, self['frameSize'][3] - 0.089999999999999997)) self.classLabel = DirectLabel(parent = self.nameLabel, relief = None, state = DGG.DISABLED, text = PLocalizer.makeHeadingString(PLocalizer.ShipClassNames.get(self['shipClass']), 1), text_font = PiratesGlobals.getInterfaceFont(), text_scale = PiratesGuiGlobals.TextScaleMed, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = (0, 0, 0, 1), textMayChange = 1, text_pos = (self.nameLabel['frameSize'][0] + 0.02, -0.029999999999999999)) self.typeLabel = DirectLabel(parent = self.nameLabel, relief = None, state = DGG.DISABLED, text = '', text_pos = (0.59999999999999998, -0.029999999999999999), text_font = PiratesGlobals.getInterfaceFont(), text_scale = 0.032000000000000001, text_align = TextNode.ARight, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = (0, 0, 0, 1), textMayChange = 0) self.stateLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = '', text_font = PiratesGlobals.getInterfaceFont(), text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = (0, 0, 0, 1), text_pos = (0.19, 0.070000000000000007), text_scale = PiratesGuiGlobals.TextScaleLarge, textMayChange = 0) gui = loader.loadModel('models/gui/toplevel_gui') geomCheck = gui.find('**/generic_check') self.button = GuiButton(parent = self, pos = (0.73999999999999999, 0, 0.080000000000000002), text = PLocalizer.SelectShip, text_scale = PiratesGuiGlobals.TextScaleLarge, text_font = PiratesGlobals.getInterfaceFont(), text_pos = (0.035000000000000003, -0.014), geom = (geomCheck,) * 4, geom_pos = (-0.059999999999999998, 0, 0), geom_scale = 0.5, geom0_color = PiratesGuiGlobals.ButtonColor6[0], geom1_color = PiratesGuiGlobals.ButtonColor6[1], geom2_color = PiratesGuiGlobals.ButtonColor6[2], geom3_color = PiratesGuiGlobals.ButtonColor6[3], image3_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1), helpPos = (-0.40000000000000002, 0, 0.029999999999999999), helpDelay = 0.29999999999999999, command = self['command'], extraArgs = self['extraArgs'])
def __init__(self, parent, **kw): optiondefs = (('frameSize', (0, 0.90000000000000002, 0.0, 0.53000000000000003), None), ('frameColor', PiratesGuiGlobals.ButtonColor1, None), ('relief', DGG.FLAT, None), ('shipPos', VBase3(0.57999999999999996, 0, 0.13), None), ('shipHpr', VBase3(-70, 6, 15), None), ('shipScale', VBase3(0.65000000000000002), None), ('inBottle', True, self.setInBottle)) self.nameLabel = None self.classLabel = None self.statFrame = None self.statTrigger = None self.defineoptions(kw, optiondefs) ShipFrame.__init__(self, parent, **None) self.initialiseoptions(ShipFrameBottle) self.accept('within-%s' % self.guiId, self.mouseOver) self.accept('without-%s' % self.guiId, self.mouseOff)
def __init__(self, parent, **kw): gui = loader.loadModel('models/gui/toplevel_gui') image = (gui.find('**/generic_button'), gui.find('**/generic_button_down'), gui.find('**/generic_button_over'), gui.find('**/generic_button_disabled')) optiondefs = (('relief', 0, None), ('frameSize', (0.0, 0.90000000000000002, 0.0, 0.41999999999999998), None), ('image', image[3], None), ('image_pos', (0.45000000000000001, 0.0, 0.20799999999999999), None), ('image_scale', (0.93999999999999995, 1, 1.1000000000000001), None), ('image_color', (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1), None), ('frameColor', (1, 1, 1, 0.90000000000000002), None), ('snapShotPos', (-0.040000000000000001, 0, -0.080000000000000002), None), ('shipPos', VBase3(0.76000000000000001, 0, 0.14999999999999999), None), ('shipHpr', VBase3(-70, 6, 15), None), ('shipScale', VBase3(0.55000000000000004), None), ('shipType', ShipFrameSelect.STOwn, None), ('command', None, None), ('extraArgs', [], None)) self.nameLabel = None self.classLabel = None self.typeLabel = None self.stateLabel = None self.button = None self.snapShot = None self.defineoptions(kw, optiondefs) ShipFrame.__init__(self, parent, **None) self.initialiseoptions(ShipFrameSelect)
def __init__(self, parent, **kw): gui = loader.loadModel('models/gui/toplevel_gui') image = (gui.find('**/generic_button'), gui.find('**/generic_button_down'), gui.find('**/generic_button_over'), gui.find('**/generic_button_disabled')) optiondefs = (('relief', 0, None), ('frameSize', (0.0, 0.90000000000000002, 0.0, 0.41999999999999998), None), ('image', image[3], None), ('image_pos', (0.45000000000000001, 0.0, 0.20799999999999999), None), ('image_scale', (0.93999999999999995, 1, 1.1000000000000001), None), ('image_color', (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1), None), ('frameColor', (1, 1, 1, 0.90000000000000002), None), ('snapShotPos', (-0.040000000000000001, 0, -0.080000000000000002), None), ('shipPos', VBase3(0.76000000000000001, 0, 0.14999999999999999), None), ('shipHpr', VBase3(-70, 6, 15), None), ('shipScale', VBase3(0.55000000000000004), None), ('shipType', ShipFrameSelect.STOwn, None), ('command', None, None), ('extraArgs', [], None)) self.nameLabel = None self.classLabel = None self.typeLabel = None self.stateLabel = None self.button = None self.snapShot = None self.defineoptions(kw, optiondefs) ShipFrame.__init__(self, parent) self.initialiseoptions(ShipFrameSelect)
def destroy(self): self.ignore('within-%s' % self.guiId) self.ignore('without-%s' % self.guiId) if self.statTrigger: self.ignore('within-%s' % self.statTrigger.guiId) self.ignore('without-%s' % self.statTrigger.guiId) self.nameLabel = None self.classLabel = None self.statFrame = None if self.statTrigger: self.statTrigger.destroy() self.statTrigger = None ShipFrame.destroy(self) return
def __init__(self, parent, **kw): optiondefs = ( ( 'frameSize', (0, 0.9, 0.0, 0.53), None), ('frameColor', PiratesGuiGlobals.ButtonColor1, None), ('relief', DGG.FLAT, None), ('shipPos', VBase3(0.58, 0, 0.13), None), ('shipHpr', VBase3(-70, 6, 15), None), ('shipScale', VBase3(0.65), None), ('inBottle', True, self.setInBottle)) self.nameLabel = None self.classLabel = None self.statFrame = None self.statTrigger = None self.defineoptions(kw, optiondefs) ShipFrame.__init__(self, parent, **kw) self.initialiseoptions(ShipFrameBottle) self.accept('within-%s' % self.guiId, self.mouseOver) self.accept('without-%s' % self.guiId, self.mouseOff) return
def destroy(self): self.ignore('within-%s' % self.guiId) self.ignore('without-%s' % self.guiId) if self.statTrigger: self.ignore('within-%s' % self.statTrigger.guiId) self.ignore('without-%s' % self.statTrigger.guiId) self.nameLabel = None self.classLabel = None self.statFrame = None if self.statTrigger: self.statTrigger.destroy() self.statTrigger = None ShipFrame.destroy(self)
def createGui(self): ShipFrame.createGui(self) self.nameLabel = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = PLocalizer.makeHeadingString(self['shipName'], 2), text_align = TextNode.ALeft, text_scale = 0.050000000000000003, text_pos = (0.059999999999999998, 0.014999999999999999), text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, frameColor = PiratesGuiGlobals.ButtonColor1[3], frameSize = (self['frameSize'][0] + 0.040000000000000001, self['frameSize'][1] - 0.029999999999999999, -0.0, 0.050000000000000003), pos = (0, 0, self['frameSize'][3] - 0.089999999999999997)) self.classLabel = DirectLabel(parent = self.nameLabel, relief = None, state = DGG.DISABLED, text = PLocalizer.makeHeadingString(PLocalizer.ShipClassNames.get(self['shipClass']), 1), text_font = PiratesGlobals.getInterfaceFont(), text_scale = PiratesGuiGlobals.TextScaleMed, text_align = TextNode.ALeft, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = (0, 0, 0, 1), textMayChange = 1, text_pos = (self.nameLabel['frameSize'][0] + 0.02, -0.029999999999999999)) self.timer = PiratesTimer.PiratesTimer(showMinutes = True, mode = None, titleText = '', titleFg = '', infoText = '', cancelText = '', cancelCallback = None) self.timer.setFontColor(PiratesGuiGlobals.TextFG2) self.timer.reparentTo(self) self.timer.setScale(0.55000000000000004) self.timer.setPos(0.62, 0, 0.315) self.timer.unstash() self.timer.countdown(self['time']) self.mainText = DirectLabel(parent = self, relief = None, state = DGG.DISABLED, text = 'How will you lead your crew?', text_pos = (0.62, 0.20000000000000001), text_font = PiratesGlobals.getInterfaceFont(), text_scale = PiratesGuiGlobals.TextScaleLarge, text_align = TextNode.ACenter, text_fg = PiratesGuiGlobals.TextFG2, text_wordwrap = 10, text_shadow = (0, 0, 0, 1), textMayChange = 1) gui = loader.loadModel('models/gui/toplevel_gui') geomCheck = gui.find('**/generic_check') self.yesButton = DialogButton(parent = self, buttonStyle = DialogButton.YES, pos = (0.5, 0, 0.080000000000000002), text = PLocalizer.BoardShip, text_scale = PiratesGuiGlobals.TextScaleLarge, text_font = PiratesGlobals.getInterfaceFont(), text_pos = (0.035000000000000003, -0.014), geom = (geomCheck,) * 4, geom_pos = (-0.059999999999999998, 0, 0), geom_scale = 0.5, geom0_color = PiratesGuiGlobals.ButtonColor6[0], geom1_color = PiratesGuiGlobals.ButtonColor6[1], geom2_color = PiratesGuiGlobals.ButtonColor6[2], geom3_color = PiratesGuiGlobals.ButtonColor6[3], image3_color = (0.80000000000000004, 0.80000000000000004, 0.80000000000000004, 1), helpPos = (0, 0, -0.12), helpDelay = 0.29999999999999999, command = self['command'], extraArgs = [ True]) self.noButton = DialogButton(parent = self, buttonStyle = DialogButton.NO, pos = (0.73999999999999999, 0, 0.080000000000000002), text = PLocalizer.ParlayShip, text_scale = PiratesGuiGlobals.TextScaleLarge, text_font = PiratesGlobals.getInterfaceFont(), text_pos = (0.035000000000000003, -0.014), helpPos = (0, 0, -0.12), helpDelay = 0.29999999999999999, command = self['command'], extraArgs = [ False])