mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-25 12:42:41 -06:00
21 lines
874 B
Python
21 lines
874 B
Python
|
from pandac.PandaModules import NodePath
|
||
|
from direct.gui.DirectButton import DirectButton
|
||
|
from toontown.catalog import CatalogGlobals
|
||
|
|
||
|
|
||
|
class CatalogArrowButton(NodePath):
|
||
|
def __init__(self, parent, nodeName, clickEvent):
|
||
|
NodePath.__init__(self, parent.attachNewNode(nodeName))
|
||
|
|
||
|
self.clickEvent = clickEvent
|
||
|
|
||
|
self.normalNode = CatalogGlobals.CatalogNodePath.find('**/arrow_UP_'+nodeName).copyTo(self)
|
||
|
self.clickedNode = CatalogGlobals.CatalogNodePath.find('**/arrow_DN_'+nodeName).copyTo(self)
|
||
|
self.hoverNode = CatalogGlobals.CatalogNodePath.find('**/arrow_OVR_'+nodeName).copyTo(self)
|
||
|
|
||
|
self.arrowButton = DirectButton(parent=self, relief=None, image=(self.normalNode, self.clickedNode, self.hoverNode), command=self.clickEvent)
|
||
|
|
||
|
def cleanup(self):
|
||
|
self.arrowButton.destroy()
|
||
|
|
||
|
NodePath.removeNode(self)
|