From 1876c95130b9e29e54217e6931607d0fa1b94f81 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" <48434875+JonnyBro@users.noreply.github.com> Date: Mon, 24 Feb 2025 17:52:51 +0500 Subject: [PATCH] feat: close menu after selecting a course --- beatrun/gamemodes/beatrun/gamemode/cl/Menu_Course.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/Menu_Course.lua b/beatrun/gamemodes/beatrun/gamemode/cl/Menu_Course.lua index 9080937..83351ec 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/Menu_Course.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/Menu_Course.lua @@ -59,10 +59,11 @@ function OpenCourseMenu() local dirsearch = dir .. "*.txt" local files = file.Find(dirsearch, "DATA", "datedesc") - PrintTable(files) + if BEATRUN_DEBUG then PrintTable(files) end + table.Empty(courselist.elements) - for k, v in pairs(files) do + for _, v in pairs(files) do local data = file.Read(dir .. v, "DATA") local course = util.Decompress(data) or data @@ -75,6 +76,9 @@ function OpenCourseMenu() function courseentry:onclick() LocalPlayer():EmitSound("buttonclick.wav") LoadCourse(filename) + + AEUI:RemovePanel(courselist) + AEUI:RemovePanel(coursepanel) end courseentry.greyed = sacheck