Skip to content

Commit

Permalink
bug fix when switching tab
Browse files Browse the repository at this point in the history
  • Loading branch information
dwursteisen committed Feb 7, 2024
1 parent 29519aa commit ee5ecfb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tiny-cli/src/jvmMain/resources/sfx/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ local current_wave = waves[1]

local active_tab = nil

local fader_mode = true
local switch_mode = nil

local fader_widgets = {}
local music_widgets = {}

function on_fader_update(fader, value)
widgets.setFaderValue(fader, current_wave.index, math.ceil(value), current_wave.color)

Expand Down Expand Up @@ -111,6 +117,10 @@ function active_pattern(index, data)
end

function on_active_tab(current, prec)

fader_mode = false
on_switch_mode()

if prec ~= nil then
local score = generate_score()
prec.content = sfx.to_table(score)
Expand Down Expand Up @@ -140,11 +150,7 @@ local window = {
height = 0
}

local fader_mode = true
local switch_mode = nil

local fader_widgets = {}
local music_widgets = {}

function on_new_tab(tab)
local filename = ws.create("sfx", "sfx")
Expand Down

0 comments on commit ee5ecfb

Please sign in to comment.