1. if app.ADD_INVENTORY:
  2. def en_ac(self):
  3. if player.GetEnvanter() < 4:
  4. envanter = 2
  5. self.questionDialog = uiCommon.QuestionDialog()
  6. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  7. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  8. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  9. self.questionDialog.Open()
  10. # self.questionDialog.slotIndex = slotIndex
  11. elif player.GetEnvanter() == 4 or player.GetEnvanter() == 5:
  12. envanter = 3
  13. self.questionDialog = uiCommon.QuestionDialog()
  14. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  15. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  16. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  17. self.questionDialog.Open()
  18. # self.questionDialog.slotIndex = slotIndex
  19. elif player.GetEnvanter() == 6 or player.GetEnvanter() == 7 or player.GetEnvanter() == 8:
  20. envanter = 4
  21. self.questionDialog = uiCommon.QuestionDialog()
  22. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  23. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  24. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  25. self.questionDialog.Open()
  26. # self.questionDialog.slotIndex = slotIndex
  27. elif player.GetEnvanter() == 9 or player.GetEnvanter() == 10 or player.GetEnvanter() == 11:
  28. envanter = 5
  29. self.questionDialog = uiCommon.QuestionDialog()
  30. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  31. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  32. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  33. self.questionDialog.Open()
  34. # self.questionDialog.slotIndex = slotIndex
  35. elif player.GetEnvanter() == 12 or player.GetEnvanter() == 13 or player.GetEnvanter() == 14:
  36. envanter = 6
  37. self.questionDialog = uiCommon.QuestionDialog()
  38. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  39. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  40. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  41. self.questionDialog.Open()
  42. # self.questionDialog.slotIndex = slotIndex
  43. elif player.GetEnvanter() == 15 or player.GetEnvanter() == 16 or player.GetEnvanter() == 17:
  44. envanter = 7
  45. self.questionDialog = uiCommon.QuestionDialog()
  46. self.questionDialog.SetText(localeInfo.ENVANTER_GENIS_1 % envanter)
  47. self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.genislet))
  48. self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
  49. self.questionDialog.Open()
  50. # self.questionDialog.slotIndex = slotIndex
  51. else:
  52. self.wndPopupDialog = uiCommon.PopupDialog()
  53. self.wndPopupDialog.SetText(localeInfo.ENVANTER_ZATEN_GENIS_3)
  54. self.wndPopupDialog.Open()