From f694f7888e698b481fc7aae3d89ffff288e71bfa Mon Sep 17 00:00:00 2001 From: U~man Date: Mon, 6 Jul 2020 21:28:39 +0200 Subject: [PATCH] ENH: Feedback - Collapsible inventory categories - Roll details on dialog - Abbreviations - Reload AAC --- src/lang/en.json | 16 +++++++++++++--- src/module/actor/character-sheet.js | 10 ++++++++++ src/module/actor/entity.js | 8 ++++++-- src/module/settings.js | 4 ++-- src/scss/actor-base.scss | 1 + src/scss/apps.scss | 7 +++++++ .../actors/partials/character-abilities-tab.html | 8 ++++---- .../partials/character-attributes-tab.html | 2 +- .../actors/partials/monster-header.html | 2 +- src/templates/chat/roll-dialog.html | 7 ++++++- 10 files changed, 51 insertions(+), 14 deletions(-) diff --git a/src/lang/en.json b/src/lang/en.json index 34d4e10..54d9a3a 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -21,11 +21,13 @@ "OSE.Level": "Level", "OSE.Experience": "Experience", "OSE.ExperienceBonus": "Bonus Experience", + "OSE.ExperienceAward": "XP Award", "OSE.Treasure": "Treasure type", "OSE.TreasureTable": "Table", "OSE.TreasureTableHint": "Drop a rollable table here to roll the monster treasure", "OSE.Size": "Size", "OSE.Morale": "Morale", + "OSE.MoraleCheckDetails": "Roll 2d6 <= Morale for success", "OSE.Retainer": "Retainer", "OSE.Appearing": "NA", "OSE.Attack": "Attack", @@ -34,7 +36,8 @@ "OSE.Loyalty": "Loyalty Rating", "OSE.LoyaltyShort": "LR", - "OSE.AbilityCheck": "Ability Check", + "OSE.AttributeCheck": "Attribute Check", + "OSE.AttributeCheckDetails": "Roll 1d20 <= {score} for success", "OSE.scores.str.long": "Strength", "OSE.scores.str.short": "STR", "OSE.scores.wis.long": "Wisdom", @@ -49,6 +52,7 @@ "OSE.scores.cha.short": "CHA", "OSE.SavingThrow": "Save", + "OSE.SavingThrowDetails": "Roll 1d20 >= {save} for success", "OSE.saves.death.short": "D", "OSE.saves.death.long": "Death, Poison", "OSE.saves.wand.short": "W", @@ -68,9 +72,10 @@ "OSE.HitDiceShort": "HD", "OSE.Movement": "Movement Rate", "OSE.MovementEncounter": "Encounter Movement Rate", - "OSE.MovementEncounterShort": "ENC", + "OSE.MovementEncounterShort": "En", "OSE.MovementOverland": "Overland Movement Rate", - "OSE.MovementOverlandShort": "OVE", + "OSE.MovementOverlandShort": "Ov", + "OSE.MovementExplorationShort": "Ex", "OSE.MovementShort": "MV", "OSE.ArmorClassNaked": "Naked Armor Class", "OSE.ArmorClass": "Armor Class", @@ -158,14 +163,19 @@ "OSE.abilities.Requirements": "Requirements", "OSE.ExplorationCheck": "Check", + "OSE.ExplorationCheckDetails": "Roll 1d6 <= {expl} for success", "OSE.exploration.ld.long": "Listen at Door", "OSE.exploration.ld.short": "Listen Door", + "OSE.exploration.ld.abrev": "LD", "OSE.exploration.od.long": "Open Stuck Door", "OSE.exploration.od.short": "Open Door", + "OSE.exploration.od.abrev": "OD", "OSE.exploration.sd.long": "Find Secret Door", "OSE.exploration.sd.short": "Secret Door", + "OSE.exploration.sd.abrev": "SD", "OSE.exploration.ft.long": "Find Room Trap", "OSE.exploration.ft.short": "Find Trap", + "OSE.exploration.ft.abrev": "FT", "OSE.messages.GetExperience": "{name} gained {value} experience points!", "OSE.messages.AttackSuccess": "Hits AC {result}! ({bonus})", diff --git a/src/module/actor/character-sheet.js b/src/module/actor/character-sheet.js index d755b6f..53eb99f 100644 --- a/src/module/actor/character-sheet.js +++ b/src/module/actor/character-sheet.js @@ -157,10 +157,20 @@ export class OseActorSheetCharacter extends OseActorSheet { let box = $(event.currentTarget.parentElement.parentElement.parentElement); box.children('.attribute-bonuses').slideDown(200); }) + html.find(".ability-score .attribute-bonuses a").click(ev => { $(event.currentTarget.parentElement.parentElement).slideUp(200); }) + html.find(".inventory .item-titles").click(ev => { + let items = $(event.currentTarget.parentElement).children('.item-list'); + if (items.css('display') == "none") { + items.slideDown(200); + } else { + items.slideUp(200); + } + }) + // Handle default listeners last so system listeners are triggered first super.activateListeners(html); } diff --git a/src/module/actor/entity.js b/src/module/actor/entity.js index cbe9c96..83258d9 100644 --- a/src/module/actor/entity.js +++ b/src/module/actor/entity.js @@ -72,6 +72,7 @@ export class OseActor extends Actor { rollData: { type: "Above", target: this.data.data.saves[save].value, + details: game.i18n.format("OSE.SavingThrowDetails", {save: label}), }, }, }; @@ -100,6 +101,7 @@ export class OseActor extends Actor { rollData: { type: "Below", target: this.data.data.details.morale, + details: game.i18n.format("OSE.MoraleCheckDetails"), }, }, }; @@ -126,6 +128,7 @@ export class OseActor extends Actor { rollData: { type: "Check", target: this.data.data.scores[score].value, + details: game.i18n.format("OSE.AttributeCheckDetails", {score: label}), }, }, }; @@ -139,8 +142,8 @@ export class OseActor extends Actor { data: data, skipDialog: skip, speaker: ChatMessage.getSpeaker({ actor: this }), - flavor: `${label} ${game.i18n.localize("OSE.AbilityCheck")}`, - title: `${label} ${game.i18n.localize("OSE.AbilityCheck")}`, + flavor: `${label} ${game.i18n.localize("OSE.AttributeCheck")}`, + title: `${label} ${game.i18n.localize("OSE.AttributeCheck")}`, }); } @@ -179,6 +182,7 @@ export class OseActor extends Actor { rollData: { type: "Below", target: this.data.data.exploration[expl], + details: game.i18n.format("OSE.ExplorationCheckDetails", {expl: label}), }, }, }; diff --git a/src/module/settings.js b/src/module/settings.js index c58d51b..da4094c 100644 --- a/src/module/settings.js +++ b/src/module/settings.js @@ -15,6 +15,7 @@ export const registerSettings = function () { scope: "world", type: Boolean, config: true, + onChange: _ => window.location.reload() }); game.settings.register("ose", "morale", { @@ -38,11 +39,10 @@ export const registerSettings = function () { game.settings.register("ose", "encumbranceOption", { name: game.i18n.localize("OSE.Setting.Encumbrance"), hint: game.i18n.localize("OSE.Setting.EncumbranceHint"), - default: false, + default: "detailed", scope: "world", type: String, config: true, - default: "detailed", choices: { basic: "OSE.Setting.EncumbranceBasic", detailed: "OSE.Setting.EncumbranceDetailed", diff --git a/src/scss/actor-base.scss b/src/scss/actor-base.scss index 3eaa83d..d597b83 100644 --- a/src/scss/actor-base.scss +++ b/src/scss/actor-base.scss @@ -192,6 +192,7 @@ line-height: 30px; } .item-titles { + cursor: pointer; text-align: center; padding: 4px 0; border: 1px solid $colorDark; diff --git a/src/scss/apps.scss b/src/scss/apps.scss index 80cadc6..8c15a8c 100644 --- a/src/scss/apps.scss +++ b/src/scss/apps.scss @@ -1,3 +1,10 @@ +.ose.roll-dialog { + .roll-details { + font-weight: bold; + text-align: center; + } +} + .ose.chat-block { margin: 0; .chat-title { diff --git a/src/templates/actors/partials/character-abilities-tab.html b/src/templates/actors/partials/character-abilities-tab.html index f859995..c321c9a 100644 --- a/src/templates/actors/partials/character-abilities-tab.html +++ b/src/templates/actors/partials/character-abilities-tab.html @@ -1,26 +1,26 @@