From 29c06df5feb498e91ed81e9782e79f03129e73b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 26 Oct 2024 15:02:03 +0200 Subject: [PATCH] fixed main fucntion bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- Song tool.lua | 100 +++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/Song tool.lua b/Song tool.lua index 9bfadff..3e4d088 100644 --- a/Song tool.lua +++ b/Song tool.lua @@ -317,57 +317,57 @@ end -- Main menu function main() - local resultTable = MessageBox( - { - title = "Song Tool - Main Menu", - message = "Select what you want to do:", - message_align_h = Enums.AlignmentH.Left, - message_align_v = Enums.AlignmentV.Top, - commands = { - {value = 2, name = "Create a song"}, - {value = 1, name = "Entry Point"}, - {value = 3, name = "Install"}, - {value = 0, name = "Exit"} - }, - backColor = "Global.Default", - icon = "logo_small", - titleTextColor = "Global.Text", - messageTextColor = "Global.Text" - } - ) - - local m_selection = resultTable.result - if m_selection == 0 then - do return end - elseif m_selection == 1 then - StartPointMenu() - elseif m_selection == 2 then - CreatorMenu() - elseif m_selection == 3 then - Installer() + if args then + local cues = SelectedSequence():Children() + local spCues = {} + + for i = 1, tablelength(cues), 1 do + cue = cues[i]:Children()[1] + cueNo = cues[i].no + if cue.appearance then + if cue.appearance.name == "Start Point" then + table.insert(spCues, tonumber(cueNo)) + end + end + end + for i = 1, 10, 1 do + if args == "goto_sp"..tostring(i) then + Cmd("Goto Cue "..tostring(spCues[i]/1000)) + end + end else - do return end + local resultTable = MessageBox( + { + title = "Song Tool - Main Menu", + message = "Select what you want to do:", + message_align_h = Enums.AlignmentH.Left, + message_align_v = Enums.AlignmentV.Top, + commands = { + {value = 2, name = "Create a song"}, + {value = 1, name = "Entry Point"}, + {value = 3, name = "Install"}, + {value = 0, name = "Exit"} + }, + backColor = "Global.Default", + icon = "logo_small", + titleTextColor = "Global.Text", + messageTextColor = "Global.Text" + } + ) + + local m_selection = resultTable.result + if m_selection == 0 then + do return end + elseif m_selection == 1 then + StartPointMenu() + elseif m_selection == 2 then + CreatorMenu() + elseif m_selection == 3 then + Installer() + else + do return end + end end end -if args then - local cues = SelectedSequence():Children() - local spCues = {} - - for i = 1, tablelength(cues), 1 do - cue = cues[i]:Children()[1] - cueNo = cues[i].no - if cue.appearance then - if cue.appearance.name == "Start Point" then - table.insert(spCues, tonumber(cueNo)) - end - end - end - for i = 1, 10, 1 do - if args == "goto_sp"..tostring(i) then - Cmd("Goto Cue "..tostring(spCues[i]/1000)) - end - end -else - return main -end \ No newline at end of file +return main \ No newline at end of file