Categories with underscore

This commit is contained in:
2026-05-31 14:49:52 +02:00
parent c57b2e21a2
commit 3e169276f7
5 changed files with 106 additions and 106 deletions
+21 -21
View File
@@ -2178,10 +2178,10 @@ func TestPlanHAKsWritesManifestWithoutArchives(t *testing.T) {
func TestBuildHAKsWritesConfiguredHeadVisualeffectsAutogenManifest(t *testing.T) {
root := t.TempDir()
mustMkdir(t, filepath.Join(root, "src"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "chestaccessory"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "headaccessory"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "headdecoration"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "headfeature", "hair"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "chest_accessories"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "head_accessories"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "head_decorations"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "head_features", "hair"))
mustMkdir(t, filepath.Join(root, "build"))
mustWriteFile(t, filepath.Join(root, "nwn-tool.json"), `{
@@ -2200,7 +2200,7 @@ func TestBuildHAKsWritesConfiguredHeadVisualeffectsAutogenManifest(t *testing.T)
{
"id": "head_visualeffects",
"root": "vfxs",
"include": ["chestaccessory/**/*.mdl", "headaccessory/**/*.mdl", "headdecoration/**/*.mdl", "headfeature/**/*.mdl"],
"include": ["chest_accessories/**/*.mdl", "head_accessories/**/*.mdl", "head_decorations/**/*.mdl", "head_features/**/*.mdl"],
"derive": {
"kind": "model_stem",
"group_from": "first_path_segment"
@@ -2212,8 +2212,8 @@ func TestBuildHAKsWritesConfiguredHeadVisualeffectsAutogenManifest(t *testing.T)
},
"head_visualeffects": {
"groups": {
"headaccessory": {
"prefix": "headaccessory",
"head_accessories": {
"prefix": "head_accessories",
"model_columns": ["Imp_HeadCon_Node", "Imp_Root_H_Node"]
}
}
@@ -2233,10 +2233,10 @@ func TestBuildHAKsWritesConfiguredHeadVisualeffectsAutogenManifest(t *testing.T)
}
`)
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "chestaccessory", "tfx_sash.mdl"), "sash")
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "headaccessory", "hfx_bandana.mdl"), "bandana")
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "headdecoration", "hfx_laurel.mdl"), "laurel")
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "headfeature", "hair", "hfx_hair_bangs.mdl"), "hair")
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "chest_accessories", "tfx_sash.mdl"), "sash")
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "head_accessories", "hfx_bandana.mdl"), "bandana")
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "head_decorations", "hfx_laurel.mdl"), "laurel")
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "head_features", "hair", "hfx_hair_bangs.mdl"), "hair")
p, err := project.Load(root)
if err != nil {
@@ -2267,16 +2267,16 @@ func TestBuildHAKsWritesConfiguredHeadVisualeffectsAutogenManifest(t *testing.T)
text := string(headRaw)
for _, want := range []string{
`"id": "head_visualeffects"`,
`"group": "chestaccessory"`,
`"group": "chest_accessories"`,
`"model_stem": "tfx_sash"`,
`"group": "headaccessory"`,
`"group": "head_accessories"`,
`"model_stem": "hfx_bandana"`,
`"head_visualeffects": {`,
`"model_columns": [`,
`"Imp_Root_H_Node"`,
`"group": "headdecoration"`,
`"group": "head_decorations"`,
`"model_stem": "hfx_laurel"`,
`"group": "headfeature"`,
`"group": "head_features"`,
`"model_stem": "hfx_hair_bangs"`,
} {
if !strings.Contains(text, want) {
@@ -2288,7 +2288,7 @@ func TestBuildHAKsWritesConfiguredHeadVisualeffectsAutogenManifest(t *testing.T)
func TestBuildHAKsWritesFolderCategoryInHeadVisualeffectsAutogenManifest(t *testing.T) {
root := t.TempDir()
mustMkdir(t, filepath.Join(root, "src"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "headfeature", "sinfar", "ears_plt"))
mustMkdir(t, filepath.Join(root, "assets", "vfxs", "head_features", "sinfar", "ears_plt"))
mustMkdir(t, filepath.Join(root, "build"))
mustWriteFile(t, filepath.Join(root, "nwn-tool.json"), `{
@@ -2307,7 +2307,7 @@ func TestBuildHAKsWritesFolderCategoryInHeadVisualeffectsAutogenManifest(t *test
{
"id": "head_visualeffects",
"root": "vfxs",
"include": ["headfeature/**/*.mdl"],
"include": ["head_features/**/*.mdl"],
"derive": {
"kind": "model_stem",
"group_from": "first_path_segment"
@@ -2319,7 +2319,7 @@ func TestBuildHAKsWritesFolderCategoryInHeadVisualeffectsAutogenManifest(t *test
},
"head_visualeffects": {
"groups": {
"headfeature": {
"head_features": {
"model_columns": ["Imp_HeadCon_Node", "Imp_Root_H_Node"]
}
},
@@ -2346,7 +2346,7 @@ func TestBuildHAKsWritesFolderCategoryInHeadVisualeffectsAutogenManifest(t *test
}
`)
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "headfeature", "sinfar", "ears_plt", "hfx_Ear_EL_L.mdl"), "ear")
mustWriteFile(t, filepath.Join(root, "assets", "vfxs", "head_features", "sinfar", "ears_plt", "hfx_Ear_EL_L.mdl"), "ear")
p, err := project.Load(root)
if err != nil {
@@ -2368,11 +2368,11 @@ func TestBuildHAKsWritesFolderCategoryInHeadVisualeffectsAutogenManifest(t *test
}
text := string(headRaw)
for _, want := range []string{
`"group": "headfeature"`,
`"group": "head_features"`,
`"subgroup": "sinfar/ears_plt"`,
`"category": "ears_plt"`,
`"model_stem": "hfx_Ear_EL_L"`,
`"source": "headfeature/sinfar/ears_plt/hfx_Ear_EL_L.mdl"`,
`"source": "head_features/sinfar/ears_plt/hfx_Ear_EL_L.mdl"`,
`"group_token_source": "folder_name"`,
`"category_from": "immediate_parent"`,
} {