def showBeacon(self, team): if self.beacon: self.hideBeacon() if team > 0: self.beaconNodePath = self.nametag3d.attachNewNode('beacon') self.beacon = Beacon.getBeacon(self.beaconNodePath) self.beacon.setZ(2) self.beacon.setBillboardPointWorld() self.exposeJoint(self.beaconNodePath, 'modelRoot', 'name_tag', '500') self.beacon.setColor(PVPGlobals.getTeamColor(team))
def setTeamGraphic(self, team): if self.pvpTeamGraphic: self.pvpTeamGraphic.removeNode() self.pvpTeamGraphic = None if team > 0: self.pvpTeamGraphic = Beacon.getBeaconModel() self.pvpTeamGraphic.reparentTo(self) self.pvpTeamGraphic.setColor(PVPGlobals.getTeamColor(team)) self.pvpTeamGraphic.setScale(0.23000000000000001) self.pvpTeamGraphic.setPos(0.13, 0, 0.13)
def __init__(self, parent, showSkills = 0, **kw): GuiTray.GuiTray.__init__(self, parent, 0.75, 0.14999999999999999, **kw) self.initialiseoptions(StatusTray) self.name = None self.sticky = False self.level = 0 self.doId = 0 self.prevDoId = 0 self.hideValues = 0 self.card = None self.prevChange = 0 self.prevRange = 0 self.prevValue = 0 self.fader = None self.skillEffects = { } self.durationTask = None self.nameLabel = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, text = '', text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = Vec4(0.80000000000000004, 0.69999999999999996, 0.59999999999999998, 1), text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (0.040000000000000001, 0, 0.11), text_font = PiratesGlobals.getPirateBoldOutlineFont()) self.stickyLabel = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, text = '', text_align = TextNode.ARight, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (0.56999999999999995, 0, 0.025000000000000001), text_font = PiratesGlobals.getInterfaceOutlineFont()) self.hpLabel = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, frameColor = (0, 0, 0, 0.20000000000000001), frameSize = (-0.01, 0.40000000000000002, -0.014999999999999999, 0.040000000000000001), pos = (0.32000000000000001, 0, 0.0060000000000000001), text = PLocalizer.StatusTrayHp, text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getInterfaceFont(), textMayChange = 0) self.hpLabel.hide() self.voodooMeter = DirectWaitBar(parent = self, state = DGG.DISABLED, relief = DGG.RAISED, borderWidth = (0.0050000000000000001, 0.0050000000000000001), frameSize = (0.0, 0.53000000000000003, 0.0070000000000000001, 0.035000000000000003), frameColor = (0, 0, 0, 1), pos = (0.20000000000000001, 0, -0.055), range = 100, value = 100, barColor = (0.59999999999999998, 0.59999999999999998, 0.94999999999999996, 1), text = '', text_align = TextNode.ARight, text_scale = PiratesGuiGlobals.TextScaleMed, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_pos = (0.5, -0.035000000000000003, 0), text_font = PiratesGlobals.getInterfaceFont(), textMayChange = 1, sortOrder = 0) self.voodooMeter.setTransparency(1) self.voodooMeter.component('text0').hide() self.hpMeter = DirectWaitBar(parent = self, state = DGG.DISABLED, relief = DGG.RAISED, borderWidth = (0.0050000000000000001, 0.0050000000000000001), frameSize = (0.0, 0.53000000000000003, 0.002, 0.029999999999999999), frameColor = (0, 0, 0, 1), pos = (0.20000000000000001, 0, 0.050000000000000003), range = 100, value = 100, barColor = (0.10000000000000001, 0.69999999999999996, 0.10000000000000001, 1), text = '', text_align = TextNode.ARight, text_scale = PiratesGuiGlobals.TextScaleMed, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_pos = (0.5, -0.044999999999999998, 0), text_font = PiratesGlobals.getInterfaceFont(), textMayChange = 1, sortOrder = 0) self.hpMeter.setTransparency(1) self.hpMeter.component('text0').hide() self.hpMeterChange = DirectFrame(parent = self, state = DGG.DISABLED, frameSize = (0.0, 0.53000000000000003, 0.0, 0.025999999999999999), frameColor = (1.0, 0.0, 0.0, 1.0), pos = (0, 0, 0)) self.hpMeterChange.setBin('gui-fixed', 0) self.hpMeterChange.hide() self.hpMeterDownIval = Sequence(Func(self.hpMeterChange.show), Wait(0.10000000000000001), LerpColorInterval(self.hpMeterChange, 0.5, color = VBase4(0.69999999999999996, 0.10000000000000001, 0.10000000000000001, 1.0), blendType = 'easeOut'), LerpColorInterval(self.hpMeterChange, 0.25, color = VBase4(0.0, 0.0, 0.0, 1.0), blendType = 'easeOut'), Func(self.hpMeterChange.hide)) self.hpMeterUpGreenIval = Sequence(Func(self.hpMeterChange.show), Wait(0.10000000000000001), LerpColorInterval(self.hpMeterChange, 0.75, color = VBase4(0.10000000000000001, 0.69999999999999996, 0.10000000000000001, 1.0)), Func(self.hpMeterChange.hide)) self.hpMeterUpRedIval = Sequence(Func(self.hpMeterChange.show), Wait(0.10000000000000001), LerpColorInterval(self.hpMeterChange, 0.75, color = VBase4(1.0, 0.0, 0.0, 1.0)), Func(self.hpMeterChange.hide)) self.hpMeterUpYellowIval = Sequence(Func(self.hpMeterChange.show), Wait(0.10000000000000001), LerpColorInterval(self.hpMeterChange, 0.75, color = VBase4(1.0, 1.0, 0.10000000000000001, 1.0)), Func(self.hpMeterChange.hide)) self.meterChangeOffset = (0.0, 0.0, 0.050000000000000003) self.prevTargetName = '' self.voodooLabel = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, frameColor = (0, 0, 0, 0.20000000000000001), frameSize = (-0.01, 0.40000000000000002, -0.014999999999999999, 0.040000000000000001), pos = (0.32000000000000001, 0, -0.091999999999999998), text = PLocalizer.StatusTrayVoodoo, text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getInterfaceFont(), textMayChange = 0) self.voodooLabel.hide() self.statusEffectsPanel = StatusEffectsPanel.StatusEffectsPanel(parent = self) flagModel = loader.loadModel('models/gui/flag_icons') flagModel2 = loader.loadModel('models/gui/gui_icons_weapon') flagModels = [ flagModel.find('**/flag_undead'), flagModel.find('**/flag_navy'), flagModel.find('**/flag_eitc'), flagModel2.find('**/pir_t_ico_dol_straw')] for icon in flagModels: if icon == flagModel2.find('**/pir_t_ico_dol_straw'): icon.setScale(0.10000000000000001) else: icon.setScale(0.44) icon.flattenStrong() self.icons = { PiratesGlobals.UNDEAD_TEAM: flagModels[0], PiratesGlobals.NAVY_TEAM: flagModels[1], PiratesGlobals.TRADING_CO_TEAM: flagModels[2], PiratesGlobals.FRENCH_UNDEAD_TEAM: flagModels[0], PiratesGlobals.SPANISH_UNDEAD_TEAM: flagModels[0], PiratesGlobals.PLAYER_TEAM: flagModels[3], PiratesGlobals.VOODOO_ZOMBIE_TEAM: flagModels[0], PiratesGlobals.BOUNTY_HUNTER_TEAM: flagModels[0] } self.pvpIcon = Beacon.getBeaconModel() self.pvpIcon.setScale(0.12) self.pvpIcon.flattenStrong() privateerLogos = loader.loadModel('models/textureCards/sailLogo') self.privateerLogos = { PVPGlobals.FrenchTeam: privateerLogos.find('**/logo_french_flag'), PVPGlobals.SpanishTeam: privateerLogos.find('**/logo_spanish_flag') } for logo in self.privateerLogos.itervalues(): logo.setScale(0.073999999999999996) logo.flattenStrong() self.currentIcon = None if showSkills: self.card = loader.loadModel('models/textureCards/skillIcons') icons = loader.loadModel('models/gui/gui_icons_weapon') icons.reparentTo(self.card) self.reloadFrame = DirectFrame(parent = self, state = DGG.DISABLED, relief = None) self.reloadFrame.hide() self.activeName = DirectLabel(parent = self.reloadFrame, state = DGG.DISABLED, relief = None, text = 'Using Skill', text_align = TextNode.ARight, text_scale = 0.059999999999999998, pos = (-0.050000000000000003, 0, 0.01), text_fg = PiratesGuiGlobals.TextFG11, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont()) tex = self.card.find('**/base') self.reloadFrame['scale'] = 0.5 self.reloadFrame['image'] = tex self.reloadFrame['image_scale'] = 0.085000000000000006 self.reloadFrame['image_pos'] = (0, 0, 0.02) self.reloadFrame.setPos(0.12, 0, -0.019) self.reloadFrame.setScale(0.69999999999999996) tex = self.card.find('**/cutlass_sweep') self.skillFrame = DirectFrame(parent = self.reloadFrame, state = DGG.DISABLED, relief = None, sortOrder = 20, image_pos = (0, 0, 0)) self.skillFrame.setTransparency(1) self.skillFrame['image'] = tex self.skillFrame['image_scale'] = 0.10000000000000001 self.skillFrame['image_pos'] = (0, 0, 0.02) self.activeName['text_align'] = TextNode.ALeft self.activeName.setPos(0.089999999999999997, 0, 0.01)
def __init__(self, parent, showSkills = 0, **kw): GuiTray.GuiTray.__init__(self, parent, 0.75, 0.14999999999999999) self.initialiseoptions(StatusTray) self.name = None self.sticky = False self.level = 0 self.doId = 0 self.prevDoId = 0 self.hideValues = 0 self.card = None self.prevChange = 0 self.prevRange = 0 self.prevValue = 0 self.fader = None self.skillEffects = { } self.durationTask = None self.nameLabel = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, text = '', text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = Vec4(0.80000000000000004, 0.69999999999999996, 0.59999999999999998, 1), text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (0.040000000000000001, 0, 0.11), text_font = PiratesGlobals.getPirateBoldOutlineFont()) self.stickyLabel = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, text = '', text_align = TextNode.ARight, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = PiratesGuiGlobals.TextFG2, text_shadow = PiratesGuiGlobals.TextShadow, textMayChange = 1, pos = (0.56999999999999995, 0, 0.025000000000000001), text_font = PiratesGlobals.getInterfaceOutlineFont()) self.hpLabel = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, frameColor = (0, 0, 0, 0.20000000000000001), frameSize = (-0.01, 0.40000000000000002, -0.014999999999999999, 0.040000000000000001), pos = (0.32000000000000001, 0, 0.0060000000000000001), text = PLocalizer.StatusTrayHp, text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getInterfaceFont(), textMayChange = 0) self.hpLabel.hide() self.voodooMeter = DirectWaitBar(parent = self, state = DGG.DISABLED, relief = DGG.RAISED, borderWidth = (0.0050000000000000001, 0.0050000000000000001), frameSize = (0.0, 0.53000000000000003, 0.0070000000000000001, 0.035000000000000003), frameColor = (0, 0, 0, 1), pos = (0.20000000000000001, 0, -0.055), range = 100, value = 100, barColor = (0.59999999999999998, 0.59999999999999998, 0.94999999999999996, 1), text = '', text_align = TextNode.ARight, text_scale = PiratesGuiGlobals.TextScaleMed, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_pos = (0.5, -0.035000000000000003, 0), text_font = PiratesGlobals.getInterfaceFont(), textMayChange = 1, sortOrder = 0) self.voodooMeter.setTransparency(1) self.voodooMeter.component('text0').hide() self.hpMeter = DirectWaitBar(parent = self, state = DGG.DISABLED, relief = DGG.RAISED, borderWidth = (0.0050000000000000001, 0.0050000000000000001), frameSize = (0.0, 0.53000000000000003, 0.002, 0.029999999999999999), frameColor = (0, 0, 0, 1), pos = (0.20000000000000001, 0, 0.050000000000000003), range = 100, value = 100, barColor = (0.10000000000000001, 0.69999999999999996, 0.10000000000000001, 1), text = '', text_align = TextNode.ARight, text_scale = PiratesGuiGlobals.TextScaleMed, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_pos = (0.5, -0.044999999999999998, 0), text_font = PiratesGlobals.getInterfaceFont(), textMayChange = 1, sortOrder = 0) self.hpMeter.setTransparency(1) self.hpMeter.component('text0').hide() self.hpMeterChange = DirectFrame(parent = self, state = DGG.DISABLED, frameSize = (0.0, 0.53000000000000003, 0.0, 0.025999999999999999), frameColor = (1.0, 0.0, 0.0, 1.0), pos = (0, 0, 0)) self.hpMeterChange.setBin('gui-fixed', 0) self.hpMeterChange.hide() self.hpMeterDownIval = Sequence(Func(self.hpMeterChange.show), Wait(0.10000000000000001), LerpColorInterval(self.hpMeterChange, 0.5, color = VBase4(0.69999999999999996, 0.10000000000000001, 0.10000000000000001, 1.0), blendType = 'easeOut'), LerpColorInterval(self.hpMeterChange, 0.25, color = VBase4(0.0, 0.0, 0.0, 1.0), blendType = 'easeOut'), Func(self.hpMeterChange.hide)) self.hpMeterUpGreenIval = Sequence(Func(self.hpMeterChange.show), Wait(0.10000000000000001), LerpColorInterval(self.hpMeterChange, 0.75, color = VBase4(0.10000000000000001, 0.69999999999999996, 0.10000000000000001, 1.0)), Func(self.hpMeterChange.hide)) self.hpMeterUpRedIval = Sequence(Func(self.hpMeterChange.show), Wait(0.10000000000000001), LerpColorInterval(self.hpMeterChange, 0.75, color = VBase4(1.0, 0.0, 0.0, 1.0)), Func(self.hpMeterChange.hide)) self.hpMeterUpYellowIval = Sequence(Func(self.hpMeterChange.show), Wait(0.10000000000000001), LerpColorInterval(self.hpMeterChange, 0.75, color = VBase4(1.0, 1.0, 0.10000000000000001, 1.0)), Func(self.hpMeterChange.hide)) self.meterChangeOffset = (0.0, 0.0, 0.050000000000000003) self.prevTargetName = '' self.voodooLabel = DirectLabel(parent = self, state = DGG.DISABLED, relief = None, frameColor = (0, 0, 0, 0.20000000000000001), frameSize = (-0.01, 0.40000000000000002, -0.014999999999999999, 0.040000000000000001), pos = (0.32000000000000001, 0, -0.091999999999999998), text = PLocalizer.StatusTrayVoodoo, text_align = TextNode.ALeft, text_scale = PiratesGuiGlobals.TextScaleLarge, text_fg = PiratesGuiGlobals.TextFG1, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getInterfaceFont(), textMayChange = 0) self.voodooLabel.hide() self.statusEffectsPanel = StatusEffectsPanel.StatusEffectsPanel(parent = self) flagModel = loader.loadModel('models/gui/flag_icons') flagModel2 = loader.loadModel('models/gui/gui_icons_weapon') flagModels = [ flagModel.find('**/flag_undead'), flagModel.find('**/flag_navy'), flagModel.find('**/flag_eitc'), flagModel2.find('**/pir_t_ico_dol_straw')] for icon in flagModels: if icon == flagModel2.find('**/pir_t_ico_dol_straw'): icon.setScale(0.10000000000000001) else: icon.setScale(0.44) icon.flattenStrong() self.icons = { PiratesGlobals.UNDEAD_TEAM: flagModels[0], PiratesGlobals.NAVY_TEAM: flagModels[1], PiratesGlobals.TRADING_CO_TEAM: flagModels[2], PiratesGlobals.FRENCH_UNDEAD_TEAM: flagModels[0], PiratesGlobals.SPANISH_UNDEAD_TEAM: flagModels[0], PiratesGlobals.PLAYER_TEAM: flagModels[3], PiratesGlobals.VOODOO_ZOMBIE_TEAM: flagModels[0], PiratesGlobals.BOUNTY_HUNTER_TEAM: flagModels[0] } self.pvpIcon = Beacon.getBeaconModel() self.pvpIcon.setScale(0.12) self.pvpIcon.flattenStrong() privateerLogos = loader.loadModel('models/textureCards/sailLogo') self.privateerLogos = { PVPGlobals.FrenchTeam: privateerLogos.find('**/logo_french_flag'), PVPGlobals.SpanishTeam: privateerLogos.find('**/logo_spanish_flag') } for logo in self.privateerLogos.itervalues(): logo.setScale(0.073999999999999996) logo.flattenStrong() self.currentIcon = None if showSkills: self.card = loader.loadModel('models/textureCards/skillIcons') icons = loader.loadModel('models/gui/gui_icons_weapon') icons.reparentTo(self.card) self.reloadFrame = DirectFrame(parent = self, state = DGG.DISABLED, relief = None) self.reloadFrame.hide() self.activeName = DirectLabel(parent = self.reloadFrame, state = DGG.DISABLED, relief = None, text = 'Using Skill', text_align = TextNode.ARight, text_scale = 0.059999999999999998, pos = (-0.050000000000000003, 0, 0.01), text_fg = PiratesGuiGlobals.TextFG11, text_shadow = PiratesGuiGlobals.TextShadow, text_font = PiratesGlobals.getPirateOutlineFont()) tex = self.card.find('**/base') self.reloadFrame['scale'] = 0.5 self.reloadFrame['image'] = tex self.reloadFrame['image_scale'] = 0.085000000000000006 self.reloadFrame['image_pos'] = (0, 0, 0.02) self.reloadFrame.setPos(0.12, 0, -0.019) self.reloadFrame.setScale(0.69999999999999996) tex = self.card.find('**/cutlass_sweep') self.skillFrame = DirectFrame(parent = self.reloadFrame, state = DGG.DISABLED, relief = None, sortOrder = 20, image_pos = (0, 0, 0)) self.skillFrame.setTransparency(1) self.skillFrame['image'] = tex self.skillFrame['image_scale'] = 0.10000000000000001 self.skillFrame['image_pos'] = (0, 0, 0.02) self.activeName['text_align'] = TextNode.ALeft self.activeName.setPos(0.089999999999999997, 0, 0.01)