-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.idea/ | ||
*.xml | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
@echo off | ||
bitsadmin /transfer n https://raw.githubusercontent.com/LiveSplit/LiveSplit.AutoSplitters/master/LiveSplit.AutoSplitters.xml %~dp0\LiveSplit.AutoSplitters.xml | ||
bitsadmin /transfer n https://raw.githubusercontent.com/ShootMe/LiveSplit.HollowKnight/master/Components/LiveSplit.HollowKnight.dll %~dp0\LiveSplit.HollowKnight.dll | ||
go build -ldflags "-s -w -H=windowsgui" -o hksplitmaker.exe github.com/CuteReimu/hksplitmaker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package main | ||
|
||
import ( | ||
_ "embed" | ||
"github.com/lxn/walk" | ||
"github.com/lxn/win" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
//go:embed LiveSplit.AutoSplitters.xml | ||
var liveSplitAutoSplittersXml []byte | ||
|
||
//go:embed LiveSplit.HollowKnight.dll | ||
var liveSplitHollowKnightDll []byte | ||
|
||
func fixLiveSplit() { | ||
walk.MsgBox(mainWindow, "提示", "请选择LiveSplit.exe", walk.MsgBoxIconInformation) | ||
dlg := new(walk.FileDialog) | ||
dlg.Title = "请选择LiveSplit.exe" | ||
dlg.Filter = "LiveSplit.exe|LiveSplit.exe" | ||
dlg.Flags = win.OFN_FILEMUSTEXIST | ||
if ok, err := dlg.ShowOpen(mainWindow); err != nil { | ||
walk.MsgBox(mainWindow, "内部错误", err.Error(), walk.MsgBoxIconError) | ||
} else if ok { | ||
file := dlg.FilePath | ||
if filepath.Base(file) != "LiveSplit.exe" { | ||
walk.MsgBox(mainWindow, "错误", "您选择的并不是LiveSplit.exe", walk.MsgBoxIconError) | ||
return | ||
} | ||
dir := filepath.Dir(file) | ||
_, err := os.Stat(filepath.Join(dir, "Components")) | ||
if err != nil { | ||
walk.MsgBox(mainWindow, "错误", "计时器目录似乎有些问题,无法一键修复", walk.MsgBoxIconError) | ||
return | ||
} | ||
err = os.WriteFile(filepath.Join(dir, "LiveSplit.AutoSplitters.xml"), liveSplitAutoSplittersXml, 0644) | ||
if err != nil { | ||
walk.MsgBox(mainWindow, "内部错误", err.Error(), walk.MsgBoxIconError) | ||
return | ||
} | ||
err = os.WriteFile(filepath.Join(dir, "Components", "LiveSplit.HollowKnight.dll"), liveSplitHollowKnightDll, 0644) | ||
if err != nil { | ||
walk.MsgBox(mainWindow, "内部错误", err.Error(), walk.MsgBoxIconError) | ||
return | ||
} | ||
walk.MsgBox(mainWindow, "提示", "修复成功,建议使用管理员模式打开计时器", walk.MsgBoxIconInformation) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters