Skip to content

Commit

Permalink
导入模板时填上lss文件头部数据 resolves #1
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Feb 16, 2022
1 parent 10bbb3b commit 82adc8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions categories.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func onSelectCategory() {
return
}
}
categoryName = j.CategoryName
saveTimeCheckBox.SetEnabled(false)
saveTimeCheckBox.SetChecked(false)
}
Expand Down
6 changes: 6 additions & 0 deletions splitsfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"strings"
)

var categoryName string

type xmlIcon struct {
Icon string `xml:",cdata"`
}
Expand Down Expand Up @@ -226,6 +228,7 @@ func loadSplitFile(file string) {
}
}
fileRunData = run
categoryName = run.CategoryName
saveTimeCheckBox.SetChecked(true)
saveTimeCheckBox.SetEnabled(true)
}
Expand Down Expand Up @@ -274,6 +277,9 @@ func saveSplitsFile() {
Splits: xmlSplits{},
},
}
if len(categoryName) != 0 {
run.CategoryName = categoryName
}
if saveTime && fileRunData != nil {
run.Version = fileRunData.Version
run.GameIcon = fileRunData.GameIcon
Expand Down

0 comments on commit 82adc8b

Please sign in to comment.