def __init__(self, manager, sizeX=1.0, sizeZ=1.0, countX=4, countZ=4, minCountZ=4, maxCountX=5, itemList=None): self.isReady = 0 InventoryUIStackContainer.InventoryUIStackContainer.__init__( self, manager, sizeX, sizeZ, minCountZ=minCountZ, maxCountX=maxCountX, itemList=itemList) self.initialiseoptions(InventoryUICardContainer) self.seperatorOn = 1 gui = loader.loadModel('models/gui/gui_main') scale = 0.33500000000000002 self.background = self.attachNewNode('background') self.background.setScale(scale) self.background.setPos(0.34999999999999998, 0, 0.46000000000000002) gui.find('**/gui_inv_cards').copyTo(self.background) self.background.flattenStrong() suitGui = loader.loadModel('models/gui/suit_icons') cardImage = suitGui.find('**/pir_t_gui_frm_goldCircle') if cardImage.isEmpty(): cardImage = None i = 0 for suit in ['h', 'd', 'c', 's']: if suit in ['h', 'd']: suitColor = (0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1.0) else: suitColor = (1.0, 1.0, 1.0, 1.0) suitFrame = DirectFrame( parent=self.background, relief=None, geom=suitGui.find('**/suit_icon_%s' % suit), geom_scale=0.10000000000000001, geom_color=suitColor, image=cardImage, image_scale=0.14999999999999999, pos=(i * 0.23400000000000001, 0, 0.90000000000000002)) i += 1 n = NodePath(suitFrame.node().getStateDef(0)) PiratesGlobals.flattenOrdered(n) ng = n.getChild(0).copyTo(self.background) ng.setPos(suitFrame.getPos()) n.getChild(0).hide() PiratesGlobals.flattenOrdered(self.background) self.cardDict = {} self.updateList = [] self.cardGroup = self.attachNewNode('cardGroup') self.cellSizeX = self.cellSizeX * 2.0
def __init__(self): InventoryPage.InventoryPage.__init__(self) self.initialiseoptions(TitlesPage) self.titles = [] self.selectedLandIndex = -1 self.selectedSeaIndex = -1 self.landButtons = [] self.seaButtons = [] self.forceInitLand = -1 self.forceInitSea = -1 self.loaded = 0 self.opened = 0 gui = loader.loadModel('models/gui/gui_main') scale = 0.33500000000000002 self.background = self.attachNewNode('background') self.background.setScale(scale) self.background.setPos(0.53000000000000003, 0, 0.73999999999999999) gui.find('**/gui_inv_red_general1').copyTo(self.background) PiratesGlobals.flattenOrdered(self.background) self.displayTitleFrame = DirectFrame(parent = self, relief = None, pos = (0.55000000000000004, 0, 1.175), text = PLocalizer.DisplayTitle, text_align = TextNode.ALeft, text_scale = 0.044999999999999998, text_pos = (-0.45000000000000001, 0.050000000000000003), text_fg = PiratesGuiGlobals.TextFG2, text_wordwrap = 20, text_shadow = (0, 0, 0, 1), textMayChange = 1, text_font = PiratesGlobals.getInterfaceFont()) self.displayTitleLandFrame = BorderFrame.BorderFrame(parent = self, relief = None, pos = (0.81000000000000005, 0, 1.02), frameSize = (-0.050000000000000003, 0.050000000000000003, -0.26000000000000001, -0.080000000000000002), modelName = 'pir_m_gui_frm_subframe', imageColorScale = VBase4(0.75, 0.75, 0.90000000000000002, 0.75), text = PLocalizer.DisplayTitleLand, text_align = TextNode.ACenter, text_scale = 0.032000000000000001, text_pos = (0, -0.01), text_fg = PiratesGuiGlobals.TextFG2, text_wordwrap = 15, text_shadow = (0, 0, 0, 1), textMayChange = 0, text_font = PiratesGlobals.getInterfaceFont()) self.displayTitleSeaFrame = BorderFrame.BorderFrame(parent = self, relief = None, pos = (0.96999999999999997, 0, 1.02), frameSize = (-0.050000000000000003, 0.050000000000000003, -0.26000000000000001, -0.080000000000000002), modelName = 'pir_m_gui_frm_subframe', imageColorScale = VBase4(0.75, 0.75, 0.90000000000000002, 0.75), text = PLocalizer.DisplayTitleSea, text_align = TextNode.ACenter, text_scale = 0.032000000000000001, text_pos = (0, -0.01), text_fg = PiratesGuiGlobals.TextFG2, text_wordwrap = 15, text_shadow = (0, 0, 0, 1), textMayChange = 0, text_font = PiratesGlobals.getInterfaceFont()) self.dummyFrame = DirectFrame(parent = self, relief = None, pos = (0.10000000000000001, 0, 0.89000000000000001)) self.accept('LocalAvatarInfamyUpdated', self.refresh) self.accept('landBadgeSet', self.updateLandBadge) self.accept('seaBadgeSet', self.updateSeaBadge)
def setupBackground(self): gui = loader.loadModel('models/gui/gui_main') scale = 0.335 self.background = self.attachNewNode('background') self.background.setScale(scale) self.background.setPos(0.23, 0, 0.52) gui.find('**/gui_inv_clothing').copyTo(self.background) PiratesGlobals.flattenOrdered(self.background)
def setupBackground(self): gui = loader.loadModel('models/gui/gui_main') scale = 0.33500000000000002 self.background = self.attachNewNode('background') self.background.setScale(scale) self.background.setPos(0.41999999999999998, 0, 0.52000000000000002) gui.find('**/gui_inv_red_general1').copyTo(self.background) PiratesGlobals.flattenOrdered(self.background)
def setupCellImage(self): self.cellImage = NodePath('empty') self.workingCellImage = NodePath('empty') self.focusCellImage = NodePath('empty') gui = loader.loadModel('models/gui/gui_icons_weapon') self.gridBacking = NodePath('backing') baseBacking = gui.find('**/pir_t_gui_frm_inventoryBox') extraCell = gui.find('**/pir_t_gui_frm_inventoryBox_over') extraCell.setScale(0.7) baseBacking.reparentTo(self.gridBacking) extraCell.reparentTo(self.gridBacking) PiratesGlobals.flattenOrdered(self.gridBacking) self.imageScale = 1.0 self.imagePos = (0.0, 0.0, 0.0) self.relief = DGG.FLAT
def setupCellImage(self): self.cellImage = NodePath("empty") self.workingCellImage = NodePath("empty") self.focusCellImage = NodePath("empty") gui = loader.loadModel("models/gui/gui_icons_weapon") self.gridBacking = NodePath("backing") baseBacking = gui.find("**/pir_t_gui_frm_inventoryBox") extraCell = gui.find("**/pir_t_gui_frm_inventoryBox_over") extraCell.setScale(0.69999999999999996) baseBacking.reparentTo(self.gridBacking) extraCell.reparentTo(self.gridBacking) PiratesGlobals.flattenOrdered(self.gridBacking) self.imageScale = 1.0 self.imagePos = (0.0, 0.0, 0.0) self.relief = DGG.FLAT
def __init__(self, manager, sizeX = 1.0, sizeZ = 1.0, countX = 4, countZ = 4, minCountZ = 4, maxCountX = 5, itemList = None): self.isReady = 0 InventoryUIStackContainer.InventoryUIStackContainer.__init__(self, manager, sizeX, sizeZ, minCountZ = minCountZ, maxCountX = maxCountX, itemList = itemList) self.initialiseoptions(InventoryUICardContainer) self.seperatorOn = 1 gui = loader.loadModel('models/gui/gui_main') scale = 0.33500000000000002 self.background = self.attachNewNode('background') self.background.setScale(scale) self.background.setPos(0.34999999999999998, 0, 0.46000000000000002) gui.find('**/gui_inv_cards').copyTo(self.background) self.background.flattenStrong() suitGui = loader.loadModel('models/gui/suit_icons') cardImage = suitGui.find('**/pir_t_gui_frm_goldCircle') if cardImage.isEmpty(): cardImage = None i = 0 for suit in [ 'h', 'd', 'c', 's']: if suit in [ 'h', 'd']: suitColor = (0.69999999999999996, 0.69999999999999996, 0.69999999999999996, 1.0) else: suitColor = (1.0, 1.0, 1.0, 1.0) suitFrame = DirectFrame(parent = self.background, relief = None, geom = suitGui.find('**/suit_icon_%s' % suit), geom_scale = 0.10000000000000001, geom_color = suitColor, image = cardImage, image_scale = 0.14999999999999999, pos = (i * 0.23400000000000001, 0, 0.90000000000000002)) i += 1 n = NodePath(suitFrame.node().getStateDef(0)) PiratesGlobals.flattenOrdered(n) ng = n.getChild(0).copyTo(self.background) ng.setPos(suitFrame.getPos()) n.getChild(0).hide() PiratesGlobals.flattenOrdered(self.background) self.cardDict = { } self.updateList = [] self.cardGroup = self.attachNewNode('cardGroup') self.cellSizeX = self.cellSizeX * 2.0
def __init__(self): InventoryPage.InventoryPage.__init__(self) self.initialiseoptions(TitlesPage) self.titles = [] self.selectedLandIndex = -1 self.selectedSeaIndex = -1 self.landButtons = [] self.seaButtons = [] self.forceInitLand = -1 self.forceInitSea = -1 self.loaded = 0 self.opened = 0 gui = loader.loadModel('models/gui/gui_main') scale = 0.33500000000000002 self.background = self.attachNewNode('background') self.background.setScale(scale) self.background.setPos(0.53000000000000003, 0, 0.73999999999999999) gui.find('**/gui_inv_red_general1').copyTo(self.background) PiratesGlobals.flattenOrdered(self.background) self.displayTitleFrame = DirectFrame( parent=self, relief=None, pos=(0.55000000000000004, 0, 1.175), text=PLocalizer.DisplayTitle, text_align=TextNode.ALeft, text_scale=0.044999999999999998, text_pos=(-0.45000000000000001, 0.050000000000000003), text_fg=PiratesGuiGlobals.TextFG2, text_wordwrap=20, text_shadow=(0, 0, 0, 1), textMayChange=1, text_font=PiratesGlobals.getInterfaceFont()) self.displayTitleLandFrame = BorderFrame.BorderFrame( parent=self, relief=None, pos=(0.81000000000000005, 0, 1.02), frameSize=(-0.050000000000000003, 0.050000000000000003, -0.26000000000000001, -0.080000000000000002), modelName='pir_m_gui_frm_subframe', imageColorScale=VBase4(0.75, 0.75, 0.90000000000000002, 0.75), text=PLocalizer.DisplayTitleLand, text_align=TextNode.ACenter, text_scale=0.032000000000000001, text_pos=(0, -0.01), text_fg=PiratesGuiGlobals.TextFG2, text_wordwrap=15, text_shadow=(0, 0, 0, 1), textMayChange=0, text_font=PiratesGlobals.getInterfaceFont()) self.displayTitleSeaFrame = BorderFrame.BorderFrame( parent=self, relief=None, pos=(0.96999999999999997, 0, 1.02), frameSize=(-0.050000000000000003, 0.050000000000000003, -0.26000000000000001, -0.080000000000000002), modelName='pir_m_gui_frm_subframe', imageColorScale=VBase4(0.75, 0.75, 0.90000000000000002, 0.75), text=PLocalizer.DisplayTitleSea, text_align=TextNode.ACenter, text_scale=0.032000000000000001, text_pos=(0, -0.01), text_fg=PiratesGuiGlobals.TextFG2, text_wordwrap=15, text_shadow=(0, 0, 0, 1), textMayChange=0, text_font=PiratesGlobals.getInterfaceFont()) self.dummyFrame = DirectFrame(parent=self, relief=None, pos=(0.10000000000000001, 0, 0.89000000000000001)) self.accept('LocalAvatarInfamyUpdated', self.refresh) self.accept('landBadgeSet', self.updateLandBadge) self.accept('seaBadgeSet', self.updateSeaBadge)