From a052112b27c9ae7f9052c28fa2030c8bc30f63f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=88=87ince?= Date: Tue, 26 Nov 2024 22:28:38 -0800 Subject: [PATCH 1/5] small header adjustment to help with translations --- Forbidden_Lands/Forbidden_Lands.css | 26 +++++++++++++------------- Forbidden_Lands/Forbidden_Lands.html | 6 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Forbidden_Lands/Forbidden_Lands.css b/Forbidden_Lands/Forbidden_Lands.css index 474536bf6fcc..f066a937e8c3 100644 --- a/Forbidden_Lands/Forbidden_Lands.css +++ b/Forbidden_Lands/Forbidden_Lands.css @@ -405,8 +405,9 @@ .charsheet .wrapper div.tab-contents.character div.announcements.toggle-monster-only { display: block; - height: 380px; margin-top: 1.15em; + max-height: 460px; + min-height: 180px; overflow-x: hidden; overflow-y: scroll; padding-inline: 15px; @@ -514,18 +515,17 @@ } .charsheet div.header-top { - align-items: baseline; - background-color: #000; - color: #fff; - display: grid; - font-weight: bold; - grid-column: 1/-1; - grid-template: inherit; - margin: 0 0 0 -10px; - max-height: 4em; - min-height: 2.5em; - text-align: center; - width: calc(106% + 2px); + align-items: baseline; + background-color: #000; + color: #fff; + display: grid; + font-weight: bold; + grid-column: 1/-1; + grid-template: inherit; + margin: 0 0 0 -10px; + min-height: 3.25em; + text-align: center; + width: calc(106% + 2px); } .charsheet .attributes-box1 .header-top h1, diff --git a/Forbidden_Lands/Forbidden_Lands.html b/Forbidden_Lands/Forbidden_Lands.html index ab3e57f1b582..68d44aafeea7 100644 --- a/Forbidden_Lands/Forbidden_Lands.html +++ b/Forbidden_Lands/Forbidden_Lands.html @@ -38,7 +38,7 @@ *

Latest Announcements

- 11/24/24 + 11/26/24
    v1.9
  1. Push your rolls without the API! The sheet's rolls have been updated with CRP(custom roll parsing). You can now roll your dice pool and push them directly from the chat window without having to manually adjust the pool and re-rolling. (thank you Richard for letting me mangle your MYZ CRP code for this.)
  2. @@ -646,7 +646,7 @@

    CRITICAL INJURIES

    Effects
    - Healing Time + Healing Time
    @@ -699,7 +699,7 @@

    WEAPONS

    Tot
    - Bonus + Bonus
    Max From fd15dd7b6c79f3a00864f507b86daa522c5f124a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=88=87ince?= Date: Wed, 27 Nov 2024 15:29:06 -0800 Subject: [PATCH 2/5] announcements box --- Forbidden_Lands/Forbidden_Lands.css | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Forbidden_Lands/Forbidden_Lands.css b/Forbidden_Lands/Forbidden_Lands.css index f066a937e8c3..ddf2a1e78f9e 100644 --- a/Forbidden_Lands/Forbidden_Lands.css +++ b/Forbidden_Lands/Forbidden_Lands.css @@ -100,11 +100,11 @@ /* announcements */ .charsheet input.announcements-show.toggle-monster-only { - height: 1.85em; + height: 1.5em; position: absolute; right: 0; - width: 5.25em; - top: 3.5em; + width: 3.5em; + top: 3.25em; z-index: 2; } @@ -142,7 +142,7 @@ border-radius: 5px; float: right; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - font-size: 0.85em; + font-size: 0.75em; margin: -3.25em 0 0 -5em; padding: 0 4px 0 4px; position: relative; @@ -404,15 +404,15 @@ } .charsheet .wrapper div.tab-contents.character div.announcements.toggle-monster-only { - display: block; - margin-top: 1.15em; + margin: auto; max-height: 460px; min-height: 180px; overflow-x: hidden; overflow-y: scroll; - padding-inline: 15px; + padding: 5px 10px 5px 10px; position: absolute; - right: 5%; + right: 2.75em; + top: 1.25em; width: 70%; z-index: 2; } From 9d8afd1c310929248985386281058b2e925d1810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=88=87ince?= Date: Wed, 27 Nov 2024 17:53:52 -0800 Subject: [PATCH 3/5] fixed a bug where PC Strength could get switched to 7 when moving between the PC and Monster tab. --- Forbidden_Lands/Forbidden_Lands.html | 36 +++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/Forbidden_Lands/Forbidden_Lands.html b/Forbidden_Lands/Forbidden_Lands.html index 68d44aafeea7..4be32429036e 100644 --- a/Forbidden_Lands/Forbidden_Lands.html +++ b/Forbidden_Lands/Forbidden_Lands.html @@ -4902,32 +4902,32 @@

    STRONGHOLD NOTES

    on('change:tab change:strength_pc change:strength_monster sheet:opened', (eventInfo) => { getAttrs(['tab', 'strength', 'strength_pc', 'strength_monster'], (v) => { // clog(`Change Detected: ${eventInfo.sourceAttribute}`); - const settings = {}; + const output = {}; const tab = int(v.tab, 1); // sets tab to 1 if not recognized - so goes to pc tab; - const str = int(v.strength); - let pc = int(v.strength_pc); - let monster = int(v.strength_monster); + const hiddenStrength = int(v.strength); + let strengthPC = int(v.strength_pc); + let strengthMonster = int(v.strength_monster); let forceupdate = 0; // check if character existed before strength_pc or _monster stats were introduced. - if (str > 0) { - if (pc === 0 || monster === 0) forceupdate = 1; - if (pc === 0) { - pc = str; - settings.strength_pc = str; + if (hiddenStrength > 0) { + if (strengthPC === 0 || strengthMonster === 0) forceupdate = 1; + if (strengthPC === 0) { + strengthPC = hiddenStrength; + output.strength_pc = hiddenStrength; } - if (monster === 0) { - monster = str; - settings.strength_monster = str; + if (strengthMonster === 0) { + strengthMonster = hiddenStrength; + output.strength_monster = hiddenStrength; } } // if tab is not pc or monster, end the function and leave strength unchanged if (tab !== 1 && tab !== 3 && !forceupdate) return; // if tab = 1 or 3, set strength to the appropriate value - settings.strength = tab === 3 ? monster : pc; + output.strength = tab === 3 ? strengthMonster : strengthPC; - setAttrs(settings); + setAttrs(output); }); }); @@ -6403,11 +6403,15 @@

    STRONGHOLD NOTES

    stats.forEach((stat) => { on(`change:${stat} change:tab`, function (eventInfo) { - getAttrs([stat, 'tab'], function (values) { + getAttrs([stat, 'tab', 'strength_pc', 'strength_monster'], function (values) { const total = int(values[stat]); const tab = int(values.tab); + let max = 7; // monsters(tab 3) can have a 48 max - const max = tab === 3 && stat === 'strength' ? 48 : 7; + const pc = int(values.strength_pc); + const monster = int(values.strength_monster); + max = tab !== 2 && stat === 'strength' ? Math.min(monster, 48) : Math.min(pc, 7); + const settings = checkMax(stat, total, max); if (settings) setAttrs(settings); }); From 8d85a0934e44eeb61b05a759e7550caa469fc9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=88=87ince?= Date: Wed, 27 Nov 2024 20:44:58 -0800 Subject: [PATCH 4/5] announcements --- Forbidden_Lands/Forbidden_Lands.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Forbidden_Lands/Forbidden_Lands.html b/Forbidden_Lands/Forbidden_Lands.html index 4be32429036e..1a07977d1167 100644 --- a/Forbidden_Lands/Forbidden_Lands.html +++ b/Forbidden_Lands/Forbidden_Lands.html @@ -38,9 +38,10 @@ *

    Latest Announcements

    - 11/26/24 + 11/27/24
      v1.9 +
    1. Fixed a bug where PC Strength could get switched to '7' when moving between the PC and Monster tab.
    2. Push your rolls without the API! The sheet's rolls have been updated with CRP(custom roll parsing). You can now roll your dice pool and push them directly from the chat window without having to manually adjust the pool and re-rolling. (thank you Richard for letting me mangle your MYZ CRP code for this.)
    3. Consumable rolls will now auto-decrement the resource's die size on failed rolls.
    4. The roll template now displays the dice pool results horizontally.
    5. From 2e8f36a43175a28adb423c9c908e9f88d0eb524b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=88=87ince?= Date: Thu, 28 Nov 2024 00:58:05 -0800 Subject: [PATCH 5/5] willpower changed to checkboxes --- Forbidden_Lands/Forbidden_Lands.css | 51 ++++++++++++++++++---------- Forbidden_Lands/Forbidden_Lands.html | 33 +++++++++++++++++- 2 files changed, 66 insertions(+), 18 deletions(-) diff --git a/Forbidden_Lands/Forbidden_Lands.css b/Forbidden_Lands/Forbidden_Lands.css index ddf2a1e78f9e..e0aee3fb12a7 100644 --- a/Forbidden_Lands/Forbidden_Lands.css +++ b/Forbidden_Lands/Forbidden_Lands.css @@ -941,10 +941,10 @@ box-sizing: border-box; } -/* Fake radio using xbox for Experience/Willpower */ -.charsheet input[type="radio"].xbox + span::before { +/* Fake radio using xbox for Willpower */ +.charsheet .willpower-grid .xbox + span::before { background-image: url('https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Forbidden_Lands/images/xbox_empty.png'); - content: url('https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Forbidden_Lands/images/xbox_checked.png'); + content: ""; display: inline-block; font-size: 24px; height: 15px; @@ -955,21 +955,21 @@ width: 15px; } -.charsheet input.xbox { - margin-top: 3px; - opacity: 0; - width: 16px; - z-index: 1; +.charsheet .willpower-grid input.xbox { + opacity: 0; + position: relative; + right: -4px; + width: 1.25em; + z-index: 1; } -/* Removes xbox from all radios _after_ selected one */ -.charsheet input[type="radio"]:checked ~ input[type="radio"].xbox + span::before, -.charsheet input[type="radio"].xbox:checked ~ input[type="radio"].xbox + span::before { - content: ""; +.charsheet .willpower-grid .xbox:checked + span::before, +.charsheet .willpower-grid .xbox:has(~ .xbox:checked) + span::before { + content: url('https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Forbidden_Lands/images/xbox_checked.png'); } /* Fake radio using xbox for Conditions */ -.charsheet input[type="checkbox"].xbox + span::before { +.charsheet .conditions-grid input.xbox + span::before { background-image: url('https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Forbidden_Lands/images/xbox_empty.png'); content: url('https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Forbidden_Lands/images/xbox_checked.png'); display: inline-block; @@ -982,18 +982,18 @@ width: 15px; } -.charsheet .conditions-grid > div input.xbox { - height: 20px; +.charsheet .conditions-grid input.xbox { margin: 1px 0 0 0; opacity: 0; transform-origin: left; transform: scaleX(4.5); - width: 20px; z-index: 1; + min-width: 1.5em; + min-height: 28px; } /* Removes xbox from all radios _after_ selected one */ -.charsheet input[type="checkbox"].xbox:not(:checked) + span::before { +.charsheet .conditions-grid input.xbox:not(:checked) + span::before { content: ""; } @@ -1579,6 +1579,22 @@ display: none; } +.charsheet button.reset { + height: 1em; + opacity: 0; + position: relative; + right: -18px; + width: .5em; +} + +.charsheet button.reset + span::after { + content: "1"; + font-family: pictos; + font-size: 1.35em; + left: -6px; + position: relative; +} + .charsheet input[type="radio"]:checked::after, .charsheet input[type="radio"]:not(:checked)::after { content: "1"; @@ -1588,6 +1604,7 @@ top: -5px; } +.charsheet button.reset:hover + span::after, .charsheet input[type="radio"]:hover:checked::after, .charsheet input[type="radio"]:hover:not(:checked)::after { color: #a60002; diff --git a/Forbidden_Lands/Forbidden_Lands.html b/Forbidden_Lands/Forbidden_Lands.html index 1a07977d1167..3e7dd8d2a6e0 100644 --- a/Forbidden_Lands/Forbidden_Lands.html +++ b/Forbidden_Lands/Forbidden_Lands.html @@ -3038,7 +3038,7 @@

      COINS

      WILLPOWER

      -
      + +
      + + + + + + + + + + + + +
      =
      @@ -6544,6 +6559,22 @@

      STRONGHOLD NOTES

      }); }); + /* willpower */ + on('clicked:reset change:willpower', (eventInfo) => { + getAttrs(['willpower'], (v) => { + const zero = eventInfo.triggerName.replace('clicked:', ''); + const output = {}; + const newValue = +v.willpower; + const previousValue = eventInfo.previousValue; + if (eventInfo.triggerName === 'clicked:reset') { + output.willpower = 0; + } else if (newValue === 0) { + output.willpower = previousValue - 1; + } + setAttrs(output, {silent: true}); + }); + }); + /* delete empty repeating rows w/out having to close/reopen sheet */ on( 'remove:repeating_injuries remove:repeating_talents remove:repeating_gear remove:repeating_mount_gear remove:repeating_cart_gear remove:repeating_relationships remove:repeating_spells remove:repeating_beasts remove:repeating_notes remove:repeating_functions remove:repeating_stronghold-stockpile remove:repeating_stronghold-notes remove:repeating_hirelings remove:repeating_monster',