fix courses on maps with spaces in the name not loading (i hate edge runner)
This commit is contained in:
Jonny_Bro (Nikita) 2024-11-23 16:10:16 +05:00
parent 48422f0262
commit 4467097586
No known key found for this signature in database
GPG key ID: 3F1ECC04147E9BD8
7 changed files with 10 additions and 10 deletions

View file

@ -50,7 +50,7 @@ beatrun.hud.lvl=Lvl: %s
beatrun.hud.infector=Infector beatrun.hud.infector=Infector
# Menu_Course # Menu_Course
beatrun.coursemenu.trials=Courses - %s beatrun.coursemenu.trials=Courses - Folder: %s
beatrun.coursemenu.buildmode=Toggle Build Mode beatrun.coursemenu.buildmode=Toggle Build Mode
beatrun.coursemenu.freeplay=Return to Freeplay beatrun.coursemenu.freeplay=Return to Freeplay

View file

@ -50,7 +50,7 @@ beatrun.hud.lvl=Лвл: %s
beatrun.hud.infector=Заражённый beatrun.hud.infector=Заражённый
# Menu_Course # Menu_Course
beatrun.coursemenu.trials=Курсы - %s beatrun.coursemenu.trials=Курсы - Папка: %s
beatrun.coursemenu.buildmode=Режим строительства beatrun.coursemenu.buildmode=Режим строительства
beatrun.coursemenu.freeplay=Свободная игра beatrun.coursemenu.freeplay=Свободная игра

View file

@ -50,7 +50,7 @@ beatrun.hud.lvl=Лвл: %s
beatrun.hud.infector=Заражений beatrun.hud.infector=Заражений
# Menu_Course # Menu_Course
beatrun.coursemenu.trials=Курси - %s beatrun.coursemenu.trials=Курси - Папка: %s
beatrun.coursemenu.buildmode=Режим будівництва beatrun.coursemenu.buildmode=Режим будівництва
beatrun.coursemenu.freeplay=Вільна гра beatrun.coursemenu.freeplay=Вільна гра

View file

@ -25,7 +25,7 @@ local function buildmodebutton()
LocalPlayer():ConCommand("buildmode") LocalPlayer():ConCommand("buildmode")
end end
AEUI:Text(coursepanel, language.GetPhrase("beatrun.coursemenu.trials"):format(game.GetMap()), "AEUIVeryLarge", 20, 30) AEUI:Text(coursepanel, language.GetPhrase("beatrun.coursemenu.trials"):format(string.Replace(game.GetMap(), " ", "-")), "AEUIVeryLarge", 20, 30)
local buildmodebutton = AEUI:AddButton(coursepanel, "#beatrun.coursemenu.buildmode", buildmodebutton, "AEUILarge", coursepanel.w - 400, coursepanel.h - 50) local buildmodebutton = AEUI:AddButton(coursepanel, "#beatrun.coursemenu.buildmode", buildmodebutton, "AEUILarge", coursepanel.w - 400, coursepanel.h - 50)
buildmodebutton.greyed = sacheck buildmodebutton.greyed = sacheck
@ -55,7 +55,7 @@ function OpenCourseMenu()
AEUI:AddPanel(coursepanel) AEUI:AddPanel(coursepanel)
AEUI:AddPanel(courselist) AEUI:AddPanel(courselist)
local dir = "beatrun/courses/" .. game.GetMap() .. "/" local dir = "beatrun/courses/" .. string.Replace(game.GetMap(), " ", "-") .. "/"
local dirsearch = dir .. "*.txt" local dirsearch = dir .. "*.txt"
local files = file.Find(dirsearch, "DATA", "datedesc") local files = file.Find(dirsearch, "DATA", "datedesc")

View file

@ -576,7 +576,7 @@ if SERVER then
end end
function Beatrun_ReadCourseLocal(id) function Beatrun_ReadCourseLocal(id)
local dir = "beatrun/courses/" .. game.GetMap() .. "/" local dir = "beatrun/courses/" .. string.Replace(game.GetMap(), " ", "-") .. "/"
local save = file.Read(dir .. id .. ".txt", "DATA") local save = file.Read(dir .. id .. ".txt", "DATA")
if not save then if not save then
@ -943,7 +943,7 @@ if CLIENT then
local save = CourseData(name) local save = CourseData(name)
local jsonsave = util.TableToJSON(save) local jsonsave = util.TableToJSON(save)
local id = util.CRC(jsonsave) local id = util.CRC(jsonsave)
local dir = "beatrun/courses/" .. game.GetMap() .. "/" local dir = "beatrun/courses/" .. string.Replace(game.GetMap(), " ", "-") .. "/"
if compress == nil then compress = true end if compress == nil then compress = true end
@ -1011,7 +1011,7 @@ if CLIENT then
--[[ --[[
concommand.Add("Beatrun_PrintCourse", function(ply, cmd, args, argstr) concommand.Add("Beatrun_PrintCourse", function(ply, cmd, args, argstr)
local dir = "beatrun/courses/" .. game.GetMap() .. "/" local dir = "beatrun/courses/" .. string.Replace(game.GetMap(), " ", "-") .. "/"
local save = file.Read(dir .. args[1] .. ".txt", "DATA") local save = file.Read(dir .. args[1] .. ".txt", "DATA")
if not save then if not save then

View file

@ -1,4 +1,4 @@
VERSION_GLOBAL = "1.0.21" VERSION_GLOBAL = "1.0.22"
VERSION_LATEST = "" VERSION_LATEST = ""
VERSION_CHECKED = false VERSION_CHECKED = false

View file

@ -1 +1 @@
1.0.21 1.0.22