Dafuq313 2 Posted March 7, 2015 Share Posted March 7, 2015 I tried with this tut : [RELEASE] Coins in InventoryWindow. - Guides & HowTo - ********* OK,so i tried with that tutorial above to add a new line in inventory for coins ( not MD ) Uiinventory.py http://pastebin.com/9gNZPGVD Game.py http://pastebin.com/5h3vu9qg I deleted first part of game.py because was too long Sysser : [php] 0307 20:22:29455 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010). Automatic conversion will be attempted. 0307 20:22:49991 :: Traceback (most recent call last): 0307 20:22:49991 :: File "networkModule.py", line 247, in SetGamePhase 0307 20:22:49991 :: File "game.py", line 100, in __init__ 0307 20:22:49992 :: File "interfaceModule.py", line 288, in MakeInterface 0307 20:22:49992 :: File "interfaceModule.py", line 172, in __MakeWindows 0307 20:22:49992 :: File "uiInventory.py", line 262, in __init__ 0307 20:22:49992 :: File "uiInventory.py", line 399, in __LoadWindow 0307 20:22:49992 :: File "uiInventory.py", line 611, in RefreshStatus 0307 20:22:49993 :: NameError 0307 20:22:49993 :: : 0307 20:22:49993 :: global name 'locale' is not defined 0307 20:22:49993 :: Game.py : search for : #ACHIEVMENT "OsiagnieciaPunkty" : self.__Achievment, "achiev" : self.__ShowAchiev, #type|level/mob/boss|points The def are at the bottom of the file Uiinventory.py : search for : self.wndAP 1 Link to comment Share on other sites More sharing options...
Premium masodikbela 1358 Posted March 7, 2015 Premium Share Posted March 7, 2015 You should replace locale. to localeInfo. here: self.wndMoney.SetText(locale.NumberToMoneyString(money)) So it should looks like this: self.wndMoney.SetText(localeInfo.NumberToMoneyString(money)) 1 The one and only UI programming guideline Link to comment Share on other sites More sharing options...
Dafuq313 2 Posted March 7, 2015 Author Share Posted March 7, 2015 Can you exmplain me why ? i didnt modify that line,i just added self.wndAP.SetText("%s PO" % (str(constInfo.ACHIEV_POINTS))) After Link to comment Share on other sites More sharing options...
Premium Solution masodikbela 1358 Posted March 7, 2015 Premium Solution Share Posted March 7, 2015 Because the new clients use localeInfo instead of locale. If you watch your root, you can't see locale.py, but localeinfo.py. Maybe if you use import locale, you won't get any error, but it will call another module, because probably there is a locale.pyc in the client's lib folder. (anyway, your problem was global name 'locale' is not defined, what means you forgot to write import locale to your source, but if you do it, you will get another error, I explained why) 2 The one and only UI programming guideline Link to comment Share on other sites More sharing options...
Dafuq313 2 Posted March 7, 2015 Author Share Posted March 7, 2015 It works now thx for explanation too Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now