refactor: enforce noctalia.getConfig across community plugins
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
id = "neuro/upbeat"
|
||||
name = "Upbeat"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
min_noctalia = "5.0.0"
|
||||
author = "neuro"
|
||||
license = "MIT"
|
||||
@@ -33,4 +33,4 @@ key = "time_format_toggle"
|
||||
type = "bool"
|
||||
label_key = "settings.time_format_toggle.label"
|
||||
default = false
|
||||
description_key = "settings.time_format_toggle.description"
|
||||
description_key = "settings.time_format_toggle.description"
|
||||
|
||||
+4
-4
@@ -13,10 +13,10 @@ function update()
|
||||
local secondsSinceMidnight: number = (os.time() + BIEL_OFFSET_SECONDS) % 86400 -- 86400 = seconds in one day
|
||||
local totalCentibeats: number = math.floor(secondsSinceMidnight / SECONDS_PER_CENTIBEAT)
|
||||
-- define display of subbeat toggle
|
||||
local useCentibeats: boolean = barWidget.getConfig("show_centibeats")
|
||||
local useCentibeats: boolean = noctalia.getConfig("show_centibeats")
|
||||
-- define display of @beats toggle
|
||||
local showSuffix: boolean = barWidget.getConfig("beat_display")
|
||||
local timeFormatToggle: boolean = barWidget.getConfig("time_format_toggle")
|
||||
local showSuffix: boolean = noctalia.getConfig("beat_display")
|
||||
local timeFormatToggle: boolean = noctalia.getConfig("time_format_toggle")
|
||||
local checkValue: number = useCentibeats and totalCentibeats or math.floor(totalCentibeats / 100)
|
||||
-- layout updates when values tick
|
||||
if checkValue ~= lastValue then
|
||||
@@ -42,4 +42,4 @@ function update()
|
||||
-- defines targeting of next whole beat change (+100ms padding)
|
||||
noctalia.setUpdateInterval(math.floor((secondsToNextBeat * 1000) + 100))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user