Skip to content

Commit

Permalink
add handling for items and journals
Browse files Browse the repository at this point in the history
  • Loading branch information
BrotherSharper committed Jan 15, 2022
1 parent 17badd4 commit 4e9cec1
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 27 deletions.
16 changes: 14 additions & 2 deletions languages/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"rmHeaderText.name": "Hide header icon text",
"rmHeaderText.hint": "Hides the header icon text shown on actor sheets for those with so many modules that it gets cluttered to hell. Be careful as you need to remember what each icon does."
"rmHeaderText":{
"actor":{
"name":"Hide actor header icon text",
"hint":"Hides the header icon text shown on actor sheets for those with so many modules that it gets cluttered to hell. Be careful as you need to remember what each icon does."
},
"item":{
"name":"Hide item header icon text",
"hint":"Hides the header icon text shown on item sheets. Be careful as you need to remember what each icon does."
},
"journal":{
"name":"Hide journal header icon text",
"hint":"Hides the header icon text shown on journal sheets. Be careful as you need to remember what each icon does."
}
}
}
16 changes: 14 additions & 2 deletions languages/ja.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"rmHeaderText.name": "ヘッダーボタンのテキスト非表示",
"rmHeaderText.hint": "キャラクターシートの上に表示される既存・Modのボタンテキストを非表示にし、アイコンのみを残します。Modを多く使っているときに便利ですが、どのアイコンが何をするのかを覚える必要があることから上級者設定です。"
"rmHeaderText":{
"actor":{
"name":"キャラシのヘッダーボタンのテキスト非表示",
"hint":"キャラクターシートの上に表示される既存・Modのボタンテキストを非表示にし、アイコンのみを残します。Modを多く使っているときに便利ですが、どのアイコンが何をするのかを覚える必要があることから上級者設定です。"
},
"item":{
"name":"アイテムのヘッダーボタンのテキスト非表示",
"hint":"アイテムシートの上に表示される既存・Modのボタンテキストを非表示にし、アイコンのみを残します。"
},
"journal":{
"name":"資料のヘッダーボタンのテキスト非表示",
"hint":"キャラクターシートの上に表示される既存・Modのボタンテキストを非表示にし、アイコンのみを残します。"
}
}
}
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rm-header-text",
"title": "Remove Header text",
"title": "Remove Header text(ヘッダーテキスト非表示)",
"description": "",
"version": "This is auto replaced",
"library": "false",
Expand Down
74 changes: 52 additions & 22 deletions scripts/module.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,54 @@
Hooks.on("renderActorSheet", (app, html, data) => {
if (game.settings.get("rm-header-text", "rmHeaderIconStyle") === true ) {
html[0].classList.add("rmh");
}
if (game.settings.get("rm-header-text", "rmHeaderIconActorStyle") === true ) {
html[0].classList.add("rmh");
}
});

Hooks.on("renderItemSheet", (app, html, data) => {
if (game.settings.get("rm-header-text", "rmHeaderIconItemStyle") === true ) {
html[0].classList.add("rmh");
}
});

Hooks.on("renderJournalSheet", (app, html, data) => {
if (game.settings.get("rm-header-text", "rmHeaderIconJournalStyle") === true ) {
html[0].classList.add("rmh");
}
});

Hooks.on("init", () => {
// game.settings.register("remove-header-icons", {
// scope: "world",
// config: false,
// type: Boolean,
// default: false
// });


game.settings.register("rm-header-text", "rmHeaderIconActorStyle", {
name: game.i18n.localize("rmHeaderText.actor.name"),
hint: game.i18n.localize("rmHeaderText.actor.hint"),
scope: "local",
config: true,
type: Boolean,
default: true // デフォで使う
});
Hooks.on("init", () => {
// game.settings.register("remove-header-icons", {
// scope: "world",
// config: false,
// type: Boolean,
// default: false
// });

game.settings.register("rm-header-text", "rmHeaderIconStyle", {
name: game.i18n.localize("rmHeaderText.name"),
hint: game.i18n.localize("rmHeaderText.hint"),
scope: "local",
config: true,
type: Boolean,
default: false // デフォでは使わない
});
});

game.settings.register("rm-header-text", "rmHeaderIconItemStyle", {
name: game.i18n.localize("rmHeaderText.item.name"),
hint: game.i18n.localize("rmHeaderText.item.hint"),
scope: "local",
config: true,
type: Boolean,
default: true // デフォで使う
});

game.settings.register("rm-header-text", "rmHeaderIconJournalStyle", {
name: game.i18n.localize("rmHeaderText.journal.name"),
hint: game.i18n.localize("rmHeaderText.journal.hint"),
scope: "local",
config: true,
type: Boolean,
default: true // デフォで使う
});
});

0 comments on commit 4e9cec1

Please sign in to comment.