mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-10-31 08:47:54 +00:00
LaffShopGui cleanup
This commit is contained in:
parent
cfd7383ded
commit
9271489041
1 changed files with 9 additions and 66 deletions
|
@ -12,18 +12,7 @@ from LaffMeter import LaffMeter
|
||||||
class LaffShopGui(DirectFrame):
|
class LaffShopGui(DirectFrame):
|
||||||
|
|
||||||
def __init__(self, text):
|
def __init__(self, text):
|
||||||
DirectFrame.__init__(
|
DirectFrame.__init__(self, parent=aspect2d, relief=None, geom=DGG.getDefaultDialogGeom(), geom_color=ToontownGlobals.GlobalDialogColor, geom_scale=(1.33, 1, 1.1), pos=(0, 0, 0), text=text, text_scale=0.07, text_pos=(0, 0.475))
|
||||||
self,
|
|
||||||
parent=aspect2d,
|
|
||||||
relief=None,
|
|
||||||
geom=DGG.getDefaultDialogGeom(),
|
|
||||||
geom_color=ToontownGlobals.GlobalDialogColor,
|
|
||||||
geom_scale=(1.33, 1, 1.1),
|
|
||||||
pos=(0, 0, 0),
|
|
||||||
text=text,
|
|
||||||
text_scale=0.07,
|
|
||||||
text_pos=(0, 0.475),
|
|
||||||
)
|
|
||||||
self.initialiseoptions(LaffShopGui)
|
self.initialiseoptions(LaffShopGui)
|
||||||
self.text = text
|
self.text = text
|
||||||
self.timer = ToontownTimer.ToontownTimer()
|
self.timer = ToontownTimer.ToontownTimer()
|
||||||
|
@ -43,66 +32,20 @@ class LaffShopGui(DirectFrame):
|
||||||
self.__bindButtons()
|
self.__bindButtons()
|
||||||
self.laffMeter = LaffMeter(base.localAvatar.style, self.hp, self.maxHp)
|
self.laffMeter = LaffMeter(base.localAvatar.style, self.hp, self.maxHp)
|
||||||
self.laffMeter.reparentTo(self)
|
self.laffMeter.reparentTo(self)
|
||||||
self.laffMeter.setPos(0, 0, 0.15)
|
self.laffMeter.setPos(0, 0, 0.165)
|
||||||
self.laffMeter.setScale(0.13)
|
self.laffMeter.setScale(0.13)
|
||||||
self.__updateLaffMeter(0)
|
self.__updateLaffMeter(0)
|
||||||
|
|
||||||
def __setupButtons(self):
|
def __setupButtons(self):
|
||||||
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
||||||
arrowGui = loader.loadModel('phase_3/models/gui/create_a_toon_gui')
|
arrowGui = loader.loadModel('phase_3/models/gui/create_a_toon_gui')
|
||||||
okImageList = (
|
okImageList = (buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr'))
|
||||||
buttons.find('**/ChtBx_OKBtn_UP'),
|
cancelImageList = (buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr'))
|
||||||
buttons.find('**/ChtBx_OKBtn_DN'),
|
arrowImageList = (arrowGui.find('**/CrtATn_R_Arrow_UP'), arrowGui.find('**/CrtATn_R_Arrow_DN'), arrowGui.find('**/CrtATn_R_Arrow_RLVR'), arrowGui.find('**/CrtATn_R_Arrow_UP'))
|
||||||
buttons.find('**/ChtBx_OKBtn_Rllvr'),
|
self.cancelButton = DirectButton(parent=self, relief=None, image=cancelImageList, pos=(-0.2, 0, -0.4), text=LaffRestockGlobals.GuiCancel, text_scale=0.06, text_pos=(0, -0.1), command=self.__cancel)
|
||||||
)
|
self.okButton = DirectButton(parent=self, relief=None, image=okImageList, pos=(0.2, 0, -0.4), text=LaffRestockGlobals.GuiOk, text_scale=0.06, text_pos=(0, -0.1), command=self.__requestLaff)
|
||||||
cancelImageList = (
|
self.upArrow = DirectButton(parent=self, relief=None, image=arrowImageList, image_scale=(1, 1, 1), image3_color=Vec4(0.6, 0.6, 0.6, 0.25), pos=(0.2, 0, -0.165))
|
||||||
buttons.find('**/CloseBtn_UP'),
|
self.downArrow = DirectButton(parent=self, relief=None, image=arrowImageList, image_scale=(-1, 1, 1), image3_color=Vec4(0.6, 0.6, 0.6, 0.25), pos=(-0.2, 0, -0.165))
|
||||||
buttons.find('**/CloseBtn_DN'),
|
|
||||||
buttons.find('**/CloseBtn_Rllvr'),
|
|
||||||
)
|
|
||||||
arrowImageList = (
|
|
||||||
arrowGui.find('**/CrtATn_R_Arrow_UP'),
|
|
||||||
arrowGui.find('**/CrtATn_R_Arrow_DN'),
|
|
||||||
arrowGui.find('**/CrtATn_R_Arrow_RLVR'),
|
|
||||||
arrowGui.find('**/CrtATn_R_Arrow_UP'),
|
|
||||||
)
|
|
||||||
self.cancelButton = DirectButton(
|
|
||||||
parent=self,
|
|
||||||
relief=None,
|
|
||||||
image=cancelImageList,
|
|
||||||
pos=(-0.2, 0, -0.4),
|
|
||||||
text=LaffRestockGlobals.GuiCancel,
|
|
||||||
text_scale=0.06,
|
|
||||||
text_pos=(0, -0.1),
|
|
||||||
command=self.__cancel,
|
|
||||||
)
|
|
||||||
self.okButton = DirectButton(
|
|
||||||
parent=self,
|
|
||||||
relief=None,
|
|
||||||
image=okImageList,
|
|
||||||
pos=(0.2, 0, -0.4),
|
|
||||||
text=LaffRestockGlobals.GuiOk,
|
|
||||||
text_scale=0.06,
|
|
||||||
text_pos=(0, -0.1),
|
|
||||||
command=self.__requestLaff,
|
|
||||||
extraArgs=[],
|
|
||||||
)
|
|
||||||
self.upArrow = DirectButton(
|
|
||||||
parent=self,
|
|
||||||
relief=None,
|
|
||||||
image=arrowImageList,
|
|
||||||
image_scale=(1, 1, 1),
|
|
||||||
image3_color=Vec4(0.6, 0.6, 0.6, 0.25),
|
|
||||||
pos=(0.2, 0, -0.165),
|
|
||||||
)
|
|
||||||
self.downArrow = DirectButton(
|
|
||||||
parent=self,
|
|
||||||
relief=None,
|
|
||||||
image=arrowImageList,
|
|
||||||
image_scale=(-1, 1, 1),
|
|
||||||
image3_color=Vec4(0.6, 0.6, 0.6, 0.25),
|
|
||||||
pos=(-0.2, 0, -0.165),
|
|
||||||
)
|
|
||||||
buttons.removeNode()
|
buttons.removeNode()
|
||||||
arrowGui.removeNode()
|
arrowGui.removeNode()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue