1. # dracaryS
  2. import aralarına ekle
  3. from _weakref import proxy
  4. import os
  5. arat
  6. self.tilingMode = 0
  7. altına yapıştır
  8. self.langInt=0
  9. arat
  10. self.titleBar = GetObject("titlebar")
  11. altına yapistir
  12. self.board = GetObject("board")
  13. arat
  14. if musicInfo.fieldMusic==musicInfo.METIN2THEMA:
  15. self.selectMusicFile.SetText(uiSelectMusic.DEFAULT_THEMA)
  16. else:
  17. self.selectMusicFile.SetText(musicInfo.fieldMusic[:MUSIC_FILENAME_MAX_LEN])
  18. altına yapistir
  19. self.langInfo = {
  20. 1: localeInfo.TURKISH,
  21. 2: localeInfo.ENGLISH,
  22. }
  23. self.lang = ui.ComboBoxImage(self.board,"img.png",30,251+25)
  24. self.lang.SetCurrentItem(self.langInfo[1])
  25. self.lang.SetParent(self.board)
  26. for index, data in self.langInfo.iteritems():
  27. self.lang.InsertItem(index, data)
  28. self.lang.SetEvent(lambda x, point=proxy(self): point.__ClickLanguage(x))
  29. self.lang.Show()
  30. def __ClickLanguage(self,lang):
  31. self.langInt = lang
  32. self.lang.SetCurrentItem(self.langInfo[lang])
  33. self.lang.CloseListBox()
  34. # Uygula butonu modulu
  35. def __ChangeLanguage(self):
  36. if self.langInt == 1: # tr
  37. if "locale/tr" != app.GetLocalePath():
  38. file = open("locale.cfg", "w")
  39. file.write("10022 1254 tr")
  40. file.close()
  41. os.system('start metin2.exe')
  42. app.Exit()
  43. elif self.langInt == 2: # en
  44. if "locale/en" != app.GetLocalePath():
  45. file = open("locale.cfg", "w")
  46. file.write("10022 1250 en")
  47. file.close()
  48. os.system('start metin2.exe')
  49. app.Exit()