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
This commit is contained in:
BeautiDemise
2024-09-27 03:54:05 +02:00
parent a80bfbf011
commit 2fbae8a6ea
2 changed files with 31 additions and 2 deletions
+8 -2
View File
@@ -1780,6 +1780,12 @@
<b data-i18n="helper-text-update">Update</b>
<div class="sideDice columnAlign centerFlex">
<input type="checkbox" name="attr_settingLoopEnabled" class="loopEnabledToggle" value="true" hidden="true">
<input type="checkbox" name="attr_prevRoundInitAttempts" class="loopSearchingToggle" value="0" hidden="true">
<input type="checkbox" name="attr_prevRoundInitAttempts" class="loopStandbyToggle" value="5" hidden="true">
<div class="autoUpdateIndicator"></div>
<input type="text" name="attr_baseActNum" value="0" hidden="true">
<button type="action" class="speed next updateInput" name="act_updateAilments" data-i18n-title="helper-update-ailments" title="Update Ailments"></button>
@@ -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 */
+23
View File
@@ -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;