h1-mod/data/cdata/ui_scripts/custom_weapons/__init__.lua
Vlad Loktionov bf2d533ac5
Add "Quit to desktop" button in pause menu (#558)
* Add "Quit to desktop" button in pause menu

* classes & custom_weapons: fix for SP

* "Quit to desktop" button for MP
2023-04-03 08:59:10 -05:00

27 lines
664 B
Lua

if game:issingleplayer() or (not Engine.InFrontend()) then
return
end
local cols = {
name = 0,
class = 1,
}
local csv = "mp/customWeapons.csv"
local rows = Engine.TableGetRowCount(csv)
for i = 0, rows do
local weap = Engine.TableLookupByRow(csv, i, cols.name)
local class = Engine.TableLookupByRow(csv, i, cols.class)
if (type(Cac.Weapons.Primary[class]) == "table") then
table.insert(Cac.Weapons.Primary[class], {
weap,
0
})
elseif (type(Cac.Weapons.Secondary[class]) == "table") then
table.insert(Cac.Weapons.Secondary[class], {
weap,
0
})
end
end