Skip to content

Commit

Permalink
Merge pull request #108 from Night-stars-1/master
Browse files Browse the repository at this point in the history
添加启动选择
  • Loading branch information
Night-stars-1 authored May 12, 2023
2 parents d65489d + 1ec1c7b commit 5d28af4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
14 changes: 10 additions & 4 deletions Honkai_Star_Rail.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
from get_width import get_width
import time
import os
import ctypes
import asyncio
import traceback
from pick import pick

from get_width import get_width
from tool.log import log, webhook_and_log
from tool.config import read_json_file, CONFIG_FILE_NAME
from tool.config import read_json_file, modify_json_file, CONFIG_FILE_NAME
from tool.update_file import update_file_main


def main():
if not read_json_file(CONFIG_FILE_NAME, False).get('start'):
title = "请选择代理地址:"
options = ['https://github.moeyy.xyz/', 'https://ghproxy.com/', '']
option, index = pick(options, title, indicator='=>', default_index=0)
modify_json_file(CONFIG_FILE_NAME, "github_proxy", option)
modify_json_file(CONFIG_FILE_NAME, "start", True)
if not read_json_file(CONFIG_FILE_NAME, False).get('map_debug'):
ghproxy = read_json_file(CONFIG_FILE_NAME, False).get('github_proxy')
# asyncio.run(check_file(ghproxy, "map"))
Expand Down
11 changes: 10 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
{"real_width": 1295, "auto_battle_persistence": 0, "real_height": 757, "map_debug": false, "github_proxy": "", "webhook_url": "","map_version": "1"}
{
"real_width": 1295,
"auto_battle_persistence": 0,
"real_height": 757,
"map_debug": false,
"github_proxy": "",
"webhook_url": "",
"map_version": "20230511224201",
"start": false
}
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ loguru
httpx
tqdm
pynput
aiohttp
aiohttp
pick
3 changes: 2 additions & 1 deletion tool/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def init_config_file(real_width, real_height):
"real_height": real_height,
"map_debug": False,
"github_proxy": "",
"webhook_url": ""
"webhook_url": "",
"start": False,
}
)
)
Expand Down

0 comments on commit 5d28af4

Please sign in to comment.