Skip to content

Commit 6183f30

Browse files
committed
更新
1 parent 39b4e68 commit 6183f30

File tree

10 files changed

+50
-21
lines changed

10 files changed

+50
-21
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
cd. > "D:\Kin-project\SucroseGameAssistant/cache/maa_complete.txt"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@echo Rem ľçÄÔϨĆÁ
2-
TIMEOUT /T 1
3-
start /d "D:\Kin-project\SGA2.0" SGA.exe
1+
@echo Rem 电脑熄屏
2+
TIMEOUT /T 2
3+
start /d "D:\Kin-project\SucroseGameAssistant" SGA.exe
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Set shell = Wscript.createobject("wscript.shell")
2+
a=shell.run ("restart.bat",0)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@echo off
2+
tasklist|find /i "SGA.exe"
3+
if %errorlevel%==0 (
4+
echo "exit"
5+
) else (
6+
start /d "D:\Kin-project\SucroseGameAssistant" SGA.exe
7+
)
8+
@echo on
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Set shell = Wscript.createobject("wscript.shell")
2+
a=shell.run ("start-SGA.bat",0)

assets/main_window/schtasks_index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
" </Settings>\n",
4343
" <Actions Context=\"Author\">\n",
4444
" <Exec>\n",
45-
" <Command>D:\\Kin-project\\python-SGA/assets/main_window/bat_scr/start-SGA.vbs</Command>\n",
45+
" <Command>D:\\Kin-project\\SucroseGameAssistant/personal/bat/start-SGA.vbs</Command>\n",
4646
" <Arguments>C:\\Windows\\System32\\wscript.exe</Arguments>\n",
47-
" <WorkingDirectory>D:\\Kin-project\\python-SGA/assets/main_window/bat_scr</WorkingDirectory>\n",
47+
" <WorkingDirectory>D:\\Kin-project\\SucroseGameAssistant/personal/bat</WorkingDirectory>\n",
4848
" </Exec>\n",
4949
" </Actions>\n",
5050
"</Task>"

assets/main_window/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version": "v2.2.8"}
1+
{"version": "v2.3.0"}

ui/main/main_bottom.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from tools.environment import *
66
from traceback import format_exc
77
from os import rename
8+
import sys
89

910

1011
# 加载主窗口和函数

ui/main/main_down.py

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from time import localtime
77
from datetime import datetime
88
from tools.software import find_hwnd, close, get_pid
9+
from random import randint
910

1011

1112
class MainDown(MainBottom):
@@ -55,6 +56,14 @@ def load_main_config(self):
5556
self.indicate("主配置文件损坏,从备份中恢复")
5657
self.config.update(config)
5758
# 获取设置及分类
59+
if not exists("personal/config"):
60+
makedirs("personal/config")
61+
_listdir = listdir("personal/config")
62+
if not _listdir:
63+
newname = "默认配置" + str(randint(999, 10000))
64+
copyfile(r"assets\main_window\default_config.json",
65+
r"personal\config\00%s.json" % newname)
66+
_listdir = listdir("personal/config")
5867
for file in listdir("personal/config"):
5968
name, suffix = splitext(file)
6069
if suffix == ".json":
@@ -84,8 +93,6 @@ def load_main_config(self):
8493
config_list += [self.box_config_change.itemText(i)]
8594
if _text in config_list:
8695
self.box_config_change.setCurrentText(_text)
87-
# print(self.box_config_change.currentText())
88-
# print(self.box_config_change.currentIndex())
8996
self.state["text"] = _text
9097
self.state["index"] = self.box_config_change.currentIndex()
9198
else:
@@ -98,10 +105,12 @@ def load_main_config(self):
98105
if env.workdir != self.config["work_path"]:
99106
if not exists("cache"):
100107
makedirs("cache")
108+
if not exists("personal/bat"):
109+
makedirs("personal/bat")
101110
self.config["work_path"] = env.workdir
102111
vbs_dir = "%s/personal/bat" % env.workdir
103112
vbs_path = "%s/personal/bat/start-SGA.vbs" % env.workdir
104-
with open("personal/schtasks_index.json", 'r', encoding='utf-8') as m:
113+
with open("assets/main_window/schtasks_index.json", 'r', encoding='utf-8') as m:
105114
xml_dir = load(m)
106115
xml_list = xml_dir["part2"]
107116
xml_list[32] = " <Command>" + vbs_path + "</Command>\n"
@@ -110,31 +119,36 @@ def load_main_config(self):
110119
with open("personal/schtasks_index.json", 'w', encoding='utf-8') as x:
111120
dump(xml_dir, x, ensure_ascii=False, indent=1)
112121

113-
f = open("personal/bat/start-SGA.bat", 'r', encoding='utf-8')
122+
f = open("assets/main_window/bat_scr/start-SGA.bat", 'r', encoding='utf-8')
114123
start_list = f.readlines()
115124
f.close()
116125
start_list[5] = "start /d \"%s\" SGA.exe True\n" % env.workdir
117126
f = open("personal/bat/start-SGA.bat", 'w', encoding='utf-8')
118127
f.writelines(start_list)
119128
f.close()
120129

121-
f = open("personal/bat/restart.bat", 'r', encoding='utf-8')
130+
f = open("assets/main_window/bat_scr/restart.bat", 'r', encoding='utf-8')
122131
start_list = f.readlines()
123132
f.close()
124133
start_list[2] = "start /d \"%s\" SGA.exe\n" % env.workdir
125134
f = open("personal/bat/restart.bat", 'w', encoding='utf-8')
126135
f.writelines(start_list)
127136
f.close()
128137

129-
_path = "personal/bat/maa_create.bat"
130-
if exists(_path):
131-
f = open(_path, 'r', encoding='ansi')
132-
bat_list = f.readlines()
133-
f.close()
134-
bat_list[1] = f" cd. > \"{env.workdir}/cache/maa_complete.txt\""
135-
f = open(_path, 'w', encoding='ansi')
136-
f.writelines(bat_list)
137-
f.close()
138+
f = open("assets/main_window/bat_scr/maa_create.bat", 'r', encoding='ansi')
139+
bat_list = f.readlines()
140+
f.close()
141+
bat_list[1] = f" cd. > \"{env.workdir}/cache/maa_complete.txt\""
142+
f = open("personal/bat/maa_create.bat", 'w', encoding='ansi')
143+
f.writelines(bat_list)
144+
f.close()
145+
146+
if not exists("personal/bat/restart.vbs"):
147+
copyfile(r"assets/main_window/bat_scr/restart.vbs",
148+
"personal/bat/restart.vbs")
149+
if not exists("personal/bat/start-SGA.vbs"):
150+
copyfile(r"assets/main_window/bat_scr/restart.vbs",
151+
"personal/bat/start-SGA.vbs")
138152

139153
# 保存主设置
140154
def save_main_data(self):

update_history.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2024/09/30 SGA 2.2.9
1+
2024/10/02 SGA 2.3.0
22
1���Ż��������༭�߼�
33
2���Ż����SGA������д�������˵�����
44
3���Ż�SGA�����������ж�

0 commit comments

Comments
 (0)