From 1dbb932c9ae7ff2b1d1271a960c19da99dacc246 Mon Sep 17 00:00:00 2001 From: Ken Date: Wed, 14 Dec 2022 01:16:48 -0800 Subject: [PATCH] update GURPS improving roll modifier tools and dialog popup box --- GURPS/gurps.css | 8 ++- GURPS/gurps.html | 109 ++++++++++++++++++++++++++++++----------- GURPS/translation.json | 3 ++ 3 files changed, 90 insertions(+), 30 deletions(-) diff --git a/GURPS/gurps.css b/GURPS/gurps.css index c44f3e7e99..1ab8c0c71b 100644 --- a/GURPS/gurps.css +++ b/GURPS/gurps.css @@ -660,6 +660,12 @@ input.sheet-range-damage-dice-icon[value="d4skull"] ~ button[type=roll].roll_dam align-items: center; margin-top: 2px; } + +.sheet-row.sheet-roll-modifiers { + height: 48px; + align-items: flex-start; +} + .sheet-row-textarea { height: 100% ; } @@ -4360,7 +4366,7 @@ input[type="hidden"][name="attr_show_roll_modifiers"][value="1"] ~ .sheet-modal left: 50%; top: -100%; z-index: 21; - width: 700px; + width: 745px; box-shadow:0 5px 10px rgba(0,0,0,0.3); transform: translate(0, -500%); transition: transform 0.3s ease-out; diff --git a/GURPS/gurps.html b/GURPS/gurps.html index f385c5bfd3..18feb325ce 100644 --- a/GURPS/gurps.html +++ b/GURPS/gurps.html @@ -8140,6 +8140,28 @@ PU2:126 = Power-Ups 2. Page 126
+
+ +
+
+
+
Notes
+
+
+ Traits: +
+ +
+
+
+ Summary: +
+ +
+
+
+
+
+
+ +
+
+ Reason for Mod: +
+
+ +
+
+ +
+ The final modifier that will be applied to the effective skill level. +
+
- +
-
- -
@@ -8190,25 +8226,6 @@ PU2:126 = Power-Ups 2. Page 126
-
-
-
Notes
-
-
- Traits: -
- -
-
-
- Summary: -
- -
-
-
-
-
@@ -16859,15 +16876,27 @@ Diffuse: Max 2HP (Exception: Area-effect, cone, and explosion attacks cause norm {{#rollTraitSummary}} - Traits: - {{rollTraitSummary}} + +
+ Traits: +
+
+ {{rollTraitSummary}} +
+ {{/rollTraitSummary}} {{#rollModifierSummary}} - Summary: - {{rollModifierSummary}} + +
+ Modifier Summary: +
+
+ {{rollModifierSummary}} +
+ {{/rollModifierSummary}} @@ -27000,9 +27029,27 @@ Diffuse: Max 2HP (Exception: Area-effect, cone, and explosion attacks cause norm totalMod += modifier; // check for special description - if (key === "dialog_custom_roll_modifier" && values.dialog_custom_roll_modifier_reason) { + if (key === "dialog_custom_roll_modifier") { - description = values.dialog_custom_roll_modifier_reason; + // split the reason modifiers into seperate lines + let modReasons = null; + + if (values.dialog_custom_roll_modifier_reason) { + modReasons = values.dialog_custom_roll_modifier_reason.split(/\r?\n/); + } + + let displayReasons = ""; + + if (modReasons && modReasons.length > 0) { + + // add two spaces before each reason and combine into single string list + displayReasons = modReasons.map(reason => { + return ` • ${reason}\n`; + }); + + } + + description = `Custom Modifier\n${displayReasons}`; } else if (key === "hit_location_modifier" && values.hit_location) { @@ -27948,6 +27995,8 @@ Diffuse: Max 2HP (Exception: Area-effect, cone, and explosion attacks cause norm on(`change:use_${section}_modifier_tool`, event => { let updateFields = { + [`${section}_custom_roll_modifier`]: 0, + [`${section}_custom_roll_modifier_summary`]: "", [`${section}_roll_modifier`]: 0, [`${section}_roll_modifier_summary`]: "", [`${section}_roll_trait_summary`]: "", @@ -29097,6 +29146,8 @@ Diffuse: Max 2HP (Exception: Area-effect, cone, and explosion attacks cause norm let updates = {}; + updates[`${section}_custom_roll_modifier`] = 0; + updates[`${section}_custom_roll_modifier_summary`] = ""; updates[`${section}_roll_modifier`] = 0; updates[`${section}_roll_modifier_summary`] = ""; updates[`${section}_roll_trait_summary`] = ""; diff --git a/GURPS/translation.json b/GURPS/translation.json index e41bb175f2..866198d6f4 100644 --- a/GURPS/translation.json +++ b/GURPS/translation.json @@ -718,6 +718,8 @@ "skill-modifier-tooltip": "Modifier applied to skill level.
Can be a positive or a negative number.
Examples include a bonus from a Talent,
default from another Skill or Technique,
a piece of equipment, or a Perk.", "modifier-label": "Modifier:", "modifier-dialog-tooltip": "Enter a modifier to apply to any rolls on the this table.
Use the pencil/paper icon to select modifiers.
NOTE: Changing the modifier or check status of Max skill of 9 will clear modifiers used by dialog box.", + "final-modifier-label": "Final Modifier", + "final-modifier-dialog-tooltip": "The final modifier that will be applied to the effective skill level.", "select-skill-modifiers-button": "Select Skill Modifiers", "apply-encumbrance-tooltip": "Apply encumbrance penalty.", "link-to-label": "Link To", @@ -810,6 +812,7 @@ "layer-4-label": "Layer 4", "armor-layor4-tooltip": "Layer 4 (Outer most) is also good for force shields, magic DR, etc.", "summary-label": "Summary", + "roll-modifier-summary-label": "Modifier Summary", "armor-summary-tooltip": "This sums up each layer, from layer 1 (inner) to layer 4 (outer).
* = flexible armor.
Alert: Only one layer per row may have split armor.", "abbreviation-defense-bonus-label": "DB", "defense-bonus-tooltip": "Apply the defense bonus of a shield, cloak, spell (B252), or Meta-trait (Supers34). See B374
Shield/Cloak: Used against attacks from front or from your shield side. Can't be used against firearms unless you're using the Damage to Shields option.
Shield Spell: Protects from frontal attacks and is cumulative with a normal shield.",