Add style for skill types checkboxes

This commit is contained in:
Vlyan
2021-01-04 16:44:04 +01:00
parent 0bcfb699c0
commit f61a95e6fc
5 changed files with 18 additions and 142 deletions

View File

@@ -1,139 +0,0 @@
Hooks.on("init", () => {
// Register module settings.
game.settings.register("l5r5e", "icBgColor", {
name: game.i18n.localize("ic.bg.color"),
hint: game.i18n.localize("hexa.color"),
default: "rgba(255,255,255,0.5)",
type: String,
scope: "client",
config: true,
});
game.settings.register("l5r5e", "icTextColor", {
name: game.i18n.localize("ic.text.color"),
hint: game.i18n.localize("hexa.color"),
default: "rgba(0,0,0,0.75)",
type: String,
scope: "client",
config: true,
});
game.settings.register("l5r5e", "emoteBgColor", {
name: game.i18n.localize("emote.bg.color"),
hint: game.i18n.localize("hexa.color"),
default: "rgba(255,255,255,0.5)",
type: String,
scope: "client",
config: true,
});
game.settings.register("l5r5e", "emoteTextColor", {
name: game.i18n.localize("emote.text.color"),
hint: game.i18n.localize("hexa.color"),
default: "rgba(0,0,0,0.75)",
type: String,
scope: "client",
config: true,
});
game.settings.register("l5r5e", "rollBgColor", {
name: game.i18n.localize("roll.bg.color"),
hint: game.i18n.localize("hexa.color"),
default: "rgba(195,165,130,0.5)",
type: String,
scope: "client",
config: true,
});
game.settings.register("l5r5e", "rollTextColor", {
name: game.i18n.localize("roll.text.color"),
hint: game.i18n.localize("hexa.color"),
default: "rgba(0,0,0,0.75)",
type: String,
scope: "client",
config: true,
});
game.settings.register("l5r5e", "otherBgColor", {
name: game.i18n.localize("other.bg.color"),
hint: game.i18n.localize("hexa.color"),
default: "rgba(255,255,255,0.5)",
type: String,
scope: "client",
config: true,
});
game.settings.register("l5r5e", "otherTextColor", {
name: game.i18n.localize("other.text.color"),
hint: game.i18n.localize("hexa.color"),
default: "rgba(0,0,0,0.75)",
type: String,
scope: "client",
config: true,
});
game.settings.register("l5r5e", "defaultChatPrefix", {
name: game.i18n.localize("def.chat.pref"),
hint: game.i18n.localize("spe.chat.pref"),
default: "",
type: String,
scope: "client",
config: true,
});
});
Hooks.on("renderChatLog", (log, html) => {
// Prepend inline CSS to the chatlog to style the chat messages.
const icBgColor = game.settings.get("l5r5e", "icBgColor");
const icTextColor = game.settings.get("l5r5e", "icTextColor");
const emoteBgColor = game.settings.get("l5r5e", "emoteBgColor");
const emoteTextColor = game.settings.get("l5r5e", "emoteTextColor");
const rollBgColor = game.settings.get("l5r5e", "rollBgColor");
const rollTextColor = game.settings.get("l5r5e", "rollTextColor");
const otherBgColor = game.settings.get("l5r5e", "otherBgColor");
const otherTextColor = game.settings.get("l5r5e", "otherTextColor");
$(
"<style type='text/css'> #chat-log .message.ic { background-color: " +
icBgColor +
"; color: " +
icTextColor +
" }\n #chat-log .message.ic .message-header { color: " +
icTextColor +
" }\n #chat-log .message.emote { background-color: " +
emoteBgColor +
"; color: " +
emoteTextColor +
" }\n #chat-log .message.emote .message-header { color: " +
emoteTextColor +
" }\n #chat-log .message.chatColorsRoll { background-color: " +
rollBgColor +
"; color: " +
rollTextColor +
" }\n #chat-log .message.chatColorsRoll .message-header { color: " +
rollTextColor +
" }\n #chat-log .message { background-color: " +
otherBgColor +
"; color: " +
otherTextColor +
" }\n #chat-log .message .message-header { color: " +
otherTextColor +
"; } </style>"
).prependTo(html);
});
Hooks.on("chatMessage", (chatLog, message, chatData) => {
if (game.settings.get("l5r5e", "defaultChatPrefix")) {
const prefix = game.settings.get("l5r5e", "defaultChatPrefix");
// Check if the message begins with any command.
let [command, match] = chatLog.constructor.parse(message);
if (command === "none") {
// If there is no command, insert the prefix and reprocess.
chatLog.processMessage(prefix + " " + message);
return false;
}
// Otherwise do nothing.
return true;
}
});
Hooks.on("renderChatMessage", (message, html, data) => {
// Add extra CSS classes to rolls so we can style them.
if (message.isRoll) {
html.addClass("chatColorsRoll");
}
});

File diff suppressed because one or more lines are too long

View File

@@ -29,4 +29,19 @@
border-radius: 1rem;
text-align: center;
}
.checklist label {
font-size: 0.85rem;
flex: 0 0 auto;
margin: 0 0.25rem 0.25rem;
padding: 0 0.5rem;
color: #5a6e5a;
background: rgba(255, 255, 255, 0.5);
border: 1px solid #5a6e5a;
border-radius: 1rem;
}
.checklist input {
margin: 0.25rem 0 0 0;
height: 0.65rem;
width: 0.65rem;
}
}

View File

@@ -7,7 +7,7 @@
"compatibleCoreVersion": "0.7.9",
"author": "Team L5R",
"background": "L5R-Header.webp",
"scripts": ["./scripts/ui/chatColor-l5r5e.js"],
"scripts": [],
"esmodules": ["./scripts/main-l5r5e.js"],
"styles": ["./styles/l5r5e.css"],
"packs": [

View File

@@ -264,7 +264,7 @@
</td>
</tr>
<tr>
<td colspan="2">
<td colspan="2" class="checklist">
{{localize 'l5r5e.twenty_questions.part2.access'}}
<br>
{{#each techniquesList as |technique|}}