Skip to content

Commit 2585e79

Browse files
committed
Bug Fixing
1 parent abb3c96 commit 2585e79

File tree

71 files changed

+2089
-546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2089
-546
lines changed

documentation/docs/compatibility.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ In recent releases the compatibility set has grown even larger. Popular communit
1010

1111
- **PAC3** outfit synchronization
1212

13-
- **ServerGuard** permission support
14-
1513
- **SAM** admin suite
1614

1715
- **PermaProps** management helpers
@@ -142,21 +140,6 @@ Listens for death and character-switch events, automatically exiting prone to av
142140

143141
Mirrors SAM commands and enforces Lilia’s permission checks so admins can use familiar tools seamlessly.
144142

145-
---
146-
147-
## [ServerGuard](https://www.gmodstore.com/market/view/serverguard)
148-
149-
**Compatibility Highlights:**
150-
151-
* Translates Lilia admin commands to their ServerGuard equivalents.
152-
153-
* Disables the built-in restrictions plugin so Lilia can manage permissions.
154-
155-
**Detailed Explanation:**
156-
157-
Turns off ServerGuard’s restriction module to ensure a single consistent permission system while retaining other features.
158-
159-
---
160143

161144
## [Simfphys Vehicles](https://steamcommunity.com/sharedfiles/filedetails/?id=771487490)
162145

@@ -200,7 +183,7 @@ Adjusts console settings and seat interactions to prevent trolling while maintai
200183
201184
> ULX is not compatible with Lilia because its version of CAMI is extremely old and breaks permission checks.
202185
203-
Use Lilia's built-in admin menu or another modern admin suite like SAM or ServerGuard instead.
186+
Use Lilia's built-in admin menu or another modern admin suite like SAM instead.
204187

205188
## [VCMod Main](https://www.gmodstore.com/market/view/vcmod-main)
206189

documentation/docs/hooks/gamemode_hooks.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,6 +2163,123 @@ hook.Add("CanPlayerUnequipItem", "Cursed", function(ply, item)
21632163
end)
21642164
```
21652165

2166+
### CanPlayerRotateItem
2167+
2168+
**Purpose**
2169+
2170+
Called when a player attempts to rotate an inventory item. Return false to block rotating.
2171+
2172+
**Parameters**
2173+
2174+
- `client` (`Player`): Player rotating.
2175+
- `item` (`table`): Item being rotated.
2176+
2177+
**Realm**
2178+
2179+
`Server`
2180+
2181+
**Returns**
2182+
2183+
- boolean: False to block rotating
2184+
2185+
**Example Usage**
2186+
2187+
```lua
2188+
hook.Add("CanPlayerRotateItem", "NoRotatingArtifacts", function(ply, item)
2189+
if item.isArtifact then
2190+
return false
2191+
end
2192+
end)
2193+
```
2194+
2195+
### CanPlayerInspectItem
2196+
2197+
**Purpose**
2198+
2199+
Checks if a player may open the item inspection panel. Return false to prevent inspection.
2200+
2201+
**Parameters**
2202+
2203+
- `client` (`Player`): Player inspecting.
2204+
- `item` (`table`): Item being inspected.
2205+
2206+
**Realm**
2207+
2208+
`Client`
2209+
2210+
**Returns**
2211+
2212+
- boolean: False to block inspection
2213+
2214+
**Example Usage**
2215+
2216+
```lua
2217+
hook.Add("CanPlayerInspectItem", "BlockSecretItems", function(ply, item)
2218+
if item.secret then
2219+
return false
2220+
end
2221+
end)
2222+
```
2223+
2224+
### CanPlayerRequestInspectionOnItem
2225+
2226+
**Purpose**
2227+
2228+
Called when a player wants to show an item to someone else. Return false to cancel the request.
2229+
2230+
**Parameters**
2231+
2232+
- `client` (`Player`): Player requesting inspection.
2233+
- `target` (`Player`): Target player.
2234+
- `item` (`table`): Item being offered.
2235+
2236+
**Realm**
2237+
2238+
`Server`
2239+
2240+
**Returns**
2241+
2242+
- boolean: False to cancel the request
2243+
2244+
**Example Usage**
2245+
2246+
```lua
2247+
hook.Add("CanPlayerRequestInspectionOnItem", "FriendsOnly", function(ply, target, item)
2248+
if not ply:isFriend(target) then
2249+
return false
2250+
end
2251+
end)
2252+
```
2253+
2254+
### CanPlayerSeeLogCategory
2255+
2256+
**Purpose**
2257+
2258+
Determines if a player can view a specific log category in the admin console.
2259+
2260+
**Parameters**
2261+
2262+
- `client` (`Player`): Player requesting logs.
2263+
- `category` (`string`): Category name.
2264+
2265+
**Realm**
2266+
2267+
`Server`
2268+
2269+
**Returns**
2270+
2271+
- boolean: False to hide the category
2272+
2273+
**Example Usage**
2274+
2275+
```lua
2276+
hook.Add("CanPlayerSeeLogCategory", "HideChatLogs", function(ply, category)
2277+
if category == "chatOOC" and not ply:IsAdmin() then
2278+
return false
2279+
end
2280+
end)
2281+
```
2282+
21662283
---
21672284

21682285
### PostPlayerSay
@@ -10677,3 +10794,32 @@ hook.Add("PlayerCheatDetected", "LogCheaters", function(ply)
1067710794
return true -- handled, skip default ban
1067810795
end)
1067910796
```
10797+
10798+
---
10799+
10800+
### OnCheaterCaught
10801+
10802+
**Purpose**
10803+
10804+
Called after a player is flagged for cheating. This fires once the player has
10805+
been marked with the `cheater` network variable.
10806+
10807+
**Parameters**
10808+
10809+
- `client` (`Player`): Player confirmed to be cheating.
10810+
10811+
**Realm**
10812+
10813+
`Server`
10814+
10815+
**Returns**
10816+
10817+
- None
10818+
10819+
**Example Usage**
10820+
10821+
```lua
10822+
hook.Add("OnCheaterCaught", "AnnounceCheater", function(ply)
10823+
print(ply:Name() .. " has been caught cheating!")
10824+
end)
10825+
```

documentation/docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You should be comfortable using the command line.
2626

2727
- **Admin Menu:**
2828

29-
Lilia includes a built-in admin menu for logging, tickets and teleport tools. [SAM](https://www.gmodstore.com/market/view/sam) and [ServerGuard](https://www.gmodstore.com/market/view/serverguard) are also compatible. **ULX is not supported because its CAMI library is outdated.**
29+
Lilia includes a built-in admin menu for logging, tickets and teleport tools. [SAM](https://www.gmodstore.com/market/view/sam) is also compatible. **ULX is not supported because its CAMI library is outdated.**
3030

3131
- **Code Editor (optional):**
3232

documentation/docs/libraries/lia.admin.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This page explains the built-in administration system.
66

77
## Overview
88

9-
The admin library manages user groups, privileges, and bans. It automatically disables itself when the SAM or ServerGuard admin mods are detected.
9+
The admin library manages user groups, privileges, and bans. It automatically disables itself when the SAM admin mod is detected.
1010

1111
The base user groups `user`, `admin`, and `superadmin` are created automatically and cannot be removed.
1212

@@ -36,7 +36,9 @@ Checks for third-party admin mods and returns `true` when the built-in system sh
3636

3737
**Purpose**
3838

39-
Loads stored admin groups and privileges from disk.
39+
Loads stored admin groups and privileges from disk. If CAMI usergroups are
40+
available, they will be used instead and the current CAMI permissions will be
41+
imported.
4042

4143
**Parameters**
4244

documentation/docs/meta/entity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Determines if the entity is persistent in Lilia.
152152
```lua
153153
-- Save this entity across map resets if persistent
154154
if ent:isLiliaPersistent() then
155-
lia.persist.saveEntity(ent)
155+
-- Lilia will automatically add it to persistence
156156
end
157157
```
158158

gamemode/core/derma/f1menu/cl_menu.lua

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,24 @@ function PANEL:Init()
135135
end
136136

137137
self:MakePopup()
138-
self:setActiveTab(lia.config.get("DefaultMenuTab"))
138+
local defaultTab = lia.config.get("DefaultMenuTab", L("status"))
139+
if not self.tabList[defaultTab] then
140+
local statusKey = L("status")
141+
if self.tabList[statusKey] then
142+
defaultTab = statusKey
143+
else
144+
local keys = {}
145+
for k in pairs(self.tabList) do
146+
keys[#keys + 1] = k
147+
end
148+
if #keys > 0 then
149+
defaultTab = keys[math.random(#keys)]
150+
end
151+
end
152+
end
153+
if defaultTab then
154+
self:setActiveTab(defaultTab)
155+
end
139156
end
140157

141158
function PANEL:addTab(name, callback)

gamemode/core/derma/panels/chatbox.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function PANEL:setActive(state)
110110
self.commandList:SetSize(self:GetWide() - 8, self:GetTall() - 66)
111111
self.commandList:GetVBar():SetWide(8)
112112
for cmdName, cmdInfo in SortedPairs(self.commands) do
113-
if not tobool(cmdName:find(input:sub(2))) then continue end
113+
if not tobool(string.find(cmdName, input:sub(2), 1, true)) then continue end
114114
local btn = self.commandList:Add("DButton")
115115
btn:SetText("/" .. cmdName .. " - " .. (cmdInfo.desc or L("noDesc")))
116116
btn:Dock(TOP)

gamemode/core/derma/panels/extended_spawnmenu.lua

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -489,16 +489,6 @@ hook.Add("PopulateContent", "liaExtendedSpawnMenuPopulateContent", function(pnlC
489489
end
490490
end)
491491

492-
concommand.Add("extsm_addoninfo", function()
493-
local frame = vgui.Create("DFrame")
494-
frame:SetSize(ScrW() - 100, ScrH() - 100)
495-
frame:Center()
496-
frame:MakePopup()
497-
local scroll = frame:Add("DScrollPanel")
498-
scroll:Dock(FILL)
499-
scroll:Add("rb655_addonInfo")
500-
end)
501-
502492
hook.Add("AddToolMenuCategories", "liaExtendedSpawnMenuAddToolMenuCategories", function() spawnmenu.AddToolCategory("Utilities", "Robotboy655", "#Robotboy655") end)
503493
local PANEL = {}
504494
function PANEL:Init()
@@ -596,13 +586,15 @@ function PANEL:Paint()
596586
local _, th11 = DrawText(L("filesUnusedDelete"), "AddonInfo_Text", 0, y, color_white)
597587
y = y + th11
598588
local maxW2 = 0
589+
local th12Height = 0
599590
for _, e in ipairs(self.workshopWasteFiles) do
600591
local tw6, th12 = DrawText(GetSize(e[2]) .. " ", "AddonInfo_Small", 0, y, Color(220, 220, 220))
601592
maxW2 = math.max(maxW2, tw6)
593+
th12Height = th12
602594
y = y + th12
603595
end
604596

605-
y = y - #self.workshopWasteFiles * th12
597+
y = y - #self.workshopWasteFiles * th12Height
606598
for _, e in ipairs(self.workshopWasteFiles) do
607599
local _, th13 = DrawText(e[1], "AddonInfo_Small", maxW2, y, color_white)
608600
y = y + th13
@@ -672,4 +664,4 @@ hook.Add("PopulatePropMenu", "liaExtendedSpawnMenuPopulatePropMenu", function(pn
672664
sid = sid + 1
673665
end
674666
end
675-
end)
667+
end)

gamemode/core/derma/panels/item.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local PANEL = {}
1+
local PANEL = {}
22
local renderedIcons = {}
33
local function renderNewIcon(panel, itemTable)
44
if itemTable.iconCam and (not renderedIcons[string.lower(itemTable.model)] or itemTable.forceRender) then
@@ -11,6 +11,7 @@ local function renderNewIcon(panel, itemTable)
1111

1212
renderedIcons[string.lower(itemTable.model)] = true
1313
panel.Icon:RebuildSpawnIconEx(iconCam)
14+
itemTable.forceRender = nil
1415
end
1516
end
1617

@@ -137,4 +138,4 @@ function PANEL:ItemDataChanged()
137138
self:updateTooltip()
138139
end
139140

140-
vgui.Register("liaItemIcon", PANEL, "SpawnIcon")
141+
vgui.Register("liaItemIcon", PANEL, "SpawnIcon")

gamemode/core/derma/panels/itempanel.lua

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ function PANEL:openInspect()
7979
local view = vgui.Create("EditablePanel", frame)
8080
view:Dock(TOP)
8181
view:SetTall(fh * 0.5)
82-
view.Paint = function(_, w, h)
83-
surface.SetDrawColor(color_black)
84-
surface.DrawOutlinedRect(0, 0, w, h, 2)
85-
end
8682

8783
local model = vgui.Create("DModelPanel", view)
8884
model:Dock(FILL)
@@ -99,29 +95,8 @@ function PANEL:openInspect()
9995
end)
10096

10197
model.OnMouseWheeled = function(p, d) p:SetFOV(math.Clamp(p:GetFOV() - d * 2, 20, 80)) end
102-
model.OnMousePressed = function(p, btn)
103-
if btn == MOUSE_LEFT then
104-
p.dragging = true
105-
p.lastX, p.lastY = input.GetCursorPos()
106-
p:MouseCapture(true)
107-
end
108-
end
109-
110-
model.OnMouseReleased = function(p)
111-
p.dragging = false
112-
p:MouseCapture(false)
113-
end
11498

11599
model.Think = function(p)
116-
if p.dragging then
117-
local x, y = input.GetCursorPos()
118-
local dx, dy = x - p.lastX, y - p.lastY
119-
p.lastX, p.lastY = x, y
120-
local off = Vector(-dx, dy, 0) * 0.03
121-
p:SetCamPos(p:GetCamPos() + off)
122-
p:SetLookAt(p:GetLookAt() + off)
123-
end
124-
125100
if input.IsKeyDown(KEY_A) or input.IsKeyDown(KEY_D) then
126101
local ang = p.Entity:GetAngles()
127102
ang.y = ang.y + FrameTime() * 150 * (input.IsKeyDown(KEY_A) and 1 or -1)
@@ -183,7 +158,9 @@ function PANEL:buildButtons()
183158
end
184159

185160
self:addBtn(L("inspect"), function()
186-
self:openInspect()
161+
if hook.Run("CanPlayerInspectItem", LocalPlayer(), self.item) ~= false then
162+
self:openInspect()
163+
end
187164
self:Remove()
188165
end)
189166

0 commit comments

Comments
 (0)