Jump to content

Button from game.py


Recommended Posts

  • Forum Moderator

You can do this extension very easy.

  • root/game.py
# Search for:
		self.interface = interfaceModule.Interface()
# Replace with:
		self.interface = interfaceModule.Interface(self)
  • root/interfaceModule.py
# Search for:
	def __init__(self):
		systemSetting.SetInterfaceHandler(self)
# Replace with:
	def __init__(self, wndGame):
		self.wndGame = wndGame
		systemSetting.SetInterfaceHandler(self)
  • root/uiInventory.py
	# PrintButton
	self.printButton = self.GetChild2("PrintButton")
	if self.printButton:
		self.printButton.SetEvent(ui.__mem_func__(self.ClickPrintButton))
			
	def ClickPrintButton(self):
		wndGame = self.interface.wndGame
		if wndGame:
			wndGame.BINARY_SetBigMessage('click_print_button') # Function from game.py

 

 

  • Love 4
Link to comment
Share on other sites

  • 3 years later...
On 11/26/2018 at 5:26 PM, VegaS™ said:

You can do this extension very easy.

  • root/game.py
# Search for:
		self.interface = interfaceModule.Interface()
# Replace with:
		self.interface = interfaceModule.Interface(self)
  • root/interfaceModule.py
# Search for:
	def __init__(self):
		systemSetting.SetInterfaceHandler(self)
# Replace with:
	def __init__(self, wndGame):
		self.wndGame = wndGame
		systemSetting.SetInterfaceHandler(self)
  • root/uiInventory.py
	# PrintButton
	self.printButton = self.GetChild2("PrintButton")
	if self.printButton:
		self.printButton.SetEvent(ui.__mem_func__(self.ClickPrintButton))
			
	def ClickPrintButton(self):
		wndGame = self.interface.wndGame
		if wndGame:
			wndGame.BINARY_SetBigMessage('click_print_button') # Function from game.py

 

 

0407 08:43:21645 :: Traceback (most recent call last):

0407 08:43:21645 ::   File "ui.py", line 1365, in CallEvent

0407 08:43:21645 ::   File "ui.py", line 87, in __call__

0407 08:43:21645 ::   File "ui.py", line 69, in __call__

0407 08:43:21645 ::   File "uiInventory.py", line 74, in ClickPrintButton

0407 08:43:21645 :: AttributeError
0407 08:43:21645 :: : 
0407 08:43:21645 :: 'SystemsWindow' object has no attribute 'interface'
0407 08:43:21645 :: 

My ClickPrintButton function :

    def ClickPrintButton(self):
        wndGame = self.interface.wndGame
        if wndGame:
            wndGame.BINARY_SetBigMessage('OpenTimerWindow') # Function from game.py

 

Edited by OcYa
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.