Fix skilldesc IDs

This commit is contained in:
CarlPoppa
2025-03-18 21:36:55 +00:00
committed by guiyomu-dev
parent dba9a7b5a5
commit 08a12b1967
3 changed files with 74 additions and 77 deletions

View File

@@ -5,6 +5,7 @@ import (
"bytes"
"fmt"
"os"
"regexp"
"strings"
"text/template"
)
@@ -108,6 +109,10 @@ func generateFile(sourcePath, destinationPath, tpl string) error {
"list": func() []string {
return make([]string, 0)
},
"extractInt": func(s string) string {
reg := regexp.MustCompile("[^0-9]")
return reg.ReplaceAllString(s, "")
},
}
t := template.Must(template.New("tpl").Funcs(funcMap).Parse(tpl))

View File

@@ -32,7 +32,11 @@ package skill
var Desc = map[ID]Description{
{{- range $key, $value := . }}
{{ $key }}: {Page: {{ $value.SkillPage }}, Row: {{ $value.SkillRow }}, Column: {{ $value.SkillColumn }}, ListRow: {{ $value.ListRow }}, IconCel: {{ $value.IconCel }}},
{{- if and (contains (index $value "str name") "kill") (extractInt (index $value "str name")) }}
{{- if ne (index $value "skilldesc") "townportal" }}
{{ extractInt (index $value "str name") }}: {Page: {{ $value.SkillPage }}, Row: {{ $value.SkillRow }}, Column: {{ $value.SkillColumn }}, ListRow: {{ $value.ListRow }}, IconCel: {{ $value.IconCel }}},
{{- end }}
{{- end }}
{{- end }}
}`