Poodletooth-iLand/toontown/catalog/CatalogArrowButton.py
2015-03-03 17:10:12 -05:00

21 lines
No EOL
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)