Würfelerfolge einfärben & settings für die farben
Foundry VTT System Release / build-and-release (push) Successful in 2m10s
Foundry VTT System Release / build-and-release (push) Successful in 2m10s
This commit was merged in pull request #11.
This commit is contained in:
1 parent
914fe01a2c
commit
e27c2a220f
3 files changed
+113
-4
No files matched your search
@@ -9,7 +9,6 @@ export const loadSettings = async function () {
|
||||
requiresReload: true
|
||||
});
|
||||
|
||||
// Automatically collapse chat message descriptions
|
||||
game.settings.register("midgard6-lvd", "beschreibungChatActive", {
|
||||
name: game.i18n.localize("Midgard6.Settings.beschreibungChatActive.name"),
|
||||
hint: game.i18n.localize("Midgard6.Settings.beschreibungChatActive.hint"),
|
||||
@@ -18,4 +17,71 @@ export const loadSettings = async function () {
|
||||
default: false,
|
||||
type: Boolean
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "beschreibungChatActive", {
|
||||
name: game.i18n.localize("Midgard6.Settings.beschreibungChatActive.name"),
|
||||
hint: game.i18n.localize("Midgard6.Settings.beschreibungChatActive.hint"),
|
||||
scope: "client",
|
||||
config: true,
|
||||
default: false,
|
||||
type: Boolean
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "colorSuccessBg", {
|
||||
name: "Erfolg: Hintergrundfarbe",
|
||||
hint: "Farbe für kritische Erfolge.",
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: String,
|
||||
default: "#5db68b",
|
||||
onChange: () => updateAllCssVariables()
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "colorFailBg", {
|
||||
name: "Fehlschlag: Hintergrundfarbe",
|
||||
hint: "Farbe für kritische Fehlschläge.",
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: String,
|
||||
default: "#e3e4e5",
|
||||
onChange: () => updateAllCssVariables()
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "colorCritSuccessBg", {
|
||||
name: "Kritischer Erffolg: Hintergrundfarbe",
|
||||
hint: "Farbe für überdurchschnittliche Würfe.",
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: String,
|
||||
default: "#9de0f0",
|
||||
onChange: () => updateAllCssVariables()
|
||||
});
|
||||
|
||||
game.settings.register("midgard6-lvd", "colorCritFailureBg", {
|
||||
name: "Kritischer Erffolg: Hintergrundfarbe",
|
||||
hint: "Farbe für überdurchschnittliche Würfe.",
|
||||
scope: "client",
|
||||
config: true,
|
||||
type: String,
|
||||
default: "#ea7699",
|
||||
onChange: () => updateAllCssVariables()
|
||||
});
|
||||
};
|
||||
|
||||
function updateAllCssVariables() {
|
||||
const root = document.documentElement;
|
||||
|
||||
const successColor = game.settings.get("midgard6-lvd", "colorSuccessBg");
|
||||
const failColor = game.settings.get("midgard6-lvd", "colorFailBg");
|
||||
const critSuccessColor = game.settings.get("midgard6-lvd", "colorCritSuccessBg");
|
||||
const critFailColor = game.settings.get("midgard6-lvd", "colorCritFailureBg");
|
||||
|
||||
root.style.setProperty("--M6-success-color", successColor);
|
||||
root.style.setProperty("--M6-failure-color", failColor);
|
||||
root.style.setProperty("--M6-crit-success-color", critSuccessColor);
|
||||
root.style.setProperty("--M6-crit-failure-color", critFailColor);
|
||||
}
|
||||
|
||||
Hooks.once("ready", () => {
|
||||
updateAllCssVariables();
|
||||
});
|
||||
Reference in new issue
Block a user