Skip to content

Commit

Permalink
rebirth very small update function optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 10, 2021
1 parent 5595b32 commit 1942df6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Themes/Rebirth/BGAnimations/ScreenToolTipOverlay overlay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ local function UpdateLoop()
local mouseY = INPUTFILTER:GetMouseY()
TOOLTIP:SetPosition(mouseX, mouseY)
BUTTON:UpdateMouseState()

return false
end

local t = Def.ActorFrame {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ local function assetList()
-- but the reality is thats literally a lie because lua is forced to be single threaded here
co = coroutine.create(updateImages)
self:SetUpdateFunction(function(self, delta)
if not focused then return end
if coroutine.status(co) ~= "dead" then
coroutine.resume(co)
end
Expand All @@ -394,7 +395,6 @@ local function assetList()
-- pressing a number with ctrl should lead to the general tab
-- otherwise, typing numbers is allowed
if CONTEXTMAN:CheckContextSet(snm, "AssetSettings") then
if inBundles then return end
if event.type ~= "InputEventType_Release" then
local btn = event.DeviceInput.button
local gbtn = event.button
Expand Down
3 changes: 2 additions & 1 deletion Themes/Rebirth/Scripts/10 AudioVisualizer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ function audioVisualizer:new(params)
do
local values = frame.values
addToBin = function(magnitude, freq)
for i = 2, #freqIntervals do
local cap = #freqIntervals
for i = 2, cap do
if freq > freqIntervals[i - 1] and freq <= freqIntervals[i] then
values[i - 1] = values[i - 1] + magnitude
return
Expand Down

0 comments on commit 1942df6

Please sign in to comment.