def __init__(self, panelName, gameTitle, instructions): BorderFrame.__init__(self, parent=base.a2dBottomCenter, frameSize=(-1, 1, 0, 0.3), pos=(0, 0, 0.5), modelName='pir_m_gui_frm_subframe', imageColorScale=VBase4(0.75, 0.75, 0.9, 0.75)) self.initialiseoptions(PVPRulesPanel) self.secondLayer = BorderFrame(parent=self, frameSize=(-1, 1, 0, 0.3), modelName='pir_m_gui_frm_subframe', imageColorScale=VBase4( 0.75, 0.75, 0.9, 0.75)) self.gameTitle = gameTitle self.instructions = instructions self.gameTitleText = DirectLabel( parent=self, relief=None, text=self.gameTitle, text_scale=0.06, text_align=TextNode.ALeft, text_font=PiratesGlobals.getPirateFont(), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), pos=(-0.96, 0, 0.23)) self.instructionsText = DirectLabel(parent=self, relief=None, text=self.instructions, text_scale=0.05, text_align=TextNode.ALeft, text_wordwrap=40, text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), pos=(-0.96, 0, 0.14)) return
def __init__(self, **kw): self.sizeX = 0.8 self.sizeZ = 0.9 textScale = PiratesGuiGlobals.TextScaleTitleSmall optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ), None), ('text', PLocalizer.BodyShapeUpdate, None), ('text_align', TextNode.ACenter, None), ('text_font', PiratesGlobals.getPirateBoldOutlineFont(), None), ('text_fg', (1, 1, 1, 1), None), ('text_shadow', PiratesGuiGlobals.TextShadow, None), ('textMayChange', 1, None), ('text_scale', textScale, None), ('text_pos', (self.sizeX * 0.5, self.sizeZ * 0.95 - textScale), None)) self.defineoptions(kw, optiondefs) BorderFrame.__init__(self) self.initialiseoptions(BodyShapeChanger) self.setPos(base.a2dRight - self.sizeX, 0, 0) self.confirmDialog = None self.isSetup = 0 self.doingRegen = 0 self.acceptOnce('localAV-enterHalt', self.setup) localAvatar.gameFSM.request('Halt') if not self.isSetup: self.destroy() return
def __init__(self, parent=None, **kwargs): self.loadModels() self.cornerGeom = None self.text = None self.circle = None self.icon = None self.icon2 = None if not StackMessage.popupSfx: StackMessage.popupSfx = loadSfx(SoundGlobals.SFX_GUI_STACK_POPUP) StackMessage.lootSfx = loadSfx(SoundGlobals.SFX_GUI_LOOT) StackMessage.lootSfx.setVolume(0.75) optiondefs = (('relief', None, None), ('frameSize', (0, 0.80000000000000004, -0.17999999999999999, 0), None), ('state', DGG.DISABLED, None), ('time', 7, None), ('priority', 0, None), ('modelName', 'general_frame_b', None), ('borderScale', 0.69999999999999996, None), ('icon', (), self.setIcon), ('buttonStyle', None, None), ('noCallback', None, None), ('yesCallback', None, None), ('cancelCallback', None, None)) self.defineoptions(kwargs, optiondefs, dynamicGroups=()) BorderFrame.__init__(self, parent, **None) self.initialiseoptions(StackMessage) self.ival = None self.cornerGeom = self.corner.copyTo(self) self.cornerGeom.setScale(0.40000000000000002) self.cornerGeom.setPos(0.068000000000000005, 0, -0.066000000000000003) self.cornerGeom.setColorScale(*PiratesGuiGlobals.TextFG1) self.setTransparency(True)
def __init__(self, parent, shipOV = None, shipName = '', shipClass = 0, mastInfo = [], hp = 0, maxHp = 0, sp = 0, maxSp = 0, cargo = 0, maxCargo = 0, crew = 0, maxCrew = 0, adventureTime = 0, **kw): optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (0.050000000000000003, 0.64000000000000001, 0.040000000000000001, 0.39000000000000001), None)) self.defineoptions(kw, optiondefs) BorderFrame.__init__(self, parent, **None) self.initialiseoptions(ShipStatFrame) self.showTask = None self.snapShot = ShipSnapshot(self, shipOV, shipName, shipClass, mastInfo, hp, maxHp, sp, maxSp, cargo, maxCargo, crew, maxCrew, adventureTime, pos = (0, 0, 0))
def __init__(self, parent, shipOV = None, shipName = '', shipClass = 0, mastInfo = [], hp = 0, maxHp = 0, sp = 0, maxSp = 0, cargo = 0, maxCargo = 0, crew = 0, maxCrew = 0, adventureTime = 0, **kw): optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (0.050000000000000003, 0.64000000000000001, 0.040000000000000001, 0.39000000000000001), None)) self.defineoptions(kw, optiondefs) BorderFrame.__init__(self, parent) self.initialiseoptions(ShipStatFrame) self.showTask = None self.snapShot = ShipSnapshot(self, shipOV, shipName, shipClass, mastInfo, hp, maxHp, sp, maxSp, cargo, maxCargo, crew, maxCrew, adventureTime, pos = (0, 0, 0))
def __init__(self, panelName, gameTitle, instructions): BorderFrame.__init__(self, parent = base.a2dBottomCenter, frameSize = (-1, 1, 0, 0.29999999999999999), pos = (0, 0, 0.5), modelName = 'pir_m_gui_frm_subframe', imageColorScale = VBase4(0.75, 0.75, 0.90000000000000002, 0.75)) self.initialiseoptions(PVPRulesPanel) self.secondLayer = BorderFrame(parent = self, frameSize = (-1, 1, 0, 0.29999999999999999), modelName = 'pir_m_gui_frm_subframe', imageColorScale = VBase4(0.75, 0.75, 0.90000000000000002, 0.75)) self.gameTitle = gameTitle self.instructions = instructions self.gameTitleText = DirectLabel(parent = self, relief = None, text = self.gameTitle, text_scale = 0.059999999999999998, text_align = TextNode.ALeft, text_font = PiratesGlobals.getPirateFont(), text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), pos = (-0.95999999999999996, 0, 0.23000000000000001)) self.instructionsText = DirectLabel(parent = self, relief = None, text = self.instructions, text_scale = 0.050000000000000003, text_align = TextNode.ALeft, text_wordwrap = 40, text_fg = (1, 1, 1, 1), text_shadow = (0, 0, 0, 1), pos = (-0.95999999999999996, 0, 0.14000000000000001))
def __init__(self, tabBar, name, **kw): optiondefs = (('state', DGG.DISABLED, None), ('command', None, self.setCommand), ('extraArgs', [], self.setExtraArgs), ('name', name, None), ('mouseEntered', None, None), ('mouseLeft', None, None), ('selected', False, self.setSelected), ('textMayChange', 1, None)) self.defineoptions(kw, optiondefs) BorderFrame.__init__(self, parent = NodePath(), **None) self.initialiseoptions(Tab) self.setName(str(name)) self.tabBar = tabBar self.invisibleButton = DirectButton(parent = self, relief = 1, frameColor = (1.0, 0.0, 1.0, 0), frameSize = self.getInnerFrameSize(), rolloverSound = None, command = self['command'], extraArgs = self['extraArgs'], textMayChange = 1) self.invisibleButton.bind(DGG.ENTER, self.mouseEntered) self.invisibleButton.bind(DGG.EXIT, self.mouseLeft)
def __init__(self, tabBar, name, **kw): optiondefs = (('state', DGG.DISABLED, None), ('command', None, self.setCommand), ('extraArgs', [], self.setExtraArgs), ('name', name, None), ('mouseEntered', None, None), ('mouseLeft', None, None), ('selected', False, self.setSelected), ('textMayChange', 1, None)) self.defineoptions(kw, optiondefs) BorderFrame.__init__(self, parent = NodePath(), **kw) self.initialiseoptions(Tab) self.setName(str(name)) self.tabBar = tabBar self.invisibleButton = DirectButton(parent = self, relief = 1, frameColor = (1.0, 0.0, 1.0, 0), frameSize = self.getInnerFrameSize(), rolloverSound = None, command = self['command'], extraArgs = self['extraArgs'], textMayChange = 1) self.invisibleButton.bind(DGG.ENTER, self.mouseEntered) self.invisibleButton.bind(DGG.EXIT, self.mouseLeft)
def __init__(self, cell, manager): self.sizeX = 0.80000000000000004 self.sizeZ = 0.59999999999999998 textScale = PiratesGuiGlobals.TextScaleTitleSmall optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ), None), ('text', PLocalizer.InventorySplitterTitle, None), ('text_align', TextNode.ACenter, None), ('text_font', PiratesGlobals.getPirateBoldOutlineFont(), None), ('text_fg', (1, 1, 1, 1), None), ('text_shadow', PiratesGuiGlobals.TextShadow, None), ('textMayChange', 1, None), ('text_scale', textScale, None), ('text_pos', (self.sizeX * 0.5, self.sizeZ - textScale), None)) self.defineoptions({ }, optiondefs) BorderFrame.__init__(self, parent = NodePath()) self.initialiseoptions(InventoryStackSplitter) self.fromCell = cell self.manager = manager self.setup()
def __init__(self, badText = 'Error'): self.sizeX = 0.80000000000000004 self.sizeZ = 0.59999999999999998 textScale = PiratesGuiGlobals.TextScaleTitleSmall optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ), None), ('text', PLocalizer.ChatWarningTitle, None), ('text_align', TextNode.ACenter, None), ('text_font', PiratesGlobals.getPirateBoldOutlineFont(), None), ('text_fg', (1, 1, 1, 1), None), ('text_shadow', PiratesGuiGlobals.TextShadow, None), ('textMayChange', 1, None), ('text_scale', textScale, None), ('text_pos', (self.sizeX * 0.5, self.sizeZ - textScale * 1.5), None)) self.defineoptions({ }, optiondefs) BorderFrame.__init__(self, parent = NodePath()) self.initialiseoptions(ChatWarningBox) self.setX(self.sizeX * -0.5) self.badText = badText self.warningText = badText self.setup()
def __init__(self, cell, manager): self.sizeX = 0.8 self.sizeZ = 0.6 textScale = PiratesGuiGlobals.TextScaleTitleSmall optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ), None), ('text', PLocalizer.InventorySplitterTitle, None), ('text_align', TextNode.ACenter, None), ('text_font', PiratesGlobals.getPirateBoldOutlineFont(), None), ('text_fg', (1, 1, 1, 1), None), ('text_shadow', PiratesGuiGlobals.TextShadow, None), ('textMayChange', 1, None), ('text_scale', textScale, None), ('text_pos', (self.sizeX * 0.5, self.sizeZ - textScale), None)) self.defineoptions({}, optiondefs) BorderFrame.__init__(self, parent=NodePath()) self.initialiseoptions(InventoryStackSplitter) self.fromCell = cell self.manager = manager self.setup() return
def __init__(self, manager, callback, **kw): self.sizeX = 0.80000000000000004 self.sizeZ = 0.80000000000000004 textScale = PiratesGuiGlobals.TextScaleTitleSmall optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ), None), ('modelName', 'pir_m_gui_frm_main_blue', None), ('nameTag', PLocalizer.InventorySellTitle, None)) self.defineoptions(kw, optiondefs) BorderFrame.__init__(self) self.initialiseoptions(InventorySellConfirm) self.accept('UpdateSellContainer', self.update) self.manager = manager self.callback = callback self.confirmDialog = None self.totalGoldValue = 0 self.setup()
def __init__(self, manager, callback, **kw): self.sizeX = 0.80000000000000004 self.sizeZ = 0.80000000000000004 textScale = PiratesGuiGlobals.TextScaleTitleSmall optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ), None), ('modelName', 'pir_m_gui_frm_main_blue', None), ('nameTag', PLocalizer.InventorySellTitle, None)) self.defineoptions(kw, optiondefs) BorderFrame.__init__(self) self.initialiseoptions(InventorySellConfirm) self.accept('UpdateSellContainer', self.update) self.manager = manager self.callback = callback self.confirmDialog = None self.totalGoldValue = 0 self.setup()
def __init__(self, **kw): self.sizeX = 0.80000000000000004 self.sizeZ = 0.90000000000000002 textScale = PiratesGuiGlobals.TextScaleTitleSmall optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ), None), ('text', PLocalizer.BodyShapeUpdate, None), ('text_align', TextNode.ACenter, None), ('text_font', PiratesGlobals.getPirateBoldOutlineFont(), None), ('text_fg', (1, 1, 1, 1), None), ('text_shadow', PiratesGuiGlobals.TextShadow, None), ('textMayChange', 1, None), ('text_scale', textScale, None), ('text_pos', (self.sizeX * 0.5, self.sizeZ * 0.94999999999999996 - textScale), None)) self.defineoptions(kw, optiondefs) BorderFrame.__init__(self) self.initialiseoptions(BodyShapeChanger) self.setPos(base.a2dRight - self.sizeX, 0, 0) self.confirmDialog = None self.isSetup = 0 self.doingRegen = 0 self.acceptOnce('localAV-enterHalt', self.setup) localAvatar.gameFSM.request('Halt') if not self.isSetup: self.destroy()
def __init__(self, cell, parent): self.sizeX = 0.64000000000000001 self.sizeZ = 0.64000000000000001 textScale = PiratesGuiGlobals.TextScaleTitleSmall frameSize = (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ) modelName = 'pir_m_gui_frm_subframe' imageColorScale = VBase4(0.75, 0.75, 0.90000000000000002, 1.0) optiondefs = (('state', DGG.DISABLED, None), ('frameSize', frameSize, None), ('modelName', modelName, None), ('imageColorScale', imageColorScale, None)) self.defineoptions({ }, optiondefs) BorderFrame.__init__(self, parent = NodePath()) self.initialiseoptions(InventoryStackSeller) self.doubleFrame = BorderFrame(parent = self, frameSize = frameSize, modelName = modelName, imageColorScale = imageColorScale) self.tripleFrame = BorderFrame(parent = self, frameSize = frameSize, modelName = modelName, imageColorScale = imageColorScale, text = PLocalizer.InventorySplitterTitle, text_align = TextNode.ACenter, text_font = PiratesGlobals.getPirateBoldOutlineFont(), text_fg = VBase4(1, 1, 1, 1), text_shadow = PiratesGuiGlobals.TextShadow, text_scale = textScale, text_pos = (self.sizeX * 0.5, self.sizeZ * 0.94999999999999996 - textScale)) self.fromCell = cell self.parent = parent self.amount = self.fromCell.inventoryItem.getAmount() self.setup()
def __init__(self, cell, parent): self.sizeX = 0.64000000000000001 self.sizeZ = 0.64000000000000001 textScale = PiratesGuiGlobals.TextScaleTitleSmall frameSize = (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ) modelName = 'pir_m_gui_frm_subframe' imageColorScale = VBase4(0.75, 0.75, 0.90000000000000002, 1.0) optiondefs = (('state', DGG.DISABLED, None), ('frameSize', frameSize, None), ('modelName', modelName, None), ('imageColorScale', imageColorScale, None)) self.defineoptions({ }, optiondefs) BorderFrame.__init__(self, parent = NodePath()) self.initialiseoptions(InventoryStackSeller) self.doubleFrame = BorderFrame(parent = self, frameSize = frameSize, modelName = modelName, imageColorScale = imageColorScale) self.tripleFrame = BorderFrame(parent = self, frameSize = frameSize, modelName = modelName, imageColorScale = imageColorScale, text = PLocalizer.InventorySplitterTitle, text_align = TextNode.ACenter, text_font = PiratesGlobals.getPirateBoldOutlineFont(), text_fg = VBase4(1, 1, 1, 1), text_shadow = PiratesGuiGlobals.TextShadow, text_scale = textScale, text_pos = (self.sizeX * 0.5, self.sizeZ * 0.94999999999999996 - textScale)) self.fromCell = cell self.parent = parent self.amount = self.fromCell.inventoryItem.getAmount() self.setup()
def __init__(self, name, pvp): self.width = PiratesGuiGlobals.PVPCompletePanelWidth self.height = PiratesGuiGlobals.PVPCompletePanelHeight BorderFrame.__init__(self, frameSize = (self.width * 0.14999999999999999, self.width * 0.84999999999999998, self.height * 0.81999999999999995, self.height), modelName = 'pir_m_gui_frm_subframe', imageColorScale = VBase4(0.75, 0.75, 0.94999999999999996, 0.75)) self.secondLayer = BorderFrame(parent = self, relief = None, frameSize = (self.width * 0.14999999999999999, self.width * 0.84999999999999998, self.height * 0.81999999999999995, self.height), modelName = 'pir_m_gui_frm_subframe', imageColorScale = VBase4(0.75, 0.75, 0.90000000000000002, 0.75)) self.initialiseoptions(PVPCompletePanel) self.endButton = GuiButton(parent = self, text = PLocalizer.PVPExit, command = pvp.requestPVPLeave, pos = (1.25, 0, 0.10000000000000001), image = GuiButton.redGenericButton, image_scale = 0.59999999999999998) self.endButton.setBin('gui-popup', 0) self.name = name self.title = DirectLabel(parent = self, relief = None, text = name, text_align = TextNode.ACenter, text_scale = 0.070000000000000007, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (1.25, 0, 1.6200000000000001)) if pvp.hasTeams(): team1Score = '0' team2Score = '0' for stat in pvp.scoreboardHolder.getItemList(): if stat['Team'] == 1: team1Score = stat['Score'] continue if stat['Team'] == 2: team2Score = stat['Score'] continue self.team1ScoreLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.PVPTeamScore % (1, team1Score), text_align = TextNode.ACenter, text_scale = 0.040000000000000001, text_fg = PVPGlobals.getTeamColor(1), text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (1.05, 0, 1.55)) self.team2ScoreLabel = DirectLabel(parent = self, relief = None, text = PLocalizer.PVPTeamScore % (2, team2Score), text_align = TextNode.ACenter, text_scale = 0.040000000000000001, text_fg = PVPGlobals.getTeamColor(2), text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (1.45, 0, 1.55)) self.outcome = DirectLabel(parent = self, relief = None, text = '', text_align = TextNode.ACenter, text_scale = 0.059999999999999998, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (1.25, 0, 1.45)) if pvp.hasTeams(): if team1Score > team2Score: self.outcome['text_fg'] = PVPGlobals.getTeamColor(1) elif team2Score > team1Score: self.outcome['text_fg'] = PVPGlobals.getTeamColor(2) self.borderTwo = BorderFrame(parent = self, relief = None, frameSize = (self.width * 0.14999999999999999, self.width * 0.84999999999999998, 0, self.height * 0.80000000000000004), modelName = 'pir_m_gui_frm_subframe', imageColorScale = VBase4(0.75, 0.75, 0.90000000000000002, 0.75)) self.borderTwoSecondLayer = BorderFrame(parent = self.borderTwo, relief = None, frameSize = (self.width * 0.14999999999999999, self.width * 0.84999999999999998, 0, self.height * 0.80000000000000004), modelName = 'pir_m_gui_frm_subframe', imageColorScale = VBase4(0.75, 0.75, 0.90000000000000002, 0.75)) self.two = ScoreFrame(PiratesGuiGlobals.PVPCompletePageWidth - 1.0, PiratesGuiGlobals.PVPCompletePageHeight, pvp.statsHolder, 0, sortOrder = 2) self.two.reparentTo(self.borderTwo) self.two.setPos(0.45000000000000001, 0, -0.14999999999999999) self.two.setup() self.game = pvp
def __init__(self, parent = None, **kwargs): self.loadModels() self.cornerGeom = None self.text = None self.circle = None self.icon = None self.icon2 = None if not StackMessage.popupSfx: StackMessage.popupSfx = loadSfx(SoundGlobals.SFX_GUI_STACK_POPUP) StackMessage.lootSfx = loadSfx(SoundGlobals.SFX_GUI_LOOT) StackMessage.lootSfx.setVolume(0.75) optiondefs = (('relief', None, None), ('frameSize', (0, 0.80000000000000004, -0.17999999999999999, 0), None), ('state', DGG.DISABLED, None), ('time', 7, None), ('priority', 0, None), ('modelName', 'general_frame_b', None), ('borderScale', 0.69999999999999996, None), ('icon', (), self.setIcon), ('buttonStyle', None, None), ('noCallback', None, None), ('yesCallback', None, None), ('cancelCallback', None, None)) self.defineoptions(kwargs, optiondefs, dynamicGroups = ()) BorderFrame.__init__(self, parent, **kwargs) self.initialiseoptions(StackMessage) self.ival = None self.cornerGeom = self.corner.copyTo(self) self.cornerGeom.setScale(0.40000000000000002) self.cornerGeom.setPos(0.068000000000000005, 0, -0.066000000000000003) self.cornerGeom.setColorScale(*PiratesGuiGlobals.TextFG1) self.setTransparency(True)
def __init__(self, badText='Error'): self.sizeX = 0.80000000000000004 self.sizeZ = 0.59999999999999998 textScale = PiratesGuiGlobals.TextScaleTitleSmall optiondefs = (('state', DGG.DISABLED, None), ('frameSize', (-0.0 * self.sizeX, 1.0 * self.sizeX, -0.0 * self.sizeZ, 1.0 * self.sizeZ), None), ('text', PLocalizer.ChatWarningTitle, None), ('text_align', TextNode.ACenter, None), ('text_font', PiratesGlobals.getPirateBoldOutlineFont(), None), ('text_fg', (1, 1, 1, 1), None), ('text_shadow', PiratesGuiGlobals.TextShadow, None), ('textMayChange', 1, None), ('text_scale', textScale, None), ('text_pos', (self.sizeX * 0.5, self.sizeZ - textScale * 1.5), None)) self.defineoptions({}, optiondefs) BorderFrame.__init__(self, parent=NodePath()) self.initialiseoptions(ChatWarningBox) self.setX(self.sizeX * -0.5) self.badText = badText self.warningText = badText self.setup()
def __init__(self, title, w, h, showClose = True, titleSize = 0, modelName = 'general_frame_f', **kw): self.width = w self.height = h BorderFrame.__init__(self, frameSize = (0, w, 0, h), modelName = modelName, sortOrder = 20, **kw) self.initialiseoptions(GuiPanel) titleFont = PiratesGuiGlobals.TextScaleMed textColor = PiratesGuiGlobals.TextFG1 textShadow = PiratesGuiGlobals.TextShadow wordwrap = 13 if titleSize == 0: titleFont = PiratesGuiGlobals.TextScaleMed textColor = PiratesGuiGlobals.TextFG1 textShadow = PiratesGuiGlobals.TextShadow wordwrap = 13 elif titleSize == 1: titleFont = PiratesGuiGlobals.TextScaleLarge textColor = PiratesGuiGlobals.TextFG2 textShadow = None wordwrap = 10 elif titleSize == 1.5: titleFont = PiratesGuiGlobals.TextScaleExtraLarge textColor = PiratesGuiGlobals.TextFG1 textShadow = None wordwrap = 10 if title: self.titleLabel = DirectLabel(parent = self, relief = None, pos = (0.050000000000000003, 0, h - PiratesGuiGlobals.TextScaleSmall * 2.5), text = title, text_align = TextNode.ALeft, text_scale = titleFont, text_pos = (0.014999999999999999, 0.014999999999999999), text_fg = textColor, text_shadow = textShadow, text_font = PiratesGlobals.getPirateOutlineFont(), textMayChange = 1, text_wordwrap = wordwrap, sortOrder = 21) else: self.titleLabel = None if showClose: lookoutUI = loader.loadModel('models/gui/lookout_gui') self.closeButton = DirectButton(parent = self, relief = None, image = (lookoutUI.find('**/lookout_close_window'), lookoutUI.find('**/lookout_close_window_down'), lookoutUI.find('**/lookout_close_window_over'), lookoutUI.find('**/lookout_close_window_disabled')), pos = (w - 0.055, 0, h - 0.055), scale = 0.125, command = self.closePanel, sortOrder = 21) lookoutUI.removeNode() else: self.closeButton = None self.fadeLerp = None
def __init__(self, title, w, h, showClose=True, titleSize=0, modelName='general_frame_f', **kw): self.width = w self.height = h BorderFrame.__init__(self, frameSize=(0, w, 0, h), modelName=modelName, sortOrder=20, **kw) self.initialiseoptions(GuiPanel) titleFont = PiratesGuiGlobals.TextScaleMed textColor = PiratesGuiGlobals.TextFG1 textShadow = PiratesGuiGlobals.TextShadow wordwrap = 13 if titleSize == 0: titleFont = PiratesGuiGlobals.TextScaleMed textColor = PiratesGuiGlobals.TextFG1 textShadow = PiratesGuiGlobals.TextShadow wordwrap = 13 else: if titleSize == 1: titleFont = PiratesGuiGlobals.TextScaleLarge textColor = PiratesGuiGlobals.TextFG2 textShadow = None wordwrap = 10 else: if titleSize == 1.5: titleFont = PiratesGuiGlobals.TextScaleExtraLarge textColor = PiratesGuiGlobals.TextFG1 textShadow = None wordwrap = 10 if title: self.titleLabel = DirectLabel( parent=self, relief=None, pos=(0.05, 0, h - PiratesGuiGlobals.TextScaleSmall * 2.5), text=title, text_align=TextNode.ALeft, text_scale=titleFont, text_pos=(0.015, 0.015), text_fg=textColor, text_shadow=textShadow, text_font=PiratesGlobals.getPirateOutlineFont(), textMayChange=1, text_wordwrap=wordwrap, sortOrder=21) else: self.titleLabel = None if showClose: lookoutUI = loader.loadModel('models/gui/lookout_gui') self.closeButton = DirectButton( parent=self, relief=None, image=(lookoutUI.find('**/lookout_close_window'), lookoutUI.find('**/lookout_close_window_down'), lookoutUI.find('**/lookout_close_window_over'), lookoutUI.find('**/lookout_close_window_disabled')), pos=(w - 0.055, 0, h - 0.055), scale=0.125, command=self.closePanel, sortOrder=21) lookoutUI.removeNode() else: self.closeButton = None self.fadeLerp = None return
def __init__(self, name, pvp): self.width = PiratesGuiGlobals.PVPCompletePanelWidth self.height = PiratesGuiGlobals.PVPCompletePanelHeight BorderFrame.__init__(self, frameSize=(self.width * 0.14999999999999999, self.width * 0.84999999999999998, self.height * 0.81999999999999995, self.height), modelName='pir_m_gui_frm_subframe', imageColorScale=VBase4(0.75, 0.75, 0.94999999999999996, 0.75)) self.secondLayer = BorderFrame( parent=self, relief=None, frameSize=(self.width * 0.14999999999999999, self.width * 0.84999999999999998, self.height * 0.81999999999999995, self.height), modelName='pir_m_gui_frm_subframe', imageColorScale=VBase4(0.75, 0.75, 0.90000000000000002, 0.75)) self.initialiseoptions(PVPCompletePanel) self.endButton = GuiButton(parent=self, text=PLocalizer.PVPExit, command=pvp.requestPVPLeave, pos=(1.25, 0, 0.10000000000000001), image=GuiButton.redGenericButton, image_scale=0.59999999999999998) self.endButton.setBin('gui-popup', 0) self.name = name self.title = DirectLabel(parent=self, relief=None, text=name, text_align=TextNode.ACenter, text_scale=0.070000000000000007, text_fg=PiratesGuiGlobals.TextFG1, text_shadow=PiratesGuiGlobals.TextShadow, textMayChange=1, pos=(1.25, 0, 1.6200000000000001)) if pvp.hasTeams(): team1Score = '0' team2Score = '0' for stat in pvp.scoreboardHolder.getItemList(): if stat['Team'] == 1: team1Score = stat['Score'] continue if stat['Team'] == 2: team2Score = stat['Score'] continue self.team1ScoreLabel = DirectLabel( parent=self, relief=None, text=PLocalizer.PVPTeamScore % (1, team1Score), text_align=TextNode.ACenter, text_scale=0.040000000000000001, text_fg=PVPGlobals.getTeamColor(1), text_shadow=PiratesGuiGlobals.TextShadow, textMayChange=1, pos=(1.05, 0, 1.55)) self.team2ScoreLabel = DirectLabel( parent=self, relief=None, text=PLocalizer.PVPTeamScore % (2, team2Score), text_align=TextNode.ACenter, text_scale=0.040000000000000001, text_fg=PVPGlobals.getTeamColor(2), text_shadow=PiratesGuiGlobals.TextShadow, textMayChange=1, pos=(1.45, 0, 1.55)) self.outcome = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ACenter, text_scale=0.059999999999999998, text_fg=PiratesGuiGlobals.TextFG1, text_shadow=PiratesGuiGlobals.TextShadow, textMayChange=1, pos=(1.25, 0, 1.45)) if pvp.hasTeams(): if team1Score > team2Score: self.outcome['text_fg'] = PVPGlobals.getTeamColor(1) elif team2Score > team1Score: self.outcome['text_fg'] = PVPGlobals.getTeamColor(2) self.borderTwo = BorderFrame( parent=self, relief=None, frameSize=(self.width * 0.14999999999999999, self.width * 0.84999999999999998, 0, self.height * 0.80000000000000004), modelName='pir_m_gui_frm_subframe', imageColorScale=VBase4(0.75, 0.75, 0.90000000000000002, 0.75)) self.borderTwoSecondLayer = BorderFrame( parent=self.borderTwo, relief=None, frameSize=(self.width * 0.14999999999999999, self.width * 0.84999999999999998, 0, self.height * 0.80000000000000004), modelName='pir_m_gui_frm_subframe', imageColorScale=VBase4(0.75, 0.75, 0.90000000000000002, 0.75)) self.two = ScoreFrame(PiratesGuiGlobals.PVPCompletePageWidth - 1.0, PiratesGuiGlobals.PVPCompletePageHeight, pvp.statsHolder, 0, sortOrder=2) self.two.reparentTo(self.borderTwo) self.two.setPos(0.45000000000000001, 0, -0.14999999999999999) self.two.setup() self.game = pvp