Skip to content

Commit

Permalink
Merge pull request #125 from sanmusen214/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
sanmusen214 authored Nov 9, 2024
2 parents 7125fc5 + f2bd544 commit bce1e57
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions common/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@


class TaskName(Enum):
"""
配置文件里的task任务名称
"""
LOGIN_GAME = "登录游戏"
MOMOTALK = "清momotalk"
CAFE = "咖啡馆"
Expand Down
2 changes: 1 addition & 1 deletion gui/components/check_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async def only_check_version():
async def get_newest_version(config):
"""检查最新版本并下载更新包"""
ui.notify(config.get_text("button_check_version"))
resultdict = await only_check_version(config)
resultdict = await only_check_version()
ui.notify(resultdict["msg"])
if not resultdict["status"]:
return
Expand Down
4 changes: 1 addition & 3 deletions gui/define.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ def __init__(self, task_enum: TaskName, json_key_name: str):
TaskStr(TaskName.LOGIN_GAME, "task_login_game"),
TaskStr(TaskName.MOMOTALK, "task_clear_momotalk"),
TaskStr(TaskName.CAFE, "task_cafe"),

# compatibility, just changed display name
TaskStr(TaskName.TACTICAL_CHALLENGE, "task_cafe_deprecated"),

TaskStr(TaskName.CAFE, "task_cafe_deprecated"),
TaskStr(TaskName.TIMETABLE, "task_timetable"),
TaskStr(TaskName.CLUB, "task_club"),
TaskStr(TaskName.MANUFACTURE, "task_craft"),
Expand Down
2 changes: 1 addition & 1 deletion gui/pages/Setting_task_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def task_order():
ui.label(f'{config.get_text("config_task")} {i+1}:')
atask = ui.select(real_taskname_to_show_taskname,
value=config.userconfigdict["TASK_ORDER"][i],
on_change=lambda v: config.userconfigdict["TASK_ORDER"].__setitem__(i, v.value))
on_change=lambda v,i=i: config.userconfigdict["TASK_ORDER"].__setitem__(i, v.value))
acheck = ui.checkbox(config.get_text("button_enable"), value=config.userconfigdict["TASK_ACTIVATE"][i], on_change=lambda v,i=i: config.userconfigdict["TASK_ACTIVATE"].__setitem__(i, v.value))
if i==0:
atask.set_enabled(False)
Expand Down
10 changes: 10 additions & 0 deletions gui/refactor_pages/json_set_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@


class ConfigPanel:
"""
连接子页面的i18n名称 与 渲染页面的函数
Parameters
==========
name: str
子页面标题
func:
子页面渲染函数
"""
def __init__(self, name: str, func: Callable[[], None]):
self.name = name
self.func = func
Expand Down
1 change: 1 addition & 0 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def check_and_update():
# 根据update.zip结尾的url下载文件
target_url = version_info.update_zip_url
targetfilename = os.path.basename(target_url)
print("Dowloading...Please wait")
# 不存在zip文件则下载
if not os.path.exists(targetfilename):
try:
Expand Down

0 comments on commit bce1e57

Please sign in to comment.