Quote:
Originally Posted by oceanusPT
0213 17:03:45301 :: Traceback (most recent call last):
0213 17:03:45301 :: File "game.py", line 1994, in BINARY_Highlight_Item
0213 17:03:45301 :: AttributeError
0213 17:03:45301 :: :
0213 17:03:45301 :: 'NoneType' object has no attribute 'Highligt_Item'
0213 17:03:45301 ::
why?
|
Because when you teleport, somewhere the GameWindow class is initialized again, and it overwrites the interface variable with None.
And never import interfaceModule at twice, or more. If you want to use methods from interfaceModule bind itself to the window where you want to use them.. There are many examples; inventory, dsinventory, chat etc (keyword: BindInterface)
So this code would be medicine for your problem:
Code:
def BINARY_Highlight_Item(self, inven_type, inven_pos):
if self.interface:
self.interface.Highligt_Item(inven_type, inven_pos)
If that is not working, which is impossible, here is another way:
Code:
def BINARY_Highlight_Item(self, inven_type, inven_pos):
try:
self.interface.Highligt_Item(inven_type, inven_pos)
except AttributeError:
pass