From d015d0177ceecdcbe1fcf2c164246b9948348dac Mon Sep 17 00:00:00 2001 From: Harley White Date: Mon, 7 Jun 2021 19:25:19 -0400 Subject: [PATCH] Added "instant" feature to bars --- changelog.md | 1 + docs/bars.md | 3 +++ js/technical/displays.js | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/changelog.md b/changelog.md index 2122d2d..4e6f6d4 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,7 @@ - Releasing a held buyable/clickable with onHold doesn't click it again. - Fixed hard resetting while NaN'ed and exporting NaN saves for debugging. - Attempt to fix buttons sometimes not updating. +- Added "instant" feature for bars. (not useful for most people) - Improvements to theme code, partially by Cubedey. ## v2.6.0.1 - 6/4/21 diff --git a/docs/bars.md b/docs/bars.md index ca00c62..6e85937 100644 --- a/docs/bars.md +++ b/docs/bars.md @@ -35,3 +35,6 @@ Features: - layer: **assigned automagically**. It's the same value as the name of this layer, so you can do `player[this.layer].points` or similar. - id: **assigned automagically**. It's the "key" which the bar was stored under, for convenient access. The bar in the example's id is "bigBar". + + +- instant: **very optional**. If this is true, the bar will instantly snap to the current value instead of animating in between. Good for things involving precise timing. \ No newline at end of file diff --git a/js/technical/displays.js b/js/technical/displays.js index e982494..3566eff 100644 --- a/js/technical/displays.js +++ b/js/technical/displays.js @@ -116,6 +116,10 @@ function constructBarStyle(layer, id) { case DEFAULT: style.fillDims['clip-path'] = 'inset(0% 50% 0% 0%)' } + + if (bar.instant) { + style.fillDims['transition-duration'] = '0s' + } return style }