Skip to content

Commit

Permalink
v0.99.4 (#15)
Browse files Browse the repository at this point in the history
* 增加wechat捐助通道

* fix Instrument save issue

* - 修复了试听音色保存的问题,之前在音色为第一种时退出会发生问题
- Fixed the problem of saving instruments settings, which previously occurred when the instruments was the first one to exit
- 现在导入谱面的同时就会自动解析音符了,之前为试听或演奏开始才解析
- The notes are now automatically resolved when importing a sheet, instead of only at the beginning of listening or playing.
- 增加了免费示例谱面
- Added free sample sheets

* add video link in README

* better distribution

* auto update src select

* v0.99.4
  • Loading branch information
Nigh authored Jan 6, 2022
1 parent b580832 commit 69cd2f7
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 51 deletions.
40 changes: 28 additions & 12 deletions DoMiSo.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,37 @@ FileEncoding, UTF-8

#include meta.ahk

outputVersion()
if A_IsCompiled
debug:=0
Else
debug:=1
;@Ahk2Exe-IgnoreBegin
if A_Args.Length() > 0
{
for n, param in A_Args
{
RegExMatch(param, "--out=(\w+)", outName)
if(outName1=="version") {
f := FileOpen(versionFilename,"w","UTF-8-RAW")
f.Write(version)
f.Close()
ExitApp
}
}
}
;@Ahk2Exe-IgnoreEnd

;@Ahk2Exe-SetCompanyName HelloWorks
;@Ahk2Exe-SetName Domiso Genshin
;@Ahk2Exe-SetDescription Domiso Genshin
;@Ahk2Exe-SetVersion version
;@Ahk2Exe-SetMainIcon icon.ico
;@Ahk2Exe-ExeName Domiso-Genshin

debugHotkey:=debug
; debugHotkey:=0
IniRead, nonAdmin, setting.ini, update, nonAdminMode, 0
if(!nonAdmin){
UAC()
}
if debug
{
;@Ahk2Exe-IgnoreBegin
MsgBox, 0x41030,ATTENTION,You are running DEBUG version of the program!!!
}
;@Ahk2Exe-IgnoreEnd

; Is it limited to in genshin use
genshinLimit := 1

Expand Down Expand Up @@ -550,10 +565,11 @@ IniWrite, % version, setting.ini, update, ver
log_flush()
ExitApp

#If debugHotkey
;@Ahk2Exe-IgnoreBegin
F5::ExitApp
F6::Reload
#If
;@Ahk2Exe-IgnoreEnd

F8::genshin_stop()
F9::Gosub, func_btn_play

Expand Down
9 changes: 1 addition & 8 deletions Gui.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,7 @@ Gui, Add, pic, % "x" ui.statuBar.pos.x " y" ui.statuBar.pos.y " w" ui.statuBar.s


hBitmap:={}
if debug
{
hBitmap.title:=hBitmapBy2ColorAndText(ui.title.size.w,ui.title.size.h,ui.fgcolor,"DEBUG","bold cFFCC9999 S48 Left")
}
Else
{
hBitmap.title:=hBitmapBy2ColorAndText(ui.title.size.w,ui.title.size.h,ui.fgcolor,"DoMiSo","bold cFFCC9999 S48 Left")
}
hBitmap.title:=hBitmapBy2ColorAndText(ui.title.size.w,ui.title.size.h,ui.fgcolor,"DoMiSo","bold cFFCC9999 S48 Left")
hBitmap.genshin:=hBitmapBy2ColorAndText(ui.ver.size.w,ui.ver.size.h,ui.fgcolor,"Genshin v" version "`n@github.com/Nigh","cFF666666 S14 Right")

hBitmap.hotkey:=hBitmapBy2ColorAndText(ui.button1.size.w,20,ui.fgcolor,"F8:Stop F9:Start","bold cFFCC9999 S14 Left")
Expand Down
5 changes: 5 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Domiso原神特别版

Domiso Genshin ver

## v0.99.4

- 现在更新源将会自动选择
- The update source will now be automatically selected

## v0.99.3

- 修复了试听音色保存的问题,之前在音色为第一种时退出会发生问题
Expand Down
2 changes: 1 addition & 1 deletion dist.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If (ErrorLevel)
MsgBox, % "updater.ahk`nERROR CODE=" ErrorLevel
ExitApp
}
RunWait, ahk2exe.exe /in %ahkFilename% /out %binaryFilename% /icon icon.ico /compress 1
RunWait, ahk2exe.exe /in %ahkFilename% /out %binaryFilename% /compress 1
If (ErrorLevel)
{
MsgBox, % ahkFilename "`nERROR CODE=" ErrorLevel
Expand Down
2 changes: 1 addition & 1 deletion meta.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FileEncoding, UTF-8
name_en:="Domiso Automata"
name_zh:="原神自动弹琴人偶"
version:="0.99.3"
version:="0.99.4"
versionFilename:="version.txt"
ahkFilename:="DoMiSo.ahk"
binaryFilename:="Domiso-Genshin.exe"
Expand Down
74 changes: 45 additions & 29 deletions update.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,79 @@ IfExist, updater.exe
{
FileDelete, updater.exe
}
outputVersion(){
global
if A_Args.Length() > 0
{
for n, param in A_Args
{
RegExMatch(param, "--out=(\w+)", outName)
if(outName1=="version") {
f := FileOpen(versionFilename,"w","UTF-8-RAW")
f.Write(version)
f.Close()
ExitApp
}
}
}
}

IniRead, logLevel, setting.ini, update, log, 0
IniRead, lastUpdate, setting.ini, update, last, 0
IniRead, autoUpdate, setting.ini, update, autoupdate, 1
IniRead, updateMirror, setting.ini, update, mirror, fastgit
IniRead, updateMirror, setting.ini, update, mirror, 1
IniWrite, % updateMirror, setting.ini, update, mirror
IniRead, version_str, setting.ini, update, ver, 0
IniRead, inst, setting.ini, update, inst, 11
log_write("Start at " A_YYYY "-" A_MM "-" A_DD, 0)
mirrorList:=["https://github.com"
,"https://ghproxy.com/https://github.com"
,"https://download.fastgit.org"
,"https://github.com.cnpmjs.org"]
updatemirrorTried:=Array()
today:=A_MM . A_DD
if(autoUpdate) {
if(lastUpdate!=today) {
log_write("Getting Update",0)
; MsgBox,,Update,Getting Update`n获取最新版本,2
get_latest_version()
} else {
ttm(name_en " Start`nv" version "`n" name_zh "启动")
TrayTip,,% name_en " Start`nv" version "`n" name_zh "启动"
}
} else {
log_write("Update Skiped",0)
if(lastUpdate!=today) {
MsgBox,,Update,Update Skiped`n跳过升级`n`nCurrent version`n当前版本`nv%version%,2
TrayTip, Update,Update Skiped`n跳过升级`n`nCurrent version`n当前版本`nv%version%
IniWrite, % A_MM A_DD, setting.ini, update, last
}
}

get_latest_version(){
global
req := ComObjCreate("MSXML2.ServerXMLHTTP")
if(updateMirror=="fastgit") {
updateSite:="https://download.fastgit.org"
} else if(updateMirror=="cnpmjs") {
updateSite:="https://github.com.cnpmjs.org"
} else {
updateSite:="https://github.com"
updateMirror:=updateMirror+0
if(updateMirror > mirrorList.Length() or updateMirror <= 0) {
updateMirror := 1
}
updateSite:=mirrorList[updateMirror]
updateReqDone:=0
req.open("GET", updateSite downloadUrl versionFilename, true)
req.onreadystatechange := Func("updateReady")
req.send()
SetTimer, updateTimeout, -10000
Return
updateTimeout:
tryNextUpdate()
Return
}
tryNextUpdate()
{
global mirrorList, updateMirror, updatemirrorTried
updatemirrorTried.Push(updateMirror)
SetTimer, updateTimeout, Off
For k, v in mirrorList
{
tested:=False
for _, p in updatemirrorTried
{
if(p=k) {
tested:=True
break
}
}
if not tested {
updateMirror:=k
get_latest_version()
Return
}
}
TrayTip, , % "Update failed`n`n更新失败",, 0x3
}

; with MSXML2.ServerXMLHTTP method, there would be multiple callback called
updateReqDone:=0
updateReady(){
global req, version, updateReqDone, updateSite, downloadUrl, downloadFilename
log_write("update req.readyState=" req.readyState, 1)
Expand All @@ -78,9 +92,10 @@ updateReady(){
updateReqDone := 1
log_write("update req.status=" req.status, 1)
if (req.status == 200){ ; OK.
SetTimer, updateTimeout, Off
; MsgBox % "Latest version: " req.responseText
RegExMatch(version, "(\d+)\.(\d+)\.(\d+)", verNow)
RegExMatch(req.responseText, "(\d+)\.(\d+)\.(\d+)", verNew)
RegExMatch(req.responseText, "^(\d+)\.(\d+)\.(\d+)$", verNew)
if((verNew1>verNow1)
|| (verNew1==verNow1 && ((verNew2>verNow2)
|| (verNew2==verNow2 && verNew3>verNow3)))){
Expand All @@ -103,6 +118,7 @@ updateReady(){
IniWrite, % A_MM A_DD, setting.ini, update, last
}
} else {
MsgBox, 16,, % "Update failed`n`n更新失败`n`nStatus=" req.status
tryNextUpdate()
; MsgBox, 16,, % "Update failed`n`n更新失败`n`nStatus=" req.status
}
}

0 comments on commit 69cd2f7

Please sign in to comment.