Skip to content

Commit

Permalink
Refactor to take advantage of new header settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Aug 14, 2024
1 parent e36d463 commit 55e2939
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 123 deletions.
143 changes: 22 additions & 121 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@
"auto-coloring": {
"name": "Auto Coloring Setting",
"type": {
"friendly": "Friendly | Auto Coloring",
"neutral": "Neutral | Auto Coloring",
"hostile": "Hostile | Auto Coloring",
"party": "Party | Auto Coloring"
"world": {
"friendly": "Friendly | Auto Coloring",
"neutral": "Neutral | Auto Coloring",
"hostile": "Hostile | Auto Coloring",
"party": "Party | Auto Coloring"
},
"player": {
"friendly": "Player | Friendly | Auto Coloring",
"neutral": "Player | Neutral | Auto Coloring",
"hostile": "Player | Hostile | Auto Coloring",
"party": "Player | Party | Auto Coloring"
}
},
"scope": {
"player": "Player Auto Coloring Settings",
"world": "World Auto Coloring Settings"
"player": "Player | Auto Coloring Settings",
"world": "World | Auto Coloring Settings"
}
}
},
Expand All @@ -44,129 +52,22 @@
"auto-coloring": {
"ring": {
"type": {
"hint": "Select if the module should change the dynamic token ring color automatically",
"world": {
"friendly": {
"name": "[Friendly] Token Ring Auto Color"
},
"neutral": {
"name": "[Neutral] Token Ring Auto Color"
},
"hostile": {
"name": "[Hostile] Token Ring Auto Color"
},
"party": {
"name": "[Party] Token Ring Auto Color"
}
},
"player": {
"friendly": {
"name": "[Player] [Friendly] Token Ring Auto Color"
},
"neutral": {
"name": "[Player] [Neutral] Token Ring Auto Color"
},
"hostile": {
"name": "[Player] [Hostile] Token Ring Auto Color"
},
"party": {
"name": "[Player] [Party] Token Ring Auto Color"
}
}
"name": "Token Ring Auto Color",
"hint": "Select if the module should change the dynamic token ring color automatically"
},
"custom-color": {
"hint": "If auto color option is set to custom will use this color",
"world": {
"friendly": {
"name": "[Friendly] Token Ring Custom Color"
},
"neutral": {
"name": "[Neutral] Token Ring Custom Color"
},
"hostile": {
"name": "[Hostile] Token Ring Custom Color"
},
"party": {
"name": "[Party] Token Ring Custom Color"
}
},
"player": {
"friendly": {
"name": "[Player] [Friendly] Token Ring Custom Color"
},
"neutral": {
"name": "[Player] [Neutral] Token Ring Custom Color"
},
"hostile": {
"name": "[Player] [Hostile] Token Ring Custom Color"
},
"party": {
"name": "[Player] [Party] Token Ring Custom Color"
}
}
"name": "Token Ring Custom Color",
"hint": "If auto color option is set to custom will use this color"
}
},
"background": {
"type": {
"hint": "Select if the module should change the dynamic token ring color",
"world": {
"friendly": {
"name": "[Friendly] Token Background Auto Color"
},
"neutral": {
"name": "[Neutral] Token Background Auto Color"
},
"hostile": {
"name": "[Hostile] Token Background Auto Color"
},
"party": {
"name": "[Party] Token Background Auto Color"
}
},
"player": {
"friendly": {
"name": "[Player] [Friendly] Token Background Auto Color"
},
"neutral": {
"name": "[Player] [Neutral] Token Background Auto Color"
},
"hostile": {
"name": "[Player] [Hostile] Token Background Auto Color"
},
"party": {
"name": "[Player] [Party] Token Background Auto Color"
}
}
"name": "Token Background Auto Color",
"hint": "Select if the module should change the dynamic token ring color"
},
"custom-color": {
"world": {
"friendly": {
"name": "[Friendly] Token Background Custom Color"
},
"neutral": {
"name": "[Neutral] Token Background Custom Color"
},
"hostile": {
"name": "[Hostile] Token Background Custom Color"
},
"party": {
"name": "[Party] Token Background Custom Color"
}
},
"player": {
"friendly": {
"name": "[Player] [Friendly] Token Background Custom Color"
},
"neutral": {
"name": "[Player] [Neutral] Token Background Custom Color"
},
"hostile": {
"name": "[Player] [Hostile] Token Background Custom Color"
},
"party": {
"name": "[Player] [Party] Token Background Custom Color"
}
}
"name": "Token Background Custom Color",
"hint": "If auto color option is set to custom will use this color"
}
},
"choices": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function registerSettings() {
const ty =
setting === "type" ? String : new foundry.data.fields.ColorField();
const config = {
name: localize(`${path}.${level}.${type}.name`),
name: localize(`${path}.name`),
hint: localize(`${path}.hint`),
scope: level,
config: true,
Expand Down Expand Up @@ -197,7 +197,7 @@ export function renderSettingsConfig(_, html) {
["hostile", "neutral", "friendly", "party"].forEach((type) => {
["player", "world"].forEach((scope) => {
addSettingsGroup(
`auto-coloring.type.${type}`,
`auto-coloring.type.${scope}.${type}`,
`auto-coloring.ring.type.${type}.${scope}`,
"h4"
);
Expand Down

0 comments on commit 55e2939

Please sign in to comment.