From 4e9cec1d44985e26c85397e9202945228fc991a8 Mon Sep 17 00:00:00 2001 From: BrotherSharper Date: Sat, 15 Jan 2022 13:55:59 +0900 Subject: [PATCH] add handling for items and journals --- languages/en.json | 16 ++++++++-- languages/ja.json | 16 ++++++++-- module.json | 2 +- scripts/module.js | 74 +++++++++++++++++++++++++++++++++-------------- 4 files changed, 81 insertions(+), 27 deletions(-) diff --git a/languages/en.json b/languages/en.json index 7276816..bebfc95 100644 --- a/languages/en.json +++ b/languages/en.json @@ -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." + } + } } \ No newline at end of file diff --git a/languages/ja.json b/languages/ja.json index 3219d92..cd4b61a 100644 --- a/languages/ja.json +++ b/languages/ja.json @@ -1,4 +1,16 @@ { - "rmHeaderText.name": "ヘッダーボタンのテキスト非表示", - "rmHeaderText.hint": "キャラクターシートの上に表示される既存・Modのボタンテキストを非表示にし、アイコンのみを残します。Modを多く使っているときに便利ですが、どのアイコンが何をするのかを覚える必要があることから上級者設定です。" + "rmHeaderText":{ + "actor":{ + "name":"キャラシのヘッダーボタンのテキスト非表示", + "hint":"キャラクターシートの上に表示される既存・Modのボタンテキストを非表示にし、アイコンのみを残します。Modを多く使っているときに便利ですが、どのアイコンが何をするのかを覚える必要があることから上級者設定です。" + }, + "item":{ + "name":"アイテムのヘッダーボタンのテキスト非表示", + "hint":"アイテムシートの上に表示される既存・Modのボタンテキストを非表示にし、アイコンのみを残します。" + }, + "journal":{ + "name":"資料のヘッダーボタンのテキスト非表示", + "hint":"キャラクターシートの上に表示される既存・Modのボタンテキストを非表示にし、アイコンのみを残します。" + } + } } \ No newline at end of file diff --git a/module.json b/module.json index dc385e1..93c2c10 100644 --- a/module.json +++ b/module.json @@ -1,6 +1,6 @@ { "name": "rm-header-text", - "title": "Remove Header text", + "title": "Remove Header text(ヘッダーテキスト非表示)", "description": "", "version": "This is auto replaced", "library": "false", diff --git a/scripts/module.js b/scripts/module.js index 2313d9f..4f4504f 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -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 // デフォでは使わない - }); - }); \ No newline at end of file + + 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 // デフォで使う + }); +}); \ No newline at end of file