From 2fbae8a6ea1ed8aca368e7ffc612f127c46ff30f Mon Sep 17 00:00:00 2001 From: BeautiDemise Date: Fri, 27 Sep 2024 03:54:05 +0200 Subject: [PATCH] Feature: Auto Update now displays a small indicator in the corner of the update button showing the current state of the function - Green: Has found the initiative item. Active - Yellow: Searching for the initiative item - Red: Has not found the initiative item and is in standby. Requires toggling the setting or rerolling initiative --- ProjectMoonTRPG/ProjectMoonTRPG.html | 10 ++++++++-- ProjectMoonTRPG/ProjectMoonTRPGStyle.css | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ProjectMoonTRPG/ProjectMoonTRPG.html b/ProjectMoonTRPG/ProjectMoonTRPG.html index 4adef35b8d..9a85d0d33f 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPG.html +++ b/ProjectMoonTRPG/ProjectMoonTRPG.html @@ -1780,6 +1780,12 @@ Update
+ + + + +
+ @@ -10922,7 +10928,7 @@ on('sheet:opened change:settingLoopEnabled change:configLoopDelay change:configT trackerItemName = values.configTrackerItemName; restartLoop(); } else { - setAttrs({prevRoundInit: 0}); + setAttrs({"prevRoundInit": 0, "prevRoundInitAttempts":0}); } }); }); @@ -10950,7 +10956,7 @@ function stepLoop() { if (newRoundInit == "") { setAttrs({prevRoundInitAttempts: parseInt(values.prevRoundInitAttempts) + 1}); } else { - setAttrs({prevRoundInit: newRoundInit}); + setAttrs({prevRoundInit: newRoundInit, prevRoundInitAttempts: 0}); } /* Sync: Target Ailment/Bar lists */ diff --git a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css index 2f3eeb791a..f6012aa0cc 100644 --- a/ProjectMoonTRPG/ProjectMoonTRPGStyle.css +++ b/ProjectMoonTRPG/ProjectMoonTRPGStyle.css @@ -1711,6 +1711,29 @@ margin-bottom: 2px !important;} } +/* Auto Update Indicator */ +.autoUpdateIndicator { + position: absolute; + top: 6px; + right: 6px; + opacity: 80%; + border-radius: 4px; +} +.loopEnabledToggle:not(:checked) ~ .autoUpdateIndicator { + display: none; +} +.loopEnabledToggle:checked ~ .autoUpdateIndicator { + border: 4px solid #dbb748; +} +.loopEnabledToggle:checked + .loopSearchingToggle:checked ~ .autoUpdateIndicator { + border: 4px solid #93c47d; +} +.loopEnabledToggle:checked ~ .loopStandbyToggle:checked + .autoUpdateIndicator { + border: 4px solid #cc4125; +} + + + /* Character stats */ .statBlock { margin: 3px;