Skip to content

Commit 4b273c7

Browse files
committed
2 parents cf10778 + 9b0604c commit 4b273c7

File tree

16 files changed

+273
-180
lines changed

16 files changed

+273
-180
lines changed

gamemode/core/derma/panels/extended_spawnmenu.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ hook.Add("PopulateContent", "liaExtendedSpawnMenuPopulateContent", function(pnlC
253253
node.PropPanel:Add(header)
254254
for _, ent in SortedPairsByMemberValue(ents, "PrintName") do
255255
local t = {
256-
nicename = ent.PrintName or ent.ClassName,
256+
nicename = ent.PrintName and language.GetPhrase(ent.PrintName) or ent.ClassName,
257257
spawnname = ent.ClassName,
258258
material = "entities/" .. ent.ClassName .. ".png",
259259
admin = ent.AdminOnly
@@ -364,7 +364,7 @@ hook.Add("PopulateContent", "liaExtendedSpawnMenuPopulateContent", function(pnlC
364364
node.PropPanel:Add(header)
365365
for _, ent in SortedPairsByMemberValue(vs, "PrintName") do
366366
local t = {
367-
nicename = ent.PrintName or ent.ClassName,
367+
nicename = ent.PrintName and language.GetPhrase(ent.PrintName) or ent.ClassName,
368368
spawnname = ent.ClassName,
369369
material = "entities/" .. ent.ClassName .. ".png",
370370
admin = ent.AdminOnly
@@ -401,7 +401,7 @@ hook.Add("PopulateContent", "liaExtendedSpawnMenuPopulateContent", function(pnlC
401401
node.PropPanel:Add(header)
402402
for _, ent in SortedPairsByMemberValue(ws, "PrintName") do
403403
local t = {
404-
nicename = ent.PrintName or ent.ClassName,
404+
nicename = ent.PrintName and language.GetPhrase(ent.PrintName) or ent.ClassName,
405405
spawnname = ent.ClassName,
406406
material = "entities/" .. ent.ClassName .. ".png",
407407
admin = ent.AdminOnly

gamemode/core/derma/panels/roster.lua

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
local PANEL = {}
2+
3+
function PANEL:Init()
4+
self.sheet = self:Add("liaSheet")
5+
self.sheet:Dock(FILL)
6+
self.sheet:SetPlaceholderText(L("search"))
7+
end
8+
9+
function PANEL:SetRosterType(t)
10+
self.rosterType = t
11+
end
12+
13+
function PANEL:Populate(data, canKick)
14+
if not IsValid(self.sheet) then return end
15+
self.sheet.search:SetValue("")
16+
self.sheet:Clear()
17+
local rows = {}
18+
local originals = {}
19+
for _, v in ipairs(data) do
20+
rows[#rows + 1] = {v.name, v.steamID, v.class or L("none"), v.playTime, v.lastOnline}
21+
originals[#originals + 1] = v
22+
end
23+
local row = self.sheet:AddListViewRow({
24+
columns = {L("name"), L("steamID"), L("class"), L("playtime"), L("lastOnline")},
25+
data = rows,
26+
getLineText = function(line)
27+
local s = ""
28+
for i = 1, 5 do
29+
local v = line:GetValue(i)
30+
if v then s = s .. " " .. tostring(v) end
31+
end
32+
return s
33+
end
34+
})
35+
if row and row.widget then
36+
for i, line in ipairs(row.widget:GetLines() or {}) do
37+
line.rowData = originals[i]
38+
end
39+
row.widget.OnRowRightClick = function(_, _, line)
40+
if not IsValid(line) or not line.rowData then return end
41+
local rowData = line.rowData
42+
local menu = DermaMenu()
43+
if canKick and rowData.steamID ~= LocalPlayer():SteamID() then
44+
menu:AddOption(L("kick"), function()
45+
Derma_Query(L("kickConfirm"), L("confirm"), L("yes"), function()
46+
net.Start("KickCharacter")
47+
net.WriteInt(tonumber(rowData.id), 32)
48+
net.SendToServer()
49+
end, L("no"))
50+
end)
51+
end
52+
menu:AddOption(L("view") .. " " .. L("characterList"), function()
53+
LocalPlayer():ConCommand("say /charlist " .. rowData.steamID)
54+
end)
55+
menu:AddOption(L("copySteamID"), function()
56+
SetClipboardText(rowData.steamID or "")
57+
end)
58+
menu:AddOption(L("copyRow"), function()
59+
local rowString = ""
60+
for key, value in pairs(rowData) do
61+
value = tostring(value or L("na"))
62+
rowString = rowString .. key:gsub("^%l", string.upper) .. ": " .. value .. " | "
63+
end
64+
rowString = rowString:sub(1, -4)
65+
SetClipboardText(rowString)
66+
end)
67+
menu:Open()
68+
end
69+
end
70+
self.sheet:Refresh()
71+
end
72+
73+
vgui.Register("liaRoster", PANEL, "EditablePanel")
74+

gamemode/core/libraries/compatibility/pac.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ lia.command.add("pacdisable", {
230230
end
231231
})
232232

233-
lia.config.add("BlockPackURLoad", "Block Pack URL Load", true, nil, {
234-
desc = "Determines whether loading PAC3 packs from a URL should be blocked.",
233+
lia.config.add("BlockPackURLoad", L("blockPackUrlLoad"), true, nil, {
234+
desc = L("blockPackUrlLoadDesc"),
235235
category = L("categoryPAC3"),
236236
noNetworking = false,
237237
schemaOnly = false,

gamemode/core/libraries/compatibility/sam.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ end)
165165

166166
lia.command.add("cleardecals", {
167167
adminOnly = true,
168-
privilege = "Clear Decals",
169-
desc = "cleardecalsDesc",
168+
privilege = L("clearDecals"),
169+
desc = L("cleardecalsDesc"),
170170
onRun = function()
171171
for _, v in player.Iterator() do
172172
v:ConCommand("r_cleardecals")
@@ -177,24 +177,24 @@ lia.command.add("cleardecals", {
177177
lia.administrator.registerPrivilege({
178178
Name = L("canSeeSAMNotificationsOutsideStaff"),
179179
MinAccess = "superadmin",
180-
Category = "SAM | Admin Mod"
180+
Category = L("categorySAM")
181181
})
182182

183183
lia.administrator.registerPrivilege({
184184
Name = L("canBypassSAMFactionWhitelist"),
185185
MinAccess = "superadmin",
186-
Category = "SAM | Admin Mod"
186+
Category = L("categorySAM")
187187
})
188188

189-
lia.config.add("AdminOnlyNotification", "Admin Only Notifications", true, nil, {
190-
desc = "Restricts certain notifications to admins with specific permissions or those on duty.",
191-
category = "SAM | Admin Mod",
189+
lia.config.add("AdminOnlyNotification", L("adminOnlyNotifications"), true, nil, {
190+
desc = L("adminOnlyNotificationsDesc"),
191+
category = L("categorySAM"),
192192
type = "Boolean"
193193
})
194194

195-
lia.config.add("SAMEnforceStaff", "Enforce Staff Rank To SAM", true, nil, {
196-
desc = "Determines whether staff enforcement for SAM commands is enabled",
197-
category = "SAM | Admin Mod",
195+
lia.config.add("SAMEnforceStaff", L("samEnforceStaff"), true, nil, {
196+
desc = L("samEnforceStaffDesc"),
197+
category = L("categorySAM"),
198198
type = "Boolean"
199199
})
200200

gamemode/core/libraries/compatibility/simfphys.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ hook.Add("CheckValidSit", "liaSimfphys", function(client)
4949
if IsValid(vehicle) and vehicle:isSimfphysCar() then return false end
5050
end)
5151

52-
lia.config.add("DamageInCars", "Take Damage in Cars", true, nil, {
53-
desc = "Whether or not you take damage while in cars",
54-
category = "Simfphys Vehicles",
52+
lia.config.add("DamageInCars", L("takeDamageInCars"), true, nil, {
53+
desc = L("takeDamageInCarsDesc"),
54+
category = L("simfphysVehicles"),
5555
type = "Boolean"
5656
})
5757

58-
lia.config.add("CarEntryDelayEnabled", "Take Damage in Cars", true, nil, {
59-
desc = "Whether or not you take damage while in cars",
60-
category = "Simfphys Vehicles",
58+
lia.config.add("CarEntryDelayEnabled", L("carEntryDelayEnabled"), true, nil, {
59+
desc = L("carEntryDelayEnabledDesc"),
60+
category = L("simfphysVehicles"),
6161
type = "Boolean"
6262
})
6363

64-
lia.config.add("TimeToEnterVehicle", "Time To Enter Vehicle", 4, nil, {
65-
desc = "Defines the time to enter vehicle.",
66-
category = "Simfphys Vehicles",
64+
lia.config.add("TimeToEnterVehicle", L("timeToEnterVehicle"), 4, nil, {
65+
desc = L("timeToEnterVehicleDesc"),
66+
category = L("simfphysVehicles"),
6767
type = "Int",
6868
min = 1,
6969
max = 20
@@ -72,7 +72,7 @@ lia.config.add("TimeToEnterVehicle", "Time To Enter Vehicle", 4, nil, {
7272
lia.administrator.registerPrivilege({
7373
Name = L("canEditSimfphysCars"),
7474
MinAccess = "superadmin",
75-
Category = "Simfphys Vehicles"
75+
Category = L("simfphysVehicles")
7676
})
7777

7878
hook.Add("simfphysPhysicsCollide", "SIMFPHYS_simfphysPhysicsCollide", function() return true end)

0 commit comments

Comments
 (0)