Skip to content

Commit

Permalink
Fix play button
Browse files Browse the repository at this point in the history
  • Loading branch information
dwursteisen committed Feb 24, 2024
1 parent 35dc4e1 commit 6111dac
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions tiny-cli/src/jvmMain/resources/sfx/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,7 @@ local window = {
height = 0
}

function on_play_button()
local score = nil
if fader_mode then
score = generate_score(patterns.value)
else
score = generate_score()
end
sfx.sfx(score)
end


function on_decrease_pattern(counter)
counter.value = math.max(counter.value - 1, 1)
Expand Down Expand Up @@ -214,6 +206,17 @@ end
editor.create_widgets = function()

-- buttons

local on_play_button = function()
local score = nil
if editor.mode == 0 then
score = editor.generate_score(editor.active_tab.content, editor.pattern_counter.value)
else
score = editor.generate_score(editor.active_tab.content)
end
sfx.sfx(score)
end

editor.play_button = widgets.createButton({
x = 10,
y = 16,
Expand Down Expand Up @@ -314,7 +317,7 @@ editor.create_widgets = function()

current_pattern[fader.index] = {
type = current_wave.type,
volume = 1.0,
volume = 255,
index = current_wave.index,
note = fader.value
}
Expand Down

0 comments on commit 6111dac

Please sign in to comment.