Jump to content

Help import fuction in game.py


Recommended Posts

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Active Member

You can not use directly game function, so you need a hook

 

add your script under def __init__

self.Inithookabrir()
Add this function in your script

 

 

def Inithookabrir(self):
	global oldAbrir
	oldAbrir = game.GameWindow.abrirlogo
	game.GameWindow.abrirlogo = self.Abrir
 

and you use with like this

 

 

oldAbrir = 0
def Abrir(self):
	"""add Your functions"""
	
	global oldAbrir
	self.oldAbrir()
Link to comment
Share on other sites

  • Premium

You can not use directly game function, so you need a hook

 

add your script under def __init__

self.Inithookabrir()
Add this function in your script

 

 

def Inithookabrir(self):
	global oldAbrir
	oldAbrir = game.GameWindow.abrirlogo
	game.GameWindow.abrirlogo = self.Abrir
 

and you use with like this

 

 

oldAbrir = 0
def Abrir(self):
	"""add Your functions"""
	
	global oldAbrir
	self.oldAbrir()
0323 13:01:48104 :: Traceback (most recent call last):
 
0323 13:01:48104 ::   File "ui.py", line 1022, in CallEvent
 
0323 13:01:48109 ::     
0323 13:01:48109 :: apply(self.eventFunc, self.eventArgs)
 
0323 13:01:48109 ::   File "Djssnob.py", line 58, in a_func
 
0323 13:01:48110 ::     
0323 13:01:48110 :: self.oldAbrir()
 
0323 13:01:48110 :: AttributeError
0323 13:01:48110 :: : 
0323 13:01:48110 :: 'Dialog1' object has no attribute 'oldAbrir'
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.