Skip to content

Commit

Permalink
wrap loading welcompanelitems.lua into pcall
Browse files Browse the repository at this point in the history
  • Loading branch information
Beherith committed Jun 6, 2024
1 parent 94b9c64 commit a1c1fd1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion LuaMenu/configs/gameConfig/byar/mainConfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ local helpSubmenuConfig = VFS.Include(LUA_DIRNAME .. "configs/gameConfig/" .. s
local skirmishDefault = VFS.Include(LUA_DIRNAME .. "configs/gameConfig/" .. shortname .. "/skirmishDefault.lua")
local rankFunction = VFS.Include(LUA_DIRNAME .. "configs/gameConfig/byar/rankFunction.lua")
local backgroundConfig = VFS.Include(LUA_DIRNAME .. "configs/gameConfig/" .. shortname .. "/skinning/skinConfig.lua")
local welcomePanelItems = VFS.Include(LUA_DIRNAME .. "configs/gameConfig/" .. shortname .. "/welcomePanelItems.lua")

local welcomePanelItems = {{Header = "Failed to parse welcomePanelItems.lua", Text = "Unknown error"}}

local success, err = pcall(function()
local wpi = VFS.Include(LUA_DIRNAME .. "configs/gameConfig/" .. shortname .. "/welcomePanelItems.lua")
welcomePanelItems = wpi
end)
if not success then
welcomePanelItems[1].Text = err
end

--Map stuff:
local mapDetails = VFS.Include(LUA_DIRNAME .. "configs/gameConfig/" .. shortname .. "/mapDetails.lua")
Expand Down

0 comments on commit a1c1fd1

Please sign in to comment.