style: 调整函数顺序

This commit is contained in:
知一一 2025-06-05 22:22:03 +08:00
parent 4d49c71b93
commit b256e7f50c
1 changed files with 100 additions and 100 deletions

View File

@ -494,6 +494,106 @@ Initialization() {
; }
}
;endregion 初始化
;region 软件更新
;tag 检查更新
CheckForUpdateHandler(isManualCheck) {
global currentVersion, usr, repo, latestObj ;确保能访问全局变量
try {
latestObj := Github.latest(usr, repo)
if (currentVersion != latestObj.version) {
MyGui := Gui("+Resize", "更新提示")
MyGui.Add("Text", "w300 xm ym", "DoroHelper存在更新版本:")
MyGui.Add("Text", "xp yp+20 w300", "版本号: " . latestObj.version)
MyGui.Add("Text", "xp yp+20 w300", "更新内容:")
MyEdit := MyGui.Add("Edit", "w250 h200 ReadOnly VScroll Border", latestObj.change_notes)
MyGui.Add("Text", "xp yp+210 w300", "`n是否下载?")
userresponse := ""
MyGui.Add("Button", "xm w100", "").OnEvent("Click", DownloadHandler)
MyGui.Add("Button", "x+10 w100", "").OnEvent("Click", (*) => MyGui.Destroy())
MyGui.Show("w300 h350 Center ")
}
else {
;没有新版本
if (isManualCheck) { ;只有手动检查时才提示
MsgBox("当前Doro已是最新版本", "检查更新")
}
}
}
catch as githubError {
;只有手动检查时才提示连接错误,自动检查时静默失败
if (isManualCheck) {
MsgBox("检查更新失败无法连接到Github或仓库信息错误`n(" githubError.Message ")", "检查更新错误", "IconX")
}
}
}
;tag 专用下载处理函数
DownloadHandler(*) {
try {
downloadTempName := "DoroDownload.exe"
finalName := "DoroHelper-" latestObj.version ".exe"
; 执行下载(原下载代码)
Github.Download(latestObj.downloadURLs[1], A_ScriptDir "\" downloadTempName)
FileMove(A_ScriptDir "\" downloadTempName, A_ScriptDir "\" finalName, 1)
MsgBox("新版本已下载至当前目录: " finalName, "下载完成")
ExitApp
}
catch as downloadError {
MsgBox("下载失败,请检查网络`n(" downloadError.Message ")", "下载错误", "IconX")
if FileExist(A_ScriptDir "\" downloadTempName)
FileDelete(A_ScriptDir "\" downloadTempName)
}
}
;tag 点击检查更新
ClickOnCheckForUpdate(*) {
; if InStr(currentVersion, "beta") {
; MsgBox ("测试版本禁用更新!")
; MsgBox ("请加群584275905")
; Pause
; }
CheckForUpdateHandler(true) ;调用核心函数,标记为手动检查
}
;endregion 软件更新
;region 消息辅助函数
MsgSponsor(*) {
Run("https://github.com/1204244136/DoroHelper?tab=readme-ov-file#%E6%94%AF%E6%8C%81%E5%92%8C%E9%BC%93%E5%8A%B1")
; myGui := Gui()
; myGui.Title := "Make Doro Great Again"
; myGui.Add("Picture", "w200 h200", "./img/alipay.png")
; myGui.Add("Picture", "x+15 w200 h200", "./img/weixin.png")
; MyGui.Add("Text", "xs Section w400 h50 Center Wrap", "知一一:前任作者牢 H 停更后DoroHelper 的绝大部分维护和新功能的添加都是我在做,这耗费了我大量时间和精力,希望有条件的小伙伴们能支持一下")
; myGui.Add("Button", "xs+180 y+m w50 h20 ", "确定").OnEvent("Click", (*) => myGui.Destroy())
; myGui.Show()
}
ClickOnHelp(*) {
msgbox "
(
#############################################
使
Doro设置保持默认就好
Doro失控Ctrl + 1
Doro失控Ctrl + 1
Doro失控Ctrl + 1
#############################################
- 16:9
- --
- --
-
- ****DoroHelper
- windows HDR显示
#############################################
-NIKKE启动器ACE反作弊系统扫完NIKKE主程序中央SHIFT UP logo出现之后DORO!Doro完成工作了
-DORO!
-使Doro
#############################################
其他:
-
-
)"
}
;endregion 消息辅助函数
;region 数据辅助函数
;tag 写入数据
WriteSettings(*) {
@ -586,106 +686,6 @@ ChangeNum(settingKey, GUICtrl, *) {
g_numeric_settings[settingKey] := GUICtrl.Value
}
;endregion 数据辅助函数
;region 消息函数合集
MsgSponsor(*) {
Run("https://github.com/1204244136/DoroHelper?tab=readme-ov-file#%E6%94%AF%E6%8C%81%E5%92%8C%E9%BC%93%E5%8A%B1")
; myGui := Gui()
; myGui.Title := "Make Doro Great Again"
; myGui.Add("Picture", "w200 h200", "./img/alipay.png")
; myGui.Add("Picture", "x+15 w200 h200", "./img/weixin.png")
; MyGui.Add("Text", "xs Section w400 h50 Center Wrap", "知一一:前任作者牢 H 停更后DoroHelper 的绝大部分维护和新功能的添加都是我在做,这耗费了我大量时间和精力,希望有条件的小伙伴们能支持一下")
; myGui.Add("Button", "xs+180 y+m w50 h20 ", "确定").OnEvent("Click", (*) => myGui.Destroy())
; myGui.Show()
}
ClickOnHelp(*) {
msgbox "
(
#############################################
使
Doro设置保持默认就好
Doro失控Ctrl + 1
Doro失控Ctrl + 1
Doro失控Ctrl + 1
#############################################
- 16:9
- --
- --
-
- ****DoroHelper
- windows HDR显示
#############################################
-NIKKE启动器ACE反作弊系统扫完NIKKE主程序中央SHIFT UP logo出现之后DORO!Doro完成工作了
-DORO!
-使Doro
#############################################
其他:
-
-
)"
}
;endregion 消息函数合集
;region 软件更新
;tag 检查更新
CheckForUpdateHandler(isManualCheck) {
global currentVersion, usr, repo, latestObj ;确保能访问全局变量
try {
latestObj := Github.latest(usr, repo)
if (currentVersion != latestObj.version) {
MyGui := Gui("+Resize", "更新提示")
MyGui.Add("Text", "w300 xm ym", "DoroHelper存在更新版本:")
MyGui.Add("Text", "xp yp+20 w300", "版本号: " . latestObj.version)
MyGui.Add("Text", "xp yp+20 w300", "更新内容:")
MyEdit := MyGui.Add("Edit", "w250 h200 ReadOnly VScroll Border", latestObj.change_notes)
MyGui.Add("Text", "xp yp+210 w300", "`n是否下载?")
userresponse := ""
MyGui.Add("Button", "xm w100", "").OnEvent("Click", DownloadHandler)
MyGui.Add("Button", "x+10 w100", "").OnEvent("Click", (*) => MyGui.Destroy())
MyGui.Show("w300 h350 Center ")
}
else {
;没有新版本
if (isManualCheck) { ;只有手动检查时才提示
MsgBox("当前Doro已是最新版本", "检查更新")
}
}
}
catch as githubError {
;只有手动检查时才提示连接错误,自动检查时静默失败
if (isManualCheck) {
MsgBox("检查更新失败无法连接到Github或仓库信息错误`n(" githubError.Message ")", "检查更新错误", "IconX")
}
}
}
;tag 专用下载处理函数
DownloadHandler(*) {
try {
downloadTempName := "DoroDownload.exe"
finalName := "DoroHelper-" latestObj.version ".exe"
; 执行下载(原下载代码)
Github.Download(latestObj.downloadURLs[1], A_ScriptDir "\" downloadTempName)
FileMove(A_ScriptDir "\" downloadTempName, A_ScriptDir "\" finalName, 1)
MsgBox("新版本已下载至当前目录: " finalName, "下载完成")
ExitApp
}
catch as downloadError {
MsgBox("下载失败,请检查网络`n(" downloadError.Message ")", "下载错误", "IconX")
if FileExist(A_ScriptDir "\" downloadTempName)
FileDelete(A_ScriptDir "\" downloadTempName)
}
}
;tag 点击检查更新
ClickOnCheckForUpdate(*) {
; if InStr(currentVersion, "beta") {
; MsgBox ("测试版本禁用更新!")
; MsgBox ("请加群584275905")
; Pause
; }
CheckForUpdateHandler(true) ;调用核心函数,标记为手动检查
}
;endregion 软件更新
;region 坐标辅助函数
;tag 点击
UserClick(sX, sY, k) {