This commit is contained in:
lifestorm
2024-08-04 23:54:45 +03:00
parent 8064ba84d8
commit 6a58f406b1
7522 changed files with 4011896 additions and 15 deletions

View File

@@ -0,0 +1,59 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local PANEL = {}
local PLUGIN = PLUGIN
function PANEL:Init()
self.exit.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
self:Remove()
end
self.titleText:SetText("Select Trash Items")
self.titleText:SizeToContents()
self:CreateItems()
end
function PANEL:CreateItems()
local character = LocalPlayer():GetCharacter()
if !character then return end
local inventory = character:GetInventory()
if !inventory then return end
local scrollPanel = self.innerContent:Add("DScrollPanel")
scrollPanel:Dock(TOP)
scrollPanel:SetSize(self.innerContent:GetWide(), self.innerContent:GetTall() - SScaleMin(50 / 3))
for _, item in pairs(inventory:GetItemsByBase("base_junk")) do
if table.HasValue(PLUGIN.disAllowedJunk, item.uniqueID) then continue end
local frame, modelPanel, textPanel, amountPanel = self:CreateItem(scrollPanel, item.uniqueID)
local button = self:CreateInvisibleButton(frame, modelPanel, textPanel, amountPanel)
button.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
if self.junkAmount == 5 then
LocalPlayer():Notify("Bu makine çöplerle dolu!")
return
end
self.junkAmount = self.junkAmount + 1
frame:Remove()
netstream.Start("ixTrashCollectorPlaceJunk", item.id, self.entIndex)
end
end
end
vgui.Register("ixTrashCollectorSelector", PANEL, "PickupDispenser")