This commit is contained in:
lifestorm
2024-08-05 18:40:29 +03:00
parent 9f505a0646
commit c6d9b6f580
8044 changed files with 1853472 additions and 21 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,493 @@
--[[
| 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 padding = SScaleMin(10 / 3)
function PANEL:Init()
self:SetSize(ScrW(), ScrH())
self:SetAlpha(0)
self:AlphaTo(255, 0.5, 0)
self.Paint = function( self, w, h )
surface.SetDrawColor(Color(63, 58, 115, 220))
surface.DrawRect(0, 0, w, h)
Derma_DrawBackgroundBlur( self, 1 )
end
self.content = self:Add("EditablePanel")
self.content:SetSize(SScaleMin(400 / 3), SScaleMin(600 / 3))
self.content:Center()
self.content:MakePopup()
Schema:AllowMessage(self.content)
self.content.Paint = function(self, w, h)
surface.SetDrawColor(0, 0, 0, 130)
surface.DrawRect(0, 0, w, h)
end
self.topbar = self.content:Add("Panel")
self.topbar:SetSize(self.content:GetWide(), SScaleMin(50 / 3))
self.topbar:Dock(TOP)
self.topbar.Paint = function( self, w, h )
surface.SetDrawColor(0, 0, 0, 130)
surface.DrawRect(0, 0, w, h)
end
local titleText = self.topbar:Add("DLabel")
titleText:SetFont("LargerTitlesFontNoClamp")
titleText:Dock(LEFT)
titleText:SetText("Civil Administration")
titleText:DockMargin(SScaleMin(10 / 3), 0, 0, 0)
titleText:SetContentAlignment(4)
titleText:SizeToContents()
local exit = self.topbar:Add("DImageButton")
exit:SetImage("willardnetworks/tabmenu/navicons/exit.png")
exit:SetSize(SScaleMin(20 / 3), SScaleMin(20 / 3))
exit:DockMargin(0, SScaleMin(15 / 3), SScaleMin(10 / 3), SScaleMin(15 / 3))
exit:Dock(RIGHT)
exit.DoClick = function()
LocalPlayer().messagelist = nil
self:Remove()
surface.PlaySound("helix/ui/press.wav")
end
self:CreateInner()
end
local function PaintButton(self, w, h)
surface.SetDrawColor(Color(0, 0, 0, 100))
surface.DrawRect(0, 0, w, h)
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 30)))
surface.DrawOutlinedRect(0, 0, w, h)
end
function PANEL:CreateBackButton()
local divider = self.topbar:Add("DShape")
divider:SetType("Rect")
divider:Dock(RIGHT)
divider:DockMargin(padding, padding, padding, padding)
divider:SetWide(1)
divider:SetColor(Color(111, 111, 136, (255 / 100 * 30)))
local back = self.topbar:Add("DButton")
back:Dock(RIGHT)
back:SetText("BACK")
back:SetFont("TitlesFontNoClamp")
back.Paint = nil
back:SizeToContents()
back.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
self:Remove()
local panel = vgui.Create("ixCAPDA")
panel:SetAlpha(255)
end
end
function PANEL:CreateNewspaperButton()
self.newspapers = self.innerContent:Add("DButton")
self.newspapers:Dock(TOP)
self.newspapers:SetTall(SScaleMin(50 / 3))
self.newspapers:SetText("Union Newspapers")
self.newspapers:SetFont("WNBleedingMinutesBoldNoClamp")
self.newspapers:SetContentAlignment(4)
self.newspapers:SetTextInset(SScaleMin(10 / 3), 0)
self.newspapers.Paint = function(self, w, h)
PaintButton(self, w, h)
end
self.newspapers:DockMargin(0, -1, 0, 0)
self.newspapers.DoClick = function()
self:CreateBackButton()
surface.PlaySound("helix/ui/press.wav")
self.innerContent:Clear()
for k, v in pairs(self.storedNewspapers) do
local newspaper = self.innerContent:Add("DButton")
newspaper:Dock(TOP)
newspaper:SetTall(SScaleMin(50 / 3))
newspaper:SetText(v[3][1].columnTitle.." | "..v[3][1].columnSubtitle)
newspaper:SetFont("WNBleedingMinutesBoldNoClamp")
newspaper:SetContentAlignment(4)
newspaper:SetTextInset(SScaleMin(10 / 3), 0)
newspaper.Paint = function(self, w, h)
PaintButton(self, w, h)
end
if k != 1 then
newspaper:DockMargin(0, -1, 0, 0)
end
newspaper.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
local areyousure = vgui.Create("Panel")
areyousure:SetSize(SScaleMin(300 / 3), SScaleMin(100 / 3))
areyousure:Center()
areyousure:MakePopup()
areyousure.Paint = function(self, w, h)
PaintButton(self, w, h)
end
local label = areyousure:Add("DLabel")
label:SetFont("WNBleedingMinutesBoldNoClamp")
label:SetText("Remove stored newspaper?")
label:SizeToContents()
label:Dock(TOP)
label:SetContentAlignment(5)
local buttonpanel = areyousure:Add("Panel")
buttonpanel:Dock(BOTTOM)
buttonpanel:SetTall(SScaleMin(50 / 3))
local yes = buttonpanel:Add("DButton")
yes:Dock(LEFT)
yes:SetWide((areyousure:GetWide() * 0.5) - SScaleMin(5 / 3))
yes:SetText("Yes")
yes:SetFont("MenuFontNoClamp")
yes.Paint = function(self, w, h)
PaintButton(self, w, h)
end
yes.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
areyousure:Remove()
newspaper:Remove()
netstream.Start("RemoveStoredNewspaper", k)
end
local no = buttonpanel:Add("DButton")
no:Dock(RIGHT)
no:SetWide((areyousure:GetWide() * 0.5) - SScaleMin(5 / 3))
no:SetText("No")
no:SetFont("MenuFontNoClamp")
no.Paint = function(self, w, h)
PaintButton(self, w, h)
end
no.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
areyousure:Remove()
end
end
end
end
end
function PANEL:CreateDoorAccessButton()
self.doorAccess = self.innerContent:Add("DButton")
self.doorAccess:Dock(TOP)
self.doorAccess:SetTall(SScaleMin(50 / 3))
self.doorAccess:SetText("Combine Doors")
self.doorAccess:SetFont("WNBleedingMinutesBoldNoClamp")
self.doorAccess:SetContentAlignment(4)
self.doorAccess:SetTextInset(SScaleMin(10 / 3), 0)
self.doorAccess.Paint = function(self, w, h)
PaintButton(self, w, h)
end
self.doorAccess:DockMargin(0, -1, 0, 0)
self.doorAccess.DoClick = function()
self:CreateBackButton()
surface.PlaySound("helix/ui/press.wav")
self.innerContent:Clear()
for k, v in ipairs(ents.GetAll()) do
if (v:IsDoor()) then
if (!v:HasSpawnFlags(256) and !v:HasSpawnFlags(1024) and v:GetNetVar("combineDoor")) then
local name = v:GetNetVar("combineDoor")
if name then
local doorNameButton = self.innerContent:Add("DButton")
doorNameButton:Dock(TOP)
doorNameButton:SetText(name)
doorNameButton:SetTall(SScaleMin(50 / 3))
doorNameButton:SetFont("WNBleedingMinutesBoldNoClamp")
doorNameButton:SetContentAlignment(4)
doorNameButton:SetTextInset(padding, 0)
doorNameButton.Paint = function(self, w, h)
PaintButton(self, w, h)
end
doorNameButton.DoClick = function()
Derma_StringRequest(
"Grant Access",
"Enter CID",
"",
function(enteredCid)
for k2, v2 in pairs(ix.char.loaded) do
if v2:GetCid() == enteredCid then
netstream.Start("SetDoorAccessCID", v, k2)
break
end
end
end,
nil
)
end
end
end
end
end
end
end
function PANEL:CreateInner()
self.innerContent = self.content:Add("DScrollPanel")
self.innerContent:Dock(TOP)
self.innerContent:SetTall(self.content:GetTall() - SScaleMin(50 / 3))
self.barteringConfigs = self.innerContent:Add("DButton")
self.barteringConfigs:Dock(TOP)
self.barteringConfigs:SetTall(SScaleMin(50 / 3))
self.barteringConfigs:SetText("Bartering")
self.barteringConfigs:SetFont("WNBleedingMinutesBoldNoClamp")
self.barteringConfigs:SetContentAlignment(4)
self.barteringConfigs:SetTextInset(padding, 0)
self.barteringConfigs.Paint = function(self, w, h)
PaintButton(self, w, h)
end
self.barteringConfigs.DoClick = function()
self:CreateBackButton()
surface.PlaySound("helix/ui/press.wav")
self.innerContent:Clear()
local recipes = ix.recipe.stored
local categories = {}
for uniqueID, RECIPE in SortedPairs(recipes) do
if RECIPE.cost and RECIPE.skill == "bartering" then
if !table.HasValue(categories, RECIPE.category) then
table.insert(categories, RECIPE.category)
local priceMultiplier = self.innerContent:Add("DButton")
priceMultiplier:Dock(TOP)
priceMultiplier:SetText("Price Multiplier "..RECIPE.category)
priceMultiplier:SetTall(SScaleMin(50 / 3))
priceMultiplier:SetFont("WNBleedingMinutesBoldNoClamp")
priceMultiplier:SetContentAlignment(4)
priceMultiplier:SetTextInset(padding, 0)
priceMultiplier.Paint = function(self, w, h)
PaintButton(self, w, h)
end
priceMultiplier.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
Derma_StringRequest(
"Set Multiplier "..RECIPE.category,
"Price multiplier "..RECIPE.category.." (1 decimal max, default is 1.0)",
ix.config.Get("BarteringPriceMultiplier"..RECIPE.category),
function(number)
local toNumber = tonumber(number)
if isnumber(toNumber) then
local maxValue = ix.config.stored.BarteringPriceMultiplierClothing.data.data.max or 100
local minValue = ix.config.stored.BarteringPriceMultiplierClothing.data.data.min or 0
if (toNumber <= maxValue) and (toNumber >= minValue) then
netstream.Start("ixBarteringPriceMultiplier", RECIPE.category, tonumber(number))
LocalPlayer():NotifyLocalized("Set Bartering Price Multiplier "..RECIPE.category.." to "..number)
else
LocalPlayer():NotifyLocalized("Number needs to be below or equal to 100 and above or equal to 0")
end
end
end,
nil
)
end
end
end
end
end
self.ration = self.innerContent:Add("DButton")
self.ration:Dock(TOP)
self.ration:SetTall(SScaleMin(50 / 3))
self.ration:SetText("Rations")
self.ration:SetFont("WNBleedingMinutesBoldNoClamp")
self.ration:SetContentAlignment(4)
self.ration:SetTextInset(padding, 0)
self.ration.Paint = function(self, w, h)
PaintButton(self, w, h)
end
self.ration:DockMargin(0, -1, 0, 0)
self.ration.DoClick = function()
self:CreateBackButton()
surface.PlaySound("helix/ui/press.wav")
self.innerContent:Clear()
local rationInterval = self.innerContent:Add("DButton")
rationInterval:Dock(TOP)
rationInterval:SetTall(SScaleMin(50 / 3))
rationInterval:SetText("Ration Interval")
rationInterval:SetFont("WNBleedingMinutesBoldNoClamp")
rationInterval:SetContentAlignment(4)
rationInterval:SetTextInset(padding, 0)
rationInterval.Paint = function(self, w, h)
PaintButton(self, w, h)
end
rationInterval.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
Derma_StringRequest(
"Set Ration Interval",
"Set Ration Interval in hours (0 decimals, default is 4)",
ix.config.Get("rationInterval"),
function(number)
local toNumber = tonumber(number)
if isnumber(toNumber) then
local maxValue = ix.config.stored.rationInterval.data.data.max or 10
local minValue = ix.config.stored.rationInterval.data.data.min or 1
if (toNumber <= maxValue) and (toNumber >= minValue) then
netstream.Start("SetRationIntervalPDA", tonumber(number))
LocalPlayer():NotifyLocalized("Set Ration Interval timer to "..number.. " hours")
else
LocalPlayer():NotifyLocalized("Number needs to be below or equal to 10 and above or equal to 1")
end
end
end,
nil)
end
end
if istable(LocalPlayer().messagelist) then
if !table.IsEmpty(LocalPlayer().messagelist) then
self.messages = self.innerContent:Add("DButton")
self.messages:Dock(TOP)
self.messages:SetTall(SScaleMin(50 / 3))
self.messages:SetText("Messages")
self.messages:SetFont("WNBleedingMinutesBoldNoClamp")
self.messages:SetContentAlignment(4)
self.messages:SetTextInset(padding, 0)
self.messages.Paint = function(self, w, h)
PaintButton(self, w, h)
end
self.messages:DockMargin(0, -1, 0, 0)
self.messages.DoClick = function()
self:CreateBackButton()
surface.PlaySound("helix/ui/press.wav")
self.innerContent:Clear()
local messagePanel = self.innerContent:Add("Panel")
messagePanel:Dock(TOP)
messagePanel:SetTall(self.innerContent:GetTall())
for k, v in pairs(LocalPlayer().messagelist) do
local message = messagePanel:Add("DButton")
message:Dock(TOP)
message:SetTall(SScaleMin(50 / 3))
message:SetText(v["message_date"].." | "..string.utf8sub(v["message_poster"], 1, 18).." | #"..v["message_cid"])
if v["message_reply"] then
message:SetTextColor(Color(210, 255, 255, 255))
else
message:SetTextColor(Color(255, 205, 205, 255))
end
message:SetFont("WNBleedingMinutesBold")
message:SetContentAlignment(4)
message:SetTextInset(padding, 0)
message.Paint = function(self, w, h)
PaintButton(self, w, h)
end
if k != 1 then
message:DockMargin(0, -1, 0, 0)
end
message.DoClick = function()
messagePanel:Clear()
surface.PlaySound("helix/ui/press.wav")
local textEntry = messagePanel:Add("DTextEntry")
textEntry:Dock(FILL)
textEntry:SetTextColor(Color(200, 200, 200, 255))
textEntry:SetMultiline( true )
textEntry:SetEditable(false)
textEntry:SetVerticalScrollbarEnabled( true )
textEntry:SetCursorColor(Color(200, 200, 200, 255))
textEntry:SetValue(v["message_text"])
textEntry.Paint = function(self, w, h)
surface.SetDrawColor(Color(0, 0, 0, 100))
surface.DrawRect(0, 0, w, h)
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 30)))
surface.DrawOutlinedRect(0, 0, w, h)
self:DrawTextEntryText( self:GetTextColor(), self:GetHighlightColor(), self:GetCursorColor() )
end
local optionsPanel = messagePanel:Add("Panel")
optionsPanel:Dock(BOTTOM)
optionsPanel:SetSize(self.content:GetWide(), SScaleMin(50 / 3))
local remove = optionsPanel:Add("DButton")
remove:Dock(FILL)
remove:SetText("REMOVE")
remove:SetFont("WNBleedingMinutesBoldNoClamp")
remove:SetContentAlignment(5)
remove.Paint = function(self, w, h)
PaintButton(self, w, h)
end
remove.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
LocalPlayer().messagelist[k] = nil
netstream.Start("RemoveCAMessage", v["message_id"])
self.innerContent:Remove()
self:CreateInner()
end
local sendReply = optionsPanel:Add("DButton")
sendReply:Dock(RIGHT)
sendReply:SetWide(optionsPanel:GetWide() * 0.5)
if v["message_reply"] then
sendReply:SetText("READ REPLY")
else
sendReply:SetText("REPLY")
end
sendReply:SetFont("WNBleedingMinutesBold")
sendReply:SetContentAlignment(5)
sendReply.Paint = function(self, w, h)
PaintButton(self, w, h)
end
sendReply.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
if v["message_reply"] then
textEntry:SetValue(v["message_reply"])
return
end
textEntry:SetEditable(true)
sendReply:SetText("SEND REPLY")
textEntry:SetValue("Write your reply here..")
sendReply.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
v["message_reply"] = textEntry:GetValue()
netstream.Start("SetCAMessageReply", v["message_id"], textEntry:GetValue())
self.innerContent:Remove()
self:CreateInner()
end
end
end
end
end
end
end
self:CreateDoorAccessButton()
end
vgui.Register("ixCAPDA", PANEL, "EditablePanel")

View File

@@ -0,0 +1,224 @@
--[[
| 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 = {}
function PANEL:Init()
self:SetSize(ScrW(), ScrH())
self:SetAlpha(0)
self:AlphaTo(255, 0.5, 0)
self.Paint = function(this, w, h)
surface.SetDrawColor(Color(63, 58, 115, 220))
surface.DrawRect(0, 0, w, h)
Derma_DrawBackgroundBlur( this, 1 )
end
self.innerContent = self:Add("Panel")
self.innerContent:SetSize(SScaleMin(500 / 3), SScaleMin(600 / 3))
self.innerContent:Center()
self.innerContent:MakePopup()
Schema:AllowMessage(self.innerContent)
self.innerContent.Paint = function(this, w, h)
surface.SetDrawColor(0, 0, 0, 130)
surface.DrawRect(0, 0, w, h)
end
self:CreateTopBar()
self:CreateItems()
end
function PANEL:CreateTopBar()
local topbar = self.innerContent:Add("Panel")
topbar:SetSize(self.innerContent:GetWide(), SScaleMin(50 / 3))
topbar:Dock(TOP)
topbar.Paint = function( this, w, h )
surface.SetDrawColor(0, 0, 0, 130)
surface.DrawRect(0, 0, w, h)
end
self.titleText = topbar:Add("DLabel")
self.titleText:SetFont("CharCreationBoldTitleNoClamp")
self.titleText:Dock(LEFT)
self.titleText:SetText("Select item to dispense")
self.titleText:DockMargin(SScaleMin(10 / 3), 0, 0, 0)
self.titleText:SetContentAlignment(4)
self.titleText:SizeToContents()
self.exit = topbar:Add("DImageButton")
self.exit:SetImage("willardnetworks/tabmenu/navicons/exit.png")
self.exit:SetSize(SScaleMin(20 / 3), SScaleMin(20 / 3))
self.exit:DockMargin(0, SScaleMin(15 / 3), SScaleMin(10 / 3), SScaleMin(15 / 3))
self.exit:Dock(RIGHT)
self.exit.DoClick = function()
netstream.Start("ClosePanels", LocalPlayer().activePickupDispenser)
LocalPlayer().activePickupDispenser = nil
LocalPlayer().boughtItems = nil
self:Remove()
surface.PlaySound("helix/ui/press.wav")
end
local function createDivider(parent)
parent:SetSize(1, topbar:GetTall())
parent:Dock(RIGHT)
parent:DockMargin(0, SScaleMin(10 / 3), SScaleMin(SScaleMin(10 / 3) / 3), SScaleMin(10 / 3))
parent.Paint = function(this, w, h)
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 30)))
surface.DrawLine(0, 0, 0, h)
end
end
local divider = topbar:Add("Panel")
createDivider(divider)
end
function PANEL:CreateItems()
if !LocalPlayer().boughtItems then
return
end
local scrollPanel = self.innerContent:Add("DScrollPanel")
scrollPanel:Dock(TOP)
scrollPanel:SetSize(self.innerContent:GetWide(), self.innerContent:GetTall() - SScaleMin(50 / 3))
for k, v in pairs (LocalPlayer().boughtItems) do
local character = LocalPlayer():GetCharacter()
local inventory = character:GetInventory()
local width = istable(v) and 1 or ix.item.list[k].width or 1
local height = istable(v) and 1 or ix.item.list[k].height or 1
local frame, modelPanel, textPanel, amountPanel, amount, title = self:CreateItem(scrollPanel, k, v)
local actualAmount = istable(v) and 1 or v or 1
local actualTitle = istable(v) and v.title or ix.item.list[k].name or "Cardboard Box"
if !inventory:FindEmptySlot(width, height) then
amount:SetTextColor(Color(150, 150, 150, 255))
title:SetTextColor(Color(150, 150, 150, 255))
end
self:CreateInvisibleButton(frame, modelPanel, textPanel, amountPanel, inventory, width, height, actualAmount, actualTitle, amount, k)
end
end
function PANEL:CreateInvisibleButton(frame, modelPanel, textPanel, amountPanel, inventory, width, height, actualAmount, actualTitle, amount, k)
local invisibleButton = frame:Add("DButton")
invisibleButton:SetSize(modelPanel:GetWide() + textPanel:GetWide() + amountPanel:GetWide(), frame:GetTall())
invisibleButton:SetText("")
invisibleButton.Paint = function(this, w, h)
if inventory then
if (this:IsHovered() and !inventory:FindEmptySlot(width, height)) then
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 15)))
surface.DrawOutlinedRect(SScaleMin(4 / 3), SScaleMin(4 / 3), w - SScaleMin(8 / 3), h - SScaleMin(8 / 3))
end
return
end
if (this:IsHovered()) then
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 15)))
surface.DrawOutlinedRect(SScaleMin(4 / 3), SScaleMin(4 / 3), w - SScaleMin(8 / 3), h - SScaleMin(8 / 3))
end
end
invisibleButton.DoClick = function()
if inventory then
if inventory:FindEmptySlot(width, height) then
actualAmount = actualAmount - 1
amount:SetText(actualAmount)
if actualAmount == 0 then
frame:Remove()
end
LocalPlayer():NotifyLocalized("You have picked up a "..actualTitle)
surface.PlaySound("helix/ui/press.wav")
netstream.Start("SetPurchasedItems", k, LocalPlayer().activePickupDispenser)
else
LocalPlayer():NotifyLocalized("You do not have enough space for "..actualTitle.."!")
end
end
end
return invisibleButton
end
function PANEL:CreateItem(scrollPanel, itemID, number)
local frame = scrollPanel:Add("Panel")
frame:Dock(TOP)
frame:DockMargin(0, 0, 0, -1)
frame:SetTall(SScaleMin(110 / 3) - 5)
frame.Paint = function(this, w, h)
surface.SetDrawColor(Color(0, 0, 0, 100))
surface.DrawRect(0, 0, w, h)
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 30)))
surface.DrawOutlinedRect(0, 0, w, h)
end
local modelPanel = frame:Add("Panel")
modelPanel:Dock(LEFT)
modelPanel:SetWide(scrollPanel:GetWide() / 3)
modelPanel.Paint = function(this, w, h)
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 30)))
surface.DrawLine(w - 1, SScaleMin(10 / 3), w - 1, h - SScaleMin(10 / 3))
end
local modelIcon = modelPanel:Add("SpawnIcon")
local model = istable(number) and "models/props_c17/paper01.mdl" or ix.item.list[itemID].model or "models/props_junk/cardboard_box004a.mdl"
modelIcon:Dock(FILL)
modelIcon:DockMargin(SScaleMin(43 / 3), SScaleMin(10 / 3), SScaleMin(43 / 3), SScaleMin(10 / 3))
modelIcon:SetModel(model)
modelIcon.Paint = nil
modelIcon.PaintOver = nil
modelIcon:SetTooltip(nil)
local textPanel = frame:Add("Panel")
textPanel:Dock(LEFT)
textPanel:DockPadding(SScaleMin(10 / 3), 0, SScaleMin(10 / 3), 0)
textPanel:SetSize(scrollPanel:GetWide() / 2, frame:GetTall())
textPanel.Paint = function(this, w, h)
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 30)))
surface.DrawLine(w - 1, SScaleMin(10 / 3), w - 1, h - SScaleMin(10 / 3))
end
local title = textPanel:Add("DLabel")
local actualTitle = istable(number) and number.title or ix.item.list[itemID].name or "Cardboard Box"
title:Dock(TOP)
title:SetText(actualTitle..(istable(number) and " - FROM: "..number.fromName.." | "..number.fromCID or ""))
title:SetFont(istable(number) and "MenuFontBoldNoClamp" or "WNBleedingMinutesBoldNoClamp")
title:SetWrap(true)
title:SetAutoStretchVertical(true)
title.PerformLayout = function(this)
this:DockMargin(0, textPanel:GetTall() * 0.5 - this:GetTall() * 0.5, 0, textPanel:GetTall() * 0.5 - this:GetTall() * 0.5)
end
local amountPanel = frame:Add("Panel")
amountPanel:Dock(FILL)
amountPanel:SetSize(scrollPanel:GetWide() - modelPanel:GetWide() - textPanel:GetWide(), frame:GetTall())
if LocalPlayer().boughtItems and istable(LocalPlayer().boughtItems) then
if table.Count(LocalPlayer().boughtItems) >= 6 then
amountPanel:SetWide(amountPanel:GetWide() - SScaleMin(15 / 3))
end
end
local amount = amountPanel:Add("DLabel")
local actualAmount = istable(number) and 1 or number or 1
amount:SetContentAlignment(5)
amount:SetText(actualAmount)
amount:SetFont("WNBleedingMinutesBoldNoClamp")
amount:SizeToContents()
amount:Center()
return frame, modelPanel, textPanel, amountPanel, amount, title
end
vgui.Register("PickupDispenser", PANEL, "EditablePanel")

View File

@@ -0,0 +1,63 @@
--[[
| 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 vgui = vgui
local PANEL = {}
function PANEL:Init()
local parent = self:GetParent():GetParent()
self:SetSize(parent.contentPanel:GetSize())
-- Config
self.firstTitle = "Shipments"
self.secondTitle = "Purchase"
self.thirdTitle = "Preview"
self.nothingSelected = "No item selected"
self.requirementsTitleText = "Requirements: "
self.skill = "bartering"
self.built = false
ix.city:SyncCityStock()
end
function PANEL:Proceed()
self.built = true
-- Create titles
self:Add("CraftingBaseTopTitleBase")
-- Create inner content
self:Add("CraftingBaseInnerContent")
-- Rebuild inner content
self:Add("CraftingBaseRebuild")
end
function PANEL:Remove()
if (self.model) then
self.model:Remove()
end
end
vgui.Register("BarteringBasePanel", PANEL, "EditablePanel")
local function CreateBarteringPanel(container)
local panel = container:Add("BarteringBasePanel")
ix.gui.barteringpanel = panel
ix.gui.activeSkill = panel
return container
end
hook.Add("CreateSkillPanels", "BarteringBasePanel", function(tabs)
tabs[ix.skill.list["bartering"].uniqueID] = CreateBarteringPanel
end)

View File

@@ -0,0 +1,58 @@
--[[
| 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 vgui = vgui
local PANEL = {}
function PANEL:Init()
local parent = self:GetParent():GetParent()
self:SetSize(parent.contentPanel:GetSize())
-- Config
self.firstTitle = "Recipes"
self.secondTitle = "Cook"
self.thirdTitle = "Preview"
self.nothingSelected = "No item selected"
self.requirementsTitleText = "Requirements: "
self.ingredientsTitleText = "Ingredients:"
self.skill = "cooking"
self.craftSound = "willardnetworks/skills/skill_cooking.wav"
-- Create titles
self:Add("CraftingBaseTopTitleBase")
-- Create inner content
self:Add("CraftingBaseInnerContent")
-- Rebuild inner content
self:Add("CraftingBaseRebuild")
end
function PANEL:Remove()
if (self.model) then
self.model:Remove()
end
end
vgui.Register("CookingBasePanel", PANEL, "EditablePanel")
local function CreateCookingPanel(container)
local panel = container:Add("CookingBasePanel")
ix.gui.cookingpanel = panel
ix.gui.activeSkill = panel
return container
end
hook.Add("CreateSkillPanels", "CookingBasePanel", function(tabs)
tabs[ix.skill.list["cooking"].uniqueID] = CreateCookingPanel
end)

View File

@@ -0,0 +1,102 @@
--[[
| 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 vgui = vgui
local PANEL = {}
function PANEL:Init()
local parent = self:GetParent():GetParent()
if parent then
if parent.contentPanel then
self:SetSize(parent.contentPanel:GetSize())
else
self:SetSize(ScrW() * 0.75, ScrH() * 0.70)
end
else
self:SetSize(ScrW() * 0.75, ScrH() * 0.70)
end
-- Config
self.firstTitle = "Recipes"
self.secondTitle = "Crafting"
self.thirdTitle = "Preview"
self.nothingSelected = "No item/recipe selected"
self.requirementsTitleText = "Requirements: "
self.ingredientsTitleText = "Ingredients:"
self.skill = "crafting"
self.craftSound = "willardnetworks/skills/skill_crafting.wav"
-- Create titles
self:Add("CraftingBaseTopTitleBase")
-- Create inner content
self:Add("CraftingBaseInnerContent")
-- Rebuild inner content
self:Add("CraftingBaseRebuild")
end
function PANEL:Remove()
if (self.model) then
self.model:Remove()
end
end
vgui.Register("CraftingBasePanel", PANEL, "EditablePanel")
local function CreateCraftingPanel(container)
local panel = container:Add("CraftingBasePanel")
ix.gui.craftingpanel = panel
ix.gui.activeSkill = panel
return container
end
hook.Add("CreateSkillPanels", "CraftingBasePanel", function(tabs)
tabs[ix.skill.list["crafting"].uniqueID] = CreateCraftingPanel
end)
netstream.Hook("OpenCraftingMenu", function()
if ix.gui.craftingpanel then
if ix.gui.craftingpanel.Remove then
ix.gui.craftingpanel:Remove()
end
end
local parentPanel = vgui.Create("Panel")
parentPanel:SetSize(ScrW(), ScrH())
parentPanel:SetAlpha(0)
parentPanel:AlphaTo(200, 0.5, 0)
parentPanel.Paint = function(self, w, h)
surface.SetDrawColor(0, 0, 0, 255)
surface.DrawRect(0, 0, w, h)
end
local craftingPanel = parentPanel:Add("CraftingBasePanel")
craftingPanel:MakePopup()
craftingPanel:Center()
local close = craftingPanel:Add("DButton")
close:Dock(BOTTOM)
close:SetFont("TitlesFont")
close:SetText("CLOSE CRAFTING")
close:DockMargin(((craftingPanel:GetWide() + 20) / 1.5), 0, 2, 0)
close:SetTall(math.Clamp(ScreenScale(50 / 3), 0, 50))
close.DoClick = function()
parentPanel:AlphaTo(0, 0.5, 0, function()
parentPanel:Remove()
end)
end
ix.gui.craftingpanel = craftingPanel
ix.gui.activeSkill = craftingPanel
end)

View File

@@ -0,0 +1,44 @@
--[[
| 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 = {}
function PANEL:Init()
local parent = self:GetParent():GetParent()
self:SetSize(parent.contentPanel:GetSize())
-- Config
self.firstTitle = "Level Unlocks"
self.skill = "guns"
-- Create titles
self:Add("CraftingBaseTopTitleBase")
-- Create inner content
self:Add("CraftingBaseInnerContent")
-- Rebuild inner content
self:Add("CraftingBaseRebuild")
end
vgui.Register("GunsBasePanel", PANEL, "EditablePanel")
local function CreateGunsPanel(container)
local panel = container:Add("GunsBasePanel")
ix.gui.gunspanel = panel
ix.gui.activeSkill = panel
return container
end
hook.Add("CreateSkillPanels", "GunsBasePanel", function(tabs)
tabs[ix.skill.list["guns"].uniqueID] = CreateGunsPanel
end)

View File

@@ -0,0 +1,58 @@
--[[
| 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 vgui = vgui
local PANEL = {}
function PANEL:Init()
local parent = self:GetParent():GetParent()
self:SetSize(parent.contentPanel:GetSize())
-- Config
self.firstTitle = "Recipes"
self.secondTitle = "Create"
self.thirdTitle = "Preview"
self.nothingSelected = "No item/recipe selected"
self.requirementsTitleText = "Requirements: "
self.ingredientsTitleText = "Ingredients:"
self.skill = "medicine"
self.craftSound = "willardnetworks/skills/skill_medicine.wav"
-- Create titles
self:Add("CraftingBaseTopTitleBase")
-- Create inner content
self:Add("CraftingBaseInnerContent")
-- Rebuild inner content
self:Add("CraftingBaseRebuild")
end
function PANEL:Remove()
if (self.model) then
self.model:Remove()
end
end
vgui.Register("MedicalBasePanel", PANEL, "EditablePanel")
local function CreateMedicalPanel(container)
local panel = container:Add("MedicalBasePanel")
ix.gui.medicalpanel = panel
ix.gui.activeSkill = panel
return container
end
hook.Add("CreateSkillPanels", "MedicalBasePanel", function(tabs)
tabs[ix.skill.list["medicine"].uniqueID] = CreateMedicalPanel
end)

View File

@@ -0,0 +1,44 @@
--[[
| 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 = {}
function PANEL:Init()
local parent = self:GetParent():GetParent()
self:SetSize(parent.contentPanel:GetSize())
-- Config
self.firstTitle = "Level Unlocks"
self.skill = "melee"
-- Create titles
self:Add("CraftingBaseTopTitleBase")
-- Create inner content
self:Add("CraftingBaseInnerContent")
-- Rebuild inner content
self:Add("CraftingBaseRebuild")
end
vgui.Register("MeleeBasePanel", PANEL, "EditablePanel")
local function CreateMeleePanel(container)
local panel = container:Add("MeleeBasePanel")
ix.gui.gunspanel = panel
ix.gui.activeSkill = panel
return container
end
hook.Add("CreateSkillPanels", "MeleeBasePanel", function(tabs)
tabs[ix.skill.list["melee"].uniqueID] = CreateMeleePanel
end)

View File

@@ -0,0 +1,56 @@
--[[
| 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 vgui = vgui
local PANEL = {}
function PANEL:Init()
local parent = self:GetParent():GetParent()
self:SetSize(parent.contentPanel:GetSize())
-- Config
self.firstTitle = "Items"
self.secondTitle = "Info"
self.thirdTitle = "Preview"
self.nothingSelected = "No item selected"
self.requirementsTitleText = "Requirements: "
self.skill = "smuggling"
-- Create titles
self:Add("CraftingBaseTopTitleBase")
-- Create inner content
self:Add("CraftingBaseInnerContent")
-- Rebuild inner content
self:Add("CraftingBaseRebuild")
end
function PANEL:Remove()
if (self.model) then
self.model:Remove()
end
end
vgui.Register("SmugglingBasePanel", PANEL, "EditablePanel")
local function CreateSmugglingPanel(container)
local panel = container:Add("SmugglingBasePanel")
ix.gui.smugglingpanel = panel
ix.gui.activeSkill = panel
return container
end
hook.Add("CreateSkillPanels", "SmugglingBasePanel", function(tabs)
tabs[ix.skill.list["smuggling"].uniqueID] = CreateSmugglingPanel
end)

View File

@@ -0,0 +1,44 @@
--[[
| 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 = {}
function PANEL:Init()
local parent = self:GetParent():GetParent()
self:SetSize(parent.contentPanel:GetSize())
-- Config
self.firstTitle = "Level Unlocks"
self.skill = "speed"
-- Create titles
self:Add("CraftingBaseTopTitleBase")
-- Create inner content
self:Add("CraftingBaseInnerContent")
-- Rebuild inner content
self:Add("CraftingBaseRebuild")
end
vgui.Register("SpeedBasePanel", PANEL, "EditablePanel")
local function CreateSpeedPanel(container)
local panel = container:Add("SpeedBasePanel")
ix.gui.speedpanel = panel
ix.gui.activeSkill = panel
return container
end
hook.Add("CreateSkillPanels", "SpeedBasePanel", function(tabs)
tabs[ix.skill.list["speed"].uniqueID] = CreateSpeedPanel
end)

View File

@@ -0,0 +1,722 @@
--[[
| 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
local titlePushDown = SScaleMin(85 / 3)
local fixHeight = SScaleMin(55 / 3)
local scale780 = SScaleMin(780 / 3)
local scale120 = SScaleMin(120 / 3)
function PANEL:Init()
ix.gui.skills = self
local margin = SScaleMin(10 / 3)
local topPushDown = SScaleMin(150 / 3)
self:SetWide(ScrW() - (topPushDown * 2))
local sizeXtitle, sizeYtitle = self:GetWide(), scale120
local sizeXcontent, sizeYcontent = self:GetWide(), (scale780) - fixHeight
self.titlePanel = self:Add("Panel")
self.titlePanel:SetSize(sizeXtitle, sizeYtitle)
self.titlePanel:SetPos(self:GetWide() * 0.5 - self.titlePanel:GetWide() * 0.5)
self.contentPanel = self:Add("Panel")
self.contentPanel:SetSize(sizeXcontent, sizeYcontent)
self.contentPanel:SetPos(self:GetWide() * 0.5 - self.contentPanel:GetWide() * 0.5, titlePushDown)
self:SetTall(scale120 + scale780 - fixHeight + titlePushDown)
self:Center()
local skillsIcon = self.titlePanel:Add("DImage")
skillsIcon:SetImage("willardnetworks/tabmenu/navicons/crafting.png")
skillsIcon:SetSize(SScaleMin(18 / 3), SScaleMin(18 / 3))
skillsIcon:SetPos(0, SScaleMin(3 / 3))
local skillsTitle = self.titlePanel:Add("DLabel")
skillsTitle:SetFont("TitlesFontNoClamp")
skillsTitle:SetText(LocalPlayer():Name() .. "'s Skills")
skillsTitle:SetPos(SScaleMin(26 / 3))
skillsTitle:SizeToContents()
local skillsDesc = self.titlePanel:Add("DLabel")
skillsDesc:SetFont("MenuFontLargerNoClamp")
skillsDesc:SetText("Remember that the maximum combined skill level is " .. ix.config.Get("MaxTotalSkill", 0) .. ".")
skillsDesc:SetTextColor(Color(200, 200, 200, 255))
skillsDesc:SetPos(0, SScaleMin(25 / 3) + margin * 0.7)
skillsDesc:SizeToContents()
local skillsDesc2 = self.titlePanel:Add("DLabel")
skillsDesc2:SetFont("MenuFontLargerBoldNoFix")
skillsDesc2:SetTextColor(Color(255, 78, 69, 255))
skillsDesc2:SetText("Skill levels: " .. LocalPlayer():GetCharacter():GetTotalSkillLevel() .. "/" .. ix.config.Get("MaxTotalSkill", 0))
skillsDesc2:SetPos(0, SScaleMin(42 / 3) + margin * 0.7)
skillsDesc2:SizeToContents()
self:CreateAttributesPanel()
self.panels = {}
hook.Run("CreateSkillPanels", self.panels) -- Create subpanels for example Crafting
self:CreateSkills()
end
function PANEL:CreateSkills()
if (self.skillPanels) then
for _, v in ipairs(self.skillPanels) do
v:Remove()
end
end
self.skillPanels = {}
local character = LocalPlayer():GetCharacter()
self.skillGrid = self.contentPanel:Add("DGrid")
self.skillGrid:Dock(FILL)
self.skillGrid:SetCols( 3 )
self.skillGrid:SetColWide( self.contentPanel:GetWide() / 3 )
self.skillGrid:SetRowHeight( self.contentPanel:GetTall() / 3 )
for skillID, skillInfo in SortedPairs(ix.skill.list) do
if character:GetFaction() != FACTION_VORT and skillInfo.name == "Vortessence" then
continue
end
self.skillPanels[skillID] = self:CreateSkillPanel(skillID, skillInfo)
end
end
function PANEL:CreateSkillPanel(skillID, skillInfo)
local bottomPanelH = SScaleMin(35 / 3)
local character = LocalPlayer():GetCharacter()
local skillPanel = vgui.Create("Panel")
skillPanel:SetSize((self.contentPanel:GetWide() / 3) - SScaleMin(10 / 3), (self.contentPanel:GetTall() / 3) - SScaleMin(10 / 3))
skillPanel:Center()
skillPanel.Paint = function(_, w, h)
surface.SetDrawColor(color_white)
surface.SetMaterial(ix.util.GetMaterial(skillInfo.image))
surface.DrawTexturedRect(0, 0, w, h - bottomPanelH)
surface.SetDrawColor(ColorAlpha(color_black, 100))
surface.DrawRect(0, h - bottomPanelH, w, bottomPanelH)
surface.SetDrawColor(Color(116, 113, 130, 255))
surface.DrawOutlinedRect(0, 0, w, h)
surface.DrawLine(0, h - bottomPanelH, w, h - bottomPanelH)
end
-- Bottom Panel
local dPadding = SScaleMin(5 / 3)
local bottomPanel = skillPanel:Add("Panel")
bottomPanel:Dock(BOTTOM)
bottomPanel:SetTall(bottomPanelH)
local skillName = bottomPanel:Add("DLabel")
self:CreateSkillLabel(skillName, skillInfo.name, "TitlesFontNoClamp", dPadding * 4, dPadding * 2)
skillPanel.skillLevel = bottomPanel:Add("DLabel")
self:CreateSkillLabel(skillPanel.skillLevel, "Skill Level: " .. character:GetSkillLevel(skillID) .. "/" .. ix.skill.MAX_SKILL, "MenuFontLargerNoClamp", 0, 0, Color(255, 204, 0, 255))
local experiencePanel = bottomPanel:Add("Panel")
experiencePanel:Dock(RIGHT)
experiencePanel:SetWide(SScaleMin(200 / 3))
experiencePanel:DockMargin(dPadding * 2, dPadding, dPadding * 4, dPadding)
experiencePanel:DockPadding(dPadding, dPadding, dPadding, dPadding)
experiencePanel.Paint = function(_, w, h)
surface.SetDrawColor(ColorAlpha(color_black, 100))
surface.DrawRect(0, 0, w, h)
surface.SetDrawColor(Color(116, 113, 130, 255))
surface.DrawOutlinedRect(0, 0, w, h)
end
local skillProgress = math.Clamp(character:GetSkillStoredExp(skillID) / 1000, 0, 1)
skillPanel.progressBar = experiencePanel:Add("Panel")
skillPanel.progressBar:Dock(FILL)
skillPanel.progressBar.progress = skillProgress
skillPanel.progressBar.Paint = function(panel, w, h)
surface.SetDrawColor(Color(255, 78, 70, 255))
surface.DrawRect(0, 0, w * panel.progress, h)
end
skillPanel.processLabel = skillPanel.progressBar:Add("DLabel")
skillPanel.processLabel.skillID = skillID
skillPanel.processLabel.SetupText = function(panel, char)
if (char:GetSkill(skillID) == ix.skill.MAX_SKILL) then
panel:SetText("MAX LEVEL")
elseif (char:GetTotalSkillLevel() == ix.config.Get("MaxTotalSkill")) then
panel:SetText("MAX TOTAL LEVEL")
elseif (char:CanLevelSkill(panel.skillID)) then
panel:SetText("LEVEL UP")
else
local skillProg = math.Clamp(character:GetSkillStoredExp(panel.skillID) / 1000, 0, 1)
panel:SetText((skillProg * 100) .. "%")
end
end
skillPanel.processLabel:SetupText(character)
skillPanel.processLabel:SetFont("MenuFontLargerNoClamp")
skillPanel.processLabel:SetContentAlignment(5)
skillPanel.processLabel:Dock(FILL)
local levelUp = skillPanel.progressBar:Add("DButton")
levelUp:Dock(FILL)
levelUp:SetText("")
levelUp.Paint = nil
levelUp.DoClick = function()
if character:CanLevelSkill(skillID) then
surface.PlaySound("helix/ui/press.wav")
net.Start("ixSkillLevelUp")
net.WriteString(skillID)
net.SendToServer()
end
end
local imagePanel = skillPanel:Add("Panel")
imagePanel:Dock(FILL)
local boostPanel = imagePanel:Add("Panel")
boostPanel:SetSize(skillPanel:GetWide(), skillPanel:GetTall() - bottomPanelH)
boostPanel:DockPadding(dPadding * 4, dPadding * 3, dPadding * 4, dPadding * 4)
boostPanel.Paint = self.CoolHover
local skillButton = imagePanel:Add("DButton")
skillButton:Dock(FILL)
skillButton:SetText("")
skillButton:DockPadding(dPadding * 4, dPadding * 4, dPadding * 4, dPadding * 4)
skillButton.Paint = nil
skillButton.OnCursorEntered = function()
surface.PlaySound("helix/ui/rollover.wav")
boostPanel.Paint = nil
end
skillButton.OnCursorExited = function()
boostPanel.Paint = self.CoolHover
end
skillButton.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
self:OpenSkillPanel(skillInfo)
end
self:CreateBoostInfo(boostPanel, skillInfo)
self:CheckForCurrent(skillInfo)
local autoLevel = skillButton:Add("DButton")
skillPanel.autoLevel = autoLevel
autoLevel.autoLevel = character:GetSkillAutoLevel(skillID)
autoLevel:Dock(BOTTOM)
autoLevel:SetTall(SScaleMin(20 / 3))
autoLevel:SetContentAlignment(4)
autoLevel:SetText("Auto-Level")
autoLevel:SetFont("MenuFontBoldNoClamp")
autoLevel:SetTextInset(SScaleMin(30 / 3), 0)
autoLevel:DockMargin(0, 0, skillPanel:GetWide() * 0.63, 0)
autoLevel.Paint = function(panel, w, h)
surface.SetDrawColor(color_white)
surface.DrawOutlinedRect(0, 0, SScaleMin(20 / 3), h)
if panel.autoLevel then
surface.SetMaterial(ix.util.GetMaterial("willardnetworks/tabmenu/skills_v2/tick.png"))
surface.DrawTexturedRect(SScaleMin(20 / 3) * 0.5 - SScaleMin(15 / 3) * 0.5, SScaleMin(20 / 3) * 0.5 - SScaleMin(10 / 3) * 0.5, SScaleMin(15 / 3), SScaleMin(11 / 3))
end
end
autoLevel.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
net.Start("ixSkillSetAutoLevel")
net.WriteString(skillID)
net.SendToServer()
autoLevel.autoLevel = !autoLevel.autoLevel
end
if skillInfo.name == "Bartering" then
experiencePanel:SetVisible(false)
skillPanel.skillLevel:SetText("You have " .. (istable(character:GetPermits()) and table.Count(character:GetPermits()) or "0") .. " permits active")
skillPanel.skillLevel:SizeToContents()
autoLevel:SetVisible(false)
end
self.skillGrid:AddItem( skillPanel )
return skillPanel
end
function PANEL:OpenSkillPanel(skill)
surface.PlaySound("helix/ui/press.wav")
if self.panels[skill.uniqueID] then
if (self.contentPanel) then
self.contentPanelOriginX, self.contentPanelOriginY = self.contentPanel:GetPos()
self.contentPanel:MoveTo(ScrW(), self.contentPanelOriginY, 1, 0)
end
for k, v in pairs(self.panels) do
if k == skill.uniqueID then
self:CreateNewContent(v, skill.uniqueID)
end
end
end
end
function PANEL:CheckForCurrent(skill)
if self.panels[skill.uniqueID] then
if self.contentPanel then
if LocalPlayer().lastSelectedSkill then
if LocalPlayer().lastSelectedSkill == skill.uniqueID then
self.contentPanelOriginX, self.contentPanelOriginY = self.contentPanel:GetPos()
self.contentPanel:SetPos(ScrW(), self.contentPanelOriginY)
for k, v in pairs(self.panels) do
if k == skill.uniqueID then
self:CreateNewContent(v, skill.uniqueID)
end
end
end
end
end
end
end
function PANEL.CoolHover(self, w, h)
surface.SetDrawColor(Color(0, 0, 0, 150))
surface.DrawRect(0, 0, w, h)
end
function PANEL:CreateBoostInfo(boostPanel, skill)
local character = LocalPlayer():GetCharacter()
local attributes = ix.special.list or {}
local skillAttributes = {}
-- Find the attributes that boost the skill
for _, v in pairs(attributes) do
if v.skills then
if v.skills[skill.uniqueID] then
skillAttributes[v.skills[skill.uniqueID]] = v
end
end
end
if skillAttributes[2] then
local boostedByLabel = boostPanel:Add("DLabel")
boostedByLabel:SetText("Major boost from " .. skillAttributes[2].name)
boostedByLabel:SetFont("MenuFontBoldNoClamp")
boostedByLabel:SetContentAlignment(4)
boostedByLabel:SizeToContents()
boostedByLabel:Dock(TOP)
end
if skillAttributes[1] then
local boostedByLabel = boostPanel:Add("DLabel")
boostedByLabel:SetText("Minor boost from " .. skillAttributes[1].name)
boostedByLabel:SetFont("MenuFontBoldNoClamp")
boostedByLabel:SetContentAlignment(4)
boostedByLabel:SizeToContents()
boostedByLabel:Dock(TOP)
end
local varBoostLevel = character:GetSkillBoostLevels(skill.uniqueID)
local varNeedsLevel, reducedHunger, reducedThirst, reducedGas, reducedHealth = character:GetSkillNeedsReducing(skill.uniqueID)
if (varBoostLevel > 0) then
-- ATLE HAPPY
local boostedLevels = boostPanel:Add("DLabel")
boostedLevels:Dock(TOP)
boostedLevels:SetContentAlignment(4)
boostedLevels:SetFont("MenuFontLargerBoldNoFix")
boostedLevels:SetTextColor(Color(75, 238, 75))
boostedLevels:SetText("Boosted Levels: +" .. varBoostLevel)
boostedLevels:SizeToContents()
end
if (varNeedsLevel > 0) then
if (reducedHunger) then
local hungerReducing = boostPanel:Add("DLabel")
hungerReducing:Dock(TOP)
hungerReducing:SetContentAlignment(4)
hungerReducing:SetFont("MenuFontLargerBoldNoFix")
hungerReducing:SetTextColor(Color(238, 75, 75))
hungerReducing:SetText("-" .. math.Round(reducedHunger, 1) .. " levels due to Hunger")
hungerReducing:SizeToContents()
end
if (reducedThirst) then
local thirstReducing = boostPanel:Add("DLabel")
thirstReducing:Dock(TOP)
thirstReducing:SetContentAlignment(4)
thirstReducing:SetFont("MenuFontLargerBoldNoFix")
thirstReducing:SetTextColor(Color(238, 75, 75))
thirstReducing:SetText("-" .. math.Round(reducedThirst, 1) .. " levels due to Thirst")
thirstReducing:SizeToContents()
end
if (reducedGas) then
local gasReducing = boostPanel:Add("DLabel")
gasReducing:Dock(TOP)
gasReducing:SetContentAlignment(4)
gasReducing:SetFont("MenuFontLargerBoldNoFix")
gasReducing:SetTextColor(Color(238, 75, 75))
gasReducing:SetText("-" .. math.Round(reducedGas, 1) .. " levels due to Spores")
gasReducing:SizeToContents()
end
if (reducedHealth) then
local healthReducing = boostPanel:Add("DLabel")
healthReducing:Dock(TOP)
healthReducing:SetContentAlignment(4)
healthReducing:SetFont("MenuFontLargerBoldNoFix")
healthReducing:SetTextColor(Color(238, 75, 75))
healthReducing:SetText("-" .. math.Round(reducedHealth, 1) .. " levels due to Injuries")
healthReducing:SizeToContents()
end
local needsReducing = boostPanel:Add("DLabel")
needsReducing:Dock(TOP)
needsReducing:SetContentAlignment(4)
needsReducing:SetFont("MenuFontLargerBoldNoFix")
needsReducing:SetTextColor(Color(238, 75, 75))
needsReducing:SetText("Total Reduced Levels: -" .. varNeedsLevel)
needsReducing:SizeToContents()
end
end
function PANEL:CreateSkillLabel(parent, text, font, leftMargin, rightMargin, color)
parent:Dock(LEFT)
parent:SetFont(font)
parent:SetText(text or "")
parent:SetContentAlignment(4)
parent:DockMargin(leftMargin, 0, rightMargin, 0)
parent:SizeToContents()
parent:SetTextColor(color or color_white)
end
function PANEL:CreateNewContent(v, name)
local newContent = self:Add("Panel")
newContent:SetSize(self.contentPanel:GetSize())
newContent:SetPos(self:GetWide() * 0.5 - self.contentPanel:GetWide() * 0.5, titlePushDown)
local x, y = newContent:GetPos()
if !LocalPlayer().lastSelectedSkill then
newContent:SetPos(0 - ScrW(), y)
newContent:MoveTo(x, y, 1, 0)
else
newContent:SetPos(x, y)
end
LocalPlayer().lastSelectedSkill = name
if self.chosenSkillPanel then
self.chosenSkillPanel:Remove()
end
if self.backButton then
self.backButton:Remove()
end
self.chosenSkillPanel = v(newContent)
self.attributesButton:SetVisible(false)
self.backButton = self.titlePanel:Add("DButton")
self.backButton:Dock(RIGHT)
self.backButton:SetText("Return to skills menu")
self.backButton:SetFont("TitlesFontNoClamp")
self.backButton:SetContentAlignment(6)
self.backButton:SetAlpha(0)
self.backButton:AlphaTo(255, 1, 0)
self.backButton:SizeToContents()
self.backButton:DockMargin(0, self.titlePanel:GetTall() * 0.3 - self.backButton:GetTall(), 0, self.titlePanel:GetTall() * 0.5 - self.backButton:GetTall() * 0.5)
self.backButton.Paint = function(_, w, h) end
self.backButton.OnCursorEntered = function()
self.backButton:SetTextColor(Color(200, 200, 200, 255))
surface.PlaySound("willardnetworks/charactercreation/hover.wav")
end
self.backButton.OnCursorExited = function()
self.backButton:SetTextColor(Color(255, 255, 255, 255))
end
self.backButton.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
self.backButton:AlphaTo(0, 1, 0, function()
self.attributesButton:SetVisible(true)
self.attributesButton:SetAlpha(0)
self.attributesButton:AlphaTo(255, 0.5, 0)
end)
newContent:MoveTo(0 - ScrW(), y, 1, 0)
self.contentPanel:MoveTo(self:GetWide() * 0.5 - self.contentPanel:GetWide() * 0.5, self.contentPanelOriginY, 1, 0)
LocalPlayer().lastSelectedSkill = nil
end
end
function PANEL:CreateAttributesPanel()
self.attributesButton = self.titlePanel:Add("DButton")
self.attributesButton:Dock(RIGHT)
self.attributesButton:DockMargin(0, SScaleMin(25 / 3), 0, SScaleMin(63 / 3))
self.attributesButton:SetText("Attribute Boosts")
self.attributesButton:SetFont("MenuFontBoldNoClamp")
self.attributesButton:SetWide(SScaleMin(170 / 3))
self.attributesButton.Paint = function(_, w, h)
surface.SetDrawColor(0, 0, 0, 100)
surface.DrawRect(0, 1, w - 2, h - 1)
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 30)))
surface.DrawOutlinedRect(0, 0, w, h)
end
self.attributesButton.DoClick = function()
surface.PlaySound("helix/ui/press.wav")
self:CreateAttributePopup()
end
end
local attributePadding = SScaleMin(10 / 3)
function PANEL:CreateAttributeBar(parent, attributeID)
local character = LocalPlayer():GetCharacter()
local special = tonumber(character:GetSpecial(attributeID)) or 0
local attribute = ix.special:Find(attributeID)
local icon = attribute.icon or ""
local boost = tonumber(character:GetBoostedAttribute(attributeID)) or 0
local specialBoost = character:GetSpecialBoost()[attributeID] or {}
parent:SetTall(SScaleMin(100 / 3))
parent:Dock(TOP)
parent:DockMargin(attributePadding * 2, 0, attributePadding * 2, attributePadding)
local barPanel = parent:Add("Panel")
barPanel:Dock(TOP)
barPanel:SetTall(SScaleMin(27 / 3))
-- icon
local iconImage = barPanel:Add("DImage")
iconImage:Dock(LEFT)
iconImage:SetWide(SScaleMin(20 / 3))
iconImage:SetImage(icon)
iconImage:DockMargin(0, SScaleMin(2 / 3), attributePadding * 2, SScaleMin(2 / 3))
local backgroundBar = barPanel:Add("Panel")
backgroundBar:Dock(FILL)
backgroundBar.Paint = function(_, w, h)
surface.SetDrawColor(Color(0, 0, 0, 100))
surface.DrawRect(0, 0, w, h)
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 30)))
surface.DrawOutlinedRect(0, 0, w, h)
end
local positivePoints = 0
local negativePoints = 0
for _, v in pairs(specialBoost) do
if v.level > 0 then
positivePoints = positivePoints + v.level
elseif v.level < 0 then
negativePoints = negativePoints - v.level
end
end
local green = Color(138, 200, 97, 255)
local grey = Color(200, 200, 200, 255)
local red = Color(200, 97, 97, 255)
local baseBar = backgroundBar:Add("Panel")
baseBar:SetSize(SScaleMin(360 / 3), barPanel:GetTall())
baseBar.Paint = function(_, w, h)
if positivePoints > 0 then
surface.SetDrawColor(green)
surface.DrawRect(0, 0, (positivePoints + special) * (w / 10), h)
end
if special > 0 then
surface.SetDrawColor(Color(200, 200, 200, 255))
surface.DrawRect(0, 0, (special * w) / 10, h)
end
if negativePoints > 0 then
surface.SetDrawColor(red)
surface.DrawRect(math.max((positivePoints + special) - negativePoints, 0) * (w / 10), 0, negativePoints, h)
end
end
local attributeAmount = barPanel:Add("DLabel")
attributeAmount:Dock(RIGHT)
attributeAmount:SetText(boost .. "/10")
attributeAmount:SetTextColor((boost > special and green) or (boost < special and red) or grey)
attributeAmount:DockMargin(attributePadding * 2 + ((boost == 10 and SScaleMin(3 / 3)) or SScaleMin(11 / 3)), 0, 0, 0)
attributeAmount:SetFont("MenuFontNoClamp")
attributeAmount:SizeToContents()
if specialBoost.long then
local level = specialBoost.long.level
local longBoost = parent:Add("DLabel")
longBoost:Dock(TOP)
if (level != 0) then
local change = level > specialBoost.long.target and "decreasing" or "increasing"
local sign = level > 0 and "+" or ""
longBoost:SetText(string.format("Currently %s%d food boost, %s by 1 in %d minutes", sign, level, change, specialBoost.long.time))
elseif (specialBoost.long.time) then
local sign = specialBoost.long.target > 0 and "+" or "-"
longBoost:SetText(string.format("%s1 food boost becoming active in %d minutes", sign, specialBoost.long.time))
end
longBoost:SetContentAlignment(5)
longBoost:SetFont("MenuFontNoClamp")
longBoost:DockMargin(0, attributePadding, 0, attributePadding)
longBoost:SizeToContents()
end
if specialBoost.short then
local level = specialBoost.short.level
local shortBoost = parent:Add("DLabel")
shortBoost:Dock(TOP)
if (level != 0) then
local change = level > specialBoost.short.target and "decreasing" or "increasing"
local sign = level > 0 and "+" or ""
shortBoost:SetText(string.format("Currently %s%d drug boost, %s by 1 in %d seconds", sign, level, change, specialBoost.short.time))
elseif (specialBoost.short.time) then
local sign = specialBoost.short.target > 0 and "+" or "-"
shortBoost:SetText(string.format("%s1 drug boost becoming active in %d seconds", sign, specialBoost.short.time))
end
shortBoost:SetContentAlignment(5)
shortBoost:SetFont("MenuFontNoClamp")
shortBoost:DockMargin(0, attributePadding, 0, 0)
shortBoost:SizeToContents()
end
if specialBoost.neg then
local negativeBoost = parent:Add("DLabel")
negativeBoost:Dock(TOP)
negativeBoost:SetText("-" .. specialBoost.neg.level .. " from hunger and thirst")
negativeBoost:SetContentAlignment(5)
negativeBoost:SetFont("MenuFontNoClamp")
negativeBoost:DockMargin(0, attributePadding, 0, 0)
negativeBoost:SizeToContents()
end
end
function PANEL:CreateAttributePopup()
if ix.gui.attributeFrame then
ix.gui.attributeFrame:Remove()
end
ix.gui.attributeFrame = vgui.Create("Panel")
local attributeFrame = ix.gui.attributeFrame
attributeFrame:SetSize(SScaleMin(500 / 3), SScaleMin(507 / 3))
attributeFrame:SetAlpha(0)
attributeFrame:AlphaTo(255, 0.5, 0)
attributeFrame:Center()
attributeFrame:MakePopup()
attributeFrame.Paint = function(panel, w, h)
local blur = Material("pp/blurscreen")
local x, y = panel:LocalToScreen(0, 0)
surface.SetDrawColor( 255, 255, 255 )
surface.SetMaterial( blur )
for i = 1, 6 do
blur:SetFloat( "$blur", (i / 6 ) * ( 3 ) )
blur:Recompute()
render.UpdateScreenEffectTexture()
surface.DrawTexturedRect( x * -1, y * -1, ScrW(), ScrH() )
end
surface.SetDrawColor(Color(0, 0, 0, 100))
surface.DrawRect(0, 0, w, h)
surface.SetDrawColor(Color(111, 111, 136, (255 / 100 * 30)))
surface.DrawOutlinedRect(0, 0, w, h)
end
attributeFrame.Think = function()
if !IsValid(PLUGIN.SkillsMenu) then
ix.gui.attributeFrame:Remove()
end
if ix.gui.attributeFrame then
ix.gui.attributeFrame:MoveToFront()
end
end
local topbar = attributeFrame:Add("Panel")
topbar:SetSize(attributeFrame:GetWide(), SScaleMin(50 / 3))
topbar:Dock(TOP)
topbar:DockMargin(0, 0, 0, attributePadding)
topbar.Paint = function( _, w, h )
surface.SetDrawColor(0, 0, 0, 130)
surface.DrawRect(0, 0, w, h)
end
local titleText = topbar:Add("DLabel")
titleText:SetFont("CharCreationBoldTitleNoClamp")
titleText:Dock(LEFT)
titleText:SetText("Attribute Boosts")
titleText:DockMargin(attributePadding, 0, 0, 0)
titleText:SetContentAlignment(4)
titleText:SizeToContents()
local exit = topbar:Add("DImageButton")
exit:SetImage("willardnetworks/tabmenu/navicons/exit.png")
exit:SetSize(SScaleMin(20 / 3), SScaleMin(20 / 3))
exit:DockMargin(0, SScaleMin(15 / 3), attributePadding, SScaleMin(15 / 3))
exit:Dock(RIGHT)
exit.DoClick = function()
if !IsValid(self) then
return
end
if attributeFrame then
attributeFrame:Remove()
end
surface.PlaySound("helix/ui/press.wav")
end
local strength = attributeFrame:Add("Panel")
self:CreateAttributeBar(strength, "strength")
local intelligence = attributeFrame:Add("Panel")
self:CreateAttributeBar(intelligence, "intelligence")
local perception = attributeFrame:Add("Panel")
self:CreateAttributeBar(perception, "perception")
local agility = attributeFrame:Add("Panel")
self:CreateAttributeBar(agility, "agility")
end
vgui.Register("WNSkillPanel", PANEL, "EditablePanel")
hook.Add("CreateMenuButtons", "WNSkillPanel", function(tabs)
tabs["skills"] = {
RowNumber = 2,
Width = 18,
Height = 18,
Icon = "willardnetworks/tabmenu/navicons/crafting.png",
Create = function(info, container)
if PLUGIN.SkillsMenu then
PLUGIN.SkillsMenu:Remove()
end
PLUGIN.SkillsMenu = container:Add("WNSkillPanel")
end
}
end)