config_menu.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # This Python file uses the following encoding: utf-8
  2. # @author runhey
  3. # github https://github.com/runhey
  4. import json
  5. from cached_property import cached_property
  6. from pydantic import BaseModel, ValidationError, validator, Field
  7. from module.config.utils import *
  8. class ConfigMenu:
  9. # 手动的代码配置菜单
  10. def __init__(self) -> None:
  11. self.menu = {}
  12. # 总览
  13. self.menu["Overview"] = []
  14. # 脚本设置
  15. self.menu['Script'] = ['Script', 'Restart', 'GlobalGame']
  16. # 刷御魂
  17. self.menu["Soul Zones"] = ['Orochi', 'Sougenbi', 'FallenSun', 'EternitySea']
  18. # 日常的任务
  19. self.menu["Daily Task"] = ['AreaBoss', 'GoldYoukai', 'ExperienceYoukai', 'Nian', 'RealmRaid']
  20. # 开发工具
  21. self.menu["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule', 'List Rule']
  22. @cached_property
  23. def gui_menu(self) -> str:
  24. """
  25. 生成的是json字符串
  26. :return:
  27. """
  28. return json.dumps(self.menu, ensure_ascii=False, sort_keys=False, default=str)
  29. if __name__ == "__main__":
  30. try:
  31. m = ConfigMenu()
  32. print(m.gui_menu)
  33. except:
  34. print('weih')