mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
174
gamemodes/darkrp/plugins/goi_factory/3d2d/cl_nets.lua
Normal file
174
gamemodes/darkrp/plugins/goi_factory/3d2d/cl_nets.lua
Normal file
@@ -0,0 +1,174 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
net.Receive("ix.terminal.CWUWorkshiftData", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
local data = util.JSONToTable(net.ReadString())
|
||||
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
if !IsValid(terminalPanel.shiftPanel) then
|
||||
terminalPanel:ProceedShiftBuilding(data)
|
||||
else
|
||||
terminalPanel:PopulateWorkshift(data)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.CWUWorkshiftSound", function()
|
||||
surface.PlaySound(ix.config.Get("broadcastSound", "ambience/3d-sounds/alarms/workshiftalarm.ogg"))
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.AuthError", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
terminalPanel:AuthError()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.DiscAttach", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
local disc = net.ReadString()
|
||||
|
||||
local terminalPanel = ent.terminalPanel
|
||||
if terminalPanel then
|
||||
terminalPanel:SetDisc(disc)
|
||||
terminalPanel:OnDiscAttach()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.DiscDetach", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
terminalPanel:SetDisc(nil)
|
||||
terminalPanel:OnDiscDetach()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.Scan", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
terminalPanel:Encode()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.UpdateCWUTerminals", function(len)
|
||||
local cityTbl = util.JSONToTable(net.ReadString())
|
||||
|
||||
local ent = net.ReadEntity()
|
||||
local terminalPanel = ent.terminalPanel
|
||||
if terminalPanel then
|
||||
terminalPanel:Populate(cityTbl)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.RequestCities", function(len)
|
||||
local cities = util.JSONToTable(net.ReadString())
|
||||
local ent = net.ReadEntity()
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
terminalPanel:CreateMarketPanel(cities)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.RequestMainCityInfo", function(len)
|
||||
local cityInfo = util.JSONToTable(net.ReadString())
|
||||
local budgets = util.JSONToTable(net.ReadString())
|
||||
local ent = net.ReadEntity()
|
||||
local option = net.ReadString()
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
if option == "status" then
|
||||
terminalPanel:CreateStatusPanel(cityInfo, budgets)
|
||||
elseif option == "cart" then
|
||||
terminalPanel:BuildCart(terminalPanel.cartPanel, cityInfo)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.GetCityStock", function(len)
|
||||
local items = util.JSONToTable(net.ReadString())
|
||||
local ent = net.ReadEntity()
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
terminalPanel:CreateStock(items)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.turnOn", function(len)
|
||||
local ent = net.ReadEntity()
|
||||
local client = net.ReadEntity()
|
||||
local data = net.ReadString()
|
||||
data = util.JSONToTable(data)
|
||||
|
||||
if IsValid(ent) then
|
||||
ent:CreateStartScreen(client, data)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.turnOff", function(len)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
if IsValid(ent) then
|
||||
ent:PurgeScreenPanels()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.CWUCardInserted", function(len)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
terminalPanel:OnCWUCardInserted()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.CWUCardRemoved", function(len)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
terminalPanel:OnCWUCardRemoved()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.SendCIDInfo", function(len)
|
||||
local genData = util.JSONToTable(net.ReadString())
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
terminalPanel:OnCIDInserted(genData)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.SendCIDRemoved", function(len)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
local terminalPanel = ent.terminalPanel
|
||||
|
||||
if terminalPanel then
|
||||
terminalPanel:OnCIDRemoved()
|
||||
end
|
||||
end)
|
||||
98
gamemodes/darkrp/plugins/goi_factory/3d2d/cl_panels.lua
Normal file
98
gamemodes/darkrp/plugins/goi_factory/3d2d/cl_panels.lua
Normal file
@@ -0,0 +1,98 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
ix.factoryPanels = ix.factoryPanels or {}
|
||||
ix.factoryPanels.list = ix.factoryPanels.list or {}
|
||||
|
||||
function ix.factoryPanels:CreatePanel(panel, ent)
|
||||
local pnl = vgui.Create(panel)
|
||||
pnl:SetTerminalEntity(ent)
|
||||
ent.terminalPanel = pnl
|
||||
ix.factoryPanels.list[#ix.factoryPanels.list + 1] = pnl
|
||||
return pnl
|
||||
end
|
||||
|
||||
function ix.factoryPanels:PurgeEntityPanels(ent)
|
||||
for index, panel in pairs(self.list) do
|
||||
if panel:GetTerminalEntity() == ent then
|
||||
panel:Destroy()
|
||||
table.remove(self.list, index)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- fonts
|
||||
|
||||
surface.CreateFont( "WNTerminalSmallText", {
|
||||
font = "Open Sans",
|
||||
extended = false,
|
||||
size = 32,
|
||||
weight = 550,
|
||||
scanlines = 2,
|
||||
antialias = true,
|
||||
outline = true
|
||||
} )
|
||||
|
||||
surface.CreateFont( "WNTerminalMediumSmallerText", {
|
||||
font = "Open Sans",
|
||||
extended = false,
|
||||
size = 38,
|
||||
weight = 550,
|
||||
scanlines = 2,
|
||||
antialias = true,
|
||||
outline = true
|
||||
} )
|
||||
|
||||
surface.CreateFont( "WNTerminalMediumText", {
|
||||
font = "Open Sans",
|
||||
extended = false,
|
||||
size = 48,
|
||||
weight = 550,
|
||||
scanlines = 2,
|
||||
antialias = true,
|
||||
outline = true
|
||||
} )
|
||||
|
||||
surface.CreateFont( "WNTerminalLargeText", {
|
||||
font = "Open Sans",
|
||||
extended = false,
|
||||
size = 96,
|
||||
weight = 550,
|
||||
scanlines = 2,
|
||||
antialias = true,
|
||||
outline = true
|
||||
} )
|
||||
|
||||
surface.CreateFont( "WNTerminalMoreLargerText", {
|
||||
font = "Open Sans",
|
||||
extended = false,
|
||||
size = 114,
|
||||
weight = 550,
|
||||
scanlines = 2,
|
||||
antialias = true,
|
||||
outline = true
|
||||
} )
|
||||
|
||||
surface.CreateFont( "WNTerminalVeryLargeText", {
|
||||
font = "Open Sans",
|
||||
extended = false,
|
||||
size = 600,
|
||||
weight = 550,
|
||||
scanlines = 2,
|
||||
antialias = true,
|
||||
outline = true
|
||||
} )
|
||||
|
||||
surface.CreateFont("ButtonLabel", {
|
||||
font = "Roboto",
|
||||
size = 70,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
377
gamemodes/darkrp/plugins/goi_factory/3d2d/sv_nets.lua
Normal file
377
gamemodes/darkrp/plugins/goi_factory/3d2d/sv_nets.lua
Normal file
@@ -0,0 +1,377 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
-- one day i definitely should re-do the networking here..
|
||||
|
||||
util.AddNetworkString("ix.terminal.turnOn")
|
||||
util.AddNetworkString("ix.terminal.turnOff")
|
||||
util.AddNetworkString("ix.terminal.AuthError")
|
||||
util.AddNetworkString("ix.terminal.CWUBroadcast")
|
||||
util.AddNetworkString("ix.terminal.CWUWorkshiftBegin")
|
||||
util.AddNetworkString("ix.terminal.CWUWorkshiftEnd")
|
||||
util.AddNetworkString("ix.terminal.CWUWorkshiftPause")
|
||||
util.AddNetworkString("ix.terminal.CWUWorkshiftRewardUpdate")
|
||||
util.AddNetworkString("ix.terminal.CWUWorkshiftSound")
|
||||
util.AddNetworkString("ix.terminal.CWUWorkshiftData")
|
||||
util.AddNetworkString("ix.terminal.CWUCardInserted")
|
||||
util.AddNetworkString("ix.terminal.CWUCardRemoved")
|
||||
util.AddNetworkString("ix.terminal.SendCIDInfo")
|
||||
util.AddNetworkString("ix.terminal.SendCIDRemoved")
|
||||
util.AddNetworkString("ix.terminal.GetCityStock")
|
||||
util.AddNetworkString("ix.terminal.RequestMainCityInfo")
|
||||
util.AddNetworkString("ix.terminal.RequestCities")
|
||||
util.AddNetworkString("ix.terminal.UpdateCWUTerminals")
|
||||
util.AddNetworkString("ix.terminal.DiscAttach")
|
||||
util.AddNetworkString("ix.terminal.DiscDetach")
|
||||
util.AddNetworkString("ix.terminal.Scan")
|
||||
util.AddNetworkString("ix.terminal.Fabricate")
|
||||
util.AddNetworkString("ix.terminal.Recycle")
|
||||
util.AddNetworkString("ix.terminal.Bioprocess")
|
||||
util.AddNetworkString("ix.terminal.ToggleDepot")
|
||||
|
||||
local workshifts = ix.plugin.Get("combineutilities")
|
||||
|
||||
net.Receive("ix.terminal.CWUWorkshiftPause", function(_, client)
|
||||
local ent = net.ReadEntity()
|
||||
local wActive = GetNetVar("WorkshiftStarted", false)
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then return end
|
||||
if (!ix.city:IsAuthorized(client, ent)) then return end
|
||||
if (!wActive) then return end
|
||||
|
||||
local workshiftTerminals = ents.FindByClass("ix_workshiftterminal")
|
||||
local pauseBool
|
||||
|
||||
if #workshiftTerminals > 0 then
|
||||
for _, wTerminal in pairs(workshiftTerminals) do
|
||||
if !wTerminal.workshiftStarted then continue end
|
||||
|
||||
workshifts:PauseWorkshift(wTerminal, client, !wTerminal.workshiftPaused)
|
||||
if !pauseBool then
|
||||
pauseBool = wTerminal.workshiftPaused
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if isbool(pauseBool) then
|
||||
client:NotifyLocalized("Registration pause is set to: " .. tostring(pauseBool))
|
||||
|
||||
ix.combineNotify:AddNotification(pauseBool and "NTC:// Work-Cycle registration paused by " .. client:GetCombineTag() or "NTC:// Work-Cycle registration resumed by " .. client:GetCombineTag(), nil, client)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.CWUWorkshiftBegin", function(_, client)
|
||||
local ent = net.ReadEntity()
|
||||
local wActive = GetNetVar("WorkshiftStarted", false)
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then return end
|
||||
if (!ix.city:IsAuthorized(client, ent)) then return end
|
||||
if (wActive) then return end
|
||||
|
||||
local workshiftTerminals = ents.FindByClass("ix_workshiftterminal")
|
||||
if #workshiftTerminals > 0 then
|
||||
for _, wTerminal in pairs(workshiftTerminals) do
|
||||
wTerminal:StartWorkshift(client)
|
||||
end
|
||||
else
|
||||
return client:NotifyLocalized("There's no workshift terminals!")
|
||||
end
|
||||
ix.combineNotify:AddNotification("NTC:// Work-Cycle initiated by " .. client:GetCombineTag(), nil, client)
|
||||
|
||||
local idCard = ix.item.instances[ent:GetCID()]
|
||||
workshifts:AddToWorkshift(client, idCard, ent.curGenData, workshiftTerminals[1])
|
||||
workshifts:StartWorkshift()
|
||||
client:NotifyLocalized("Workshift started!")
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.CWUWorkshiftEnd", function(_, client)
|
||||
local ent = net.ReadEntity()
|
||||
local wActive = GetNetVar("WorkshiftStarted", false)
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then return end
|
||||
if (!ix.city:IsAuthorized(client, ent)) then return end
|
||||
if (!wActive) then return end
|
||||
local rewards = {}
|
||||
local workshiftDataExtracted = false
|
||||
|
||||
local workshiftTerminals = ents.FindByClass("ix_workshiftterminal")
|
||||
if #workshiftTerminals > 0 then
|
||||
for _, wTerminal in pairs(workshiftTerminals) do
|
||||
if !wTerminal.workshiftStarted then continue end
|
||||
|
||||
if wTerminal.workshiftStarted and !workshiftDataExtracted then
|
||||
rewards = wTerminal.savedInfo
|
||||
workshiftDataExtracted = true
|
||||
end
|
||||
wTerminal:StopWorkshift(client)
|
||||
end
|
||||
else
|
||||
return client:NotifyLocalized("There's no workshift terminals!")
|
||||
end
|
||||
ix.combineNotify:AddNotification("NTC:// Work-Cycle terminated by " .. client:GetCombineTag(), nil, client)
|
||||
|
||||
workshifts:EndWorkshift(rewards, client)
|
||||
client:NotifyLocalized("Workshift ended!")
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.CWUWorkshiftRewardUpdate", function(_, client)
|
||||
local ent = net.ReadEntity()
|
||||
local data = util.JSONToTable(net.ReadString())
|
||||
local wActive = GetNetVar("WorkshiftStarted", false)
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then return end
|
||||
if (!ix.city:IsAuthorized(client, ent)) then return end
|
||||
if (!wActive) then return end
|
||||
|
||||
local workshiftTerminals = ents.FindByClass("ix_workshiftterminal")
|
||||
if #workshiftTerminals > 0 then
|
||||
for _, wTerminal in pairs(workshiftTerminals) do
|
||||
if !wTerminal.workshiftStarted then continue end
|
||||
workshifts:SaveWorkshift(data, wTerminal)
|
||||
end
|
||||
else
|
||||
return client:NotifyLocalized("There's no workshift terminals!")
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.CWUWorkshiftData", function(_, client)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then return end
|
||||
if (!ix.city:IsAuthorized(client, ent)) then return end
|
||||
|
||||
local wActive = GetNetVar("WorkshiftStarted", false)
|
||||
local workshiftTerminals = ents.FindByClass("ix_workshiftterminal")
|
||||
local dataToSend = {}
|
||||
if wActive and #workshiftTerminals > 0 then
|
||||
dataToSend["participants"] = {}
|
||||
dataToSend["rewards"] = {}
|
||||
|
||||
for _, wTerminal in pairs(workshiftTerminals) do
|
||||
if !wTerminal.workshiftStarted then continue end
|
||||
|
||||
if (wTerminal.participants and istable(wTerminal.participants) and !table.IsEmpty(wTerminal.participants)) then
|
||||
for id, participant in pairs(wTerminal.participants) do
|
||||
dataToSend["participants"][id] = participant
|
||||
end
|
||||
end
|
||||
|
||||
if (wTerminal.savedInfo and istable(wTerminal.savedInfo) and !table.IsEmpty(wTerminal.savedInfo)) then
|
||||
for id, reward in pairs(wTerminal.savedInfo) do
|
||||
dataToSend["rewards"][id] = reward
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
net.Start("ix.terminal.CWUWorkshiftData")
|
||||
net.WriteEntity(ent)
|
||||
net.WriteString(util.TableToJSON(dataToSend))
|
||||
net.Send(client)
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.CWUBroadcast", function(_, client)
|
||||
local ent = net.ReadEntity()
|
||||
if (!ent or !ent:IsValid() or ent:GetClass() != "ix_cwuterminal") then return end
|
||||
|
||||
if ((ent.nextBroadcast or 0) >= CurTime()) then return end
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then return end
|
||||
if (!ix.city:IsAuthorized(client, ent)) then return end
|
||||
|
||||
local broadcast = !ent:GetNetVar("broadcasting", false)
|
||||
client:SetNetVar("broadcastAuth", broadcast and broadcast or nil)
|
||||
ent:ToggleBroadcast()
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.Bioprocess", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
local itemID = net.ReadString()
|
||||
local isBulk = net.ReadBool()
|
||||
local amount = net.ReadInt(5)
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
local bioprocess = ent:SynthesizeFabrication(client, itemID, isBulk, amount)
|
||||
if bioprocess then
|
||||
client:NotifyLocalized(bioprocess)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.ToggleDepot", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
local depotToggle = ent:ToggleDepot()
|
||||
if depotToggle then
|
||||
client:NotifyLocalized(depotToggle)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.Recycle", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
local recycle = ent:Recycle(client)
|
||||
if recycle then
|
||||
client:NotifyLocalized(recycle)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.Fabricate", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
local isBulk = net.ReadBool()
|
||||
local amount = net.ReadInt(5)
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
local fabrication = ent:SynthesizeFabrication(client, ent:GetDiscItemID(), isBulk, amount)
|
||||
if fabrication then
|
||||
client:NotifyLocalized(fabrication)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.Scan", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
local scan = ent:Scan(client)
|
||||
if scan then
|
||||
client:NotifyLocalized(scan)
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.RequestCities", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
local cities = {}
|
||||
for cityID, city in pairs(ix.city.list) do
|
||||
cities[cityID] = city
|
||||
end
|
||||
cities["1"] = table.Copy(ix.city.main)
|
||||
cities = util.TableToJSON(cities)
|
||||
|
||||
net.Start("ix.terminal.RequestCities")
|
||||
net.WriteString(cities)
|
||||
net.WriteEntity(ent)
|
||||
net.Send(client)
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.RequestMainCityInfo", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
local option = net.ReadString()
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
local city = util.TableToJSON(ix.city:GetMainCity())
|
||||
local budgets = util.TableToJSON(ix.factionBudget.list)
|
||||
|
||||
net.Start("ix.terminal.RequestMainCityInfo")
|
||||
net.WriteString(city)
|
||||
net.WriteString(budgets)
|
||||
net.WriteEntity(ent)
|
||||
net.WriteString(option)
|
||||
net.Send(client)
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.GetCityStock", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
local city = ix.city:GetMainCity()
|
||||
local items = util.TableToJSON(city:GetItems())
|
||||
|
||||
net.Start("ix.terminal.GetCityStock")
|
||||
net.WriteString(items)
|
||||
net.WriteEntity(ent)
|
||||
net.Send(client)
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.turnOn", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
local dataToSend = {}
|
||||
|
||||
if ent:GetClass() == "ix_cwuterminal" then
|
||||
if ent.curGenData then
|
||||
dataToSend[1] = ent.curGenData
|
||||
end
|
||||
|
||||
if ent:GetCWUCard() and ent:GetCWUCard() != -1 then
|
||||
dataToSend[2] = ent:GetCWUCard()
|
||||
end
|
||||
|
||||
if ent:HasCWUCard() and ent:HasCID() or ent.curGenData and ent.curGenData.combine then
|
||||
dataToSend[3] = !ent:IsFullyAuthed()
|
||||
end
|
||||
end
|
||||
|
||||
if ent.dItemID then
|
||||
dataToSend = {ent.dItemID}
|
||||
end
|
||||
|
||||
ent:SetUsedBy(client)
|
||||
ent:CreateUserTimer()
|
||||
net.Start("ix.terminal.turnOn")
|
||||
net.WriteEntity(ent)
|
||||
net.WriteEntity(client)
|
||||
net.WriteString(util.TableToJSON(dataToSend))
|
||||
net.Broadcast()
|
||||
end)
|
||||
|
||||
net.Receive("ix.terminal.turnOff", function(len, client)
|
||||
local ent = net.ReadEntity()
|
||||
|
||||
if (client:EyePos():DistToSqr(ent:GetPos()) > 62500) then
|
||||
return
|
||||
end
|
||||
|
||||
if (IsValid(ent:GetUsedBy()) and ent:GetUsedBy() != client) then
|
||||
return client:NotifyLocalized("This terminal is being used by someone else.")
|
||||
end
|
||||
|
||||
ent:SetUsedBy(ent)
|
||||
|
||||
if ent:GetClass() == "ix_cwuterminal" and ent:GetNetVar("broadcasting", false) then
|
||||
if client:GetNetVar("broadcastAuth", false) then
|
||||
client:SetNetVar("broadcastAuth", nil)
|
||||
end
|
||||
ent:ToggleBroadcast()
|
||||
end
|
||||
|
||||
net.Start("ix.terminal.turnOff")
|
||||
net.WriteEntity(ent)
|
||||
net.Broadcast()
|
||||
end)
|
||||
3557
gamemodes/darkrp/plugins/goi_factory/derma/cl_cwupanel.lua
Normal file
3557
gamemodes/darkrp/plugins/goi_factory/derma/cl_cwupanel.lua
Normal file
File diff suppressed because it is too large
Load Diff
527
gamemodes/darkrp/plugins/goi_factory/derma/cl_dataencoder.lua
Normal file
527
gamemodes/darkrp/plugins/goi_factory/derma/cl_dataencoder.lua
Normal file
@@ -0,0 +1,527 @@
|
||||
--[[
|
||||
| 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 screenMat = Material("vgui/terminal_yellow.png", "smooth")
|
||||
local frameMat = Material("vgui/gradient-d", "smooth")
|
||||
local cmbLabel = Material("willardnetworks/datafile/licensedisabled2.png", "smooth")
|
||||
local cmbLogo = Material("vgui/icons/cmb_logo.png", "smooth")
|
||||
local wnLogo = Material("vgui/icons/wi_logo.png", "smooth")
|
||||
local defClr = Color(255, 223, 136)
|
||||
local redClr = Color(200, 36, 36)
|
||||
local greenClr = Color(36, 200, 61)
|
||||
local backgroundColor = Color(9, 9, 9, 75)
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
AccessorFunc(PANEL, "terminalEntity", "TerminalEntity")
|
||||
AccessorFunc(PANEL, "usedBy", "UsedBy")
|
||||
AccessorFunc(PANEL, "disc", "Disc")
|
||||
|
||||
local scrwSrn, scrhSrn = 1780, 870
|
||||
|
||||
local function CreateButton(name, text, path, font, alignment)
|
||||
name:SetContentAlignment(alignment or 4)
|
||||
name:SetTextInset(alignment and 0 or 10, 0)
|
||||
name:SetFont(font or "WNTerminalMediumText")
|
||||
name:SetText(string.utf8upper(text))
|
||||
name.Paint = function(self, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:CreateDivider(parent, dock, bVertical)
|
||||
local divider = parent:Add("Panel")
|
||||
divider:Dock(dock)
|
||||
divider:DockMargin(8, 8, 8, 8)
|
||||
divider:SetHeight(10)
|
||||
divider.bVertical = bVertical
|
||||
divider.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
if !bVertical then
|
||||
surface.DrawLine(0, h * 0.5, w, h * 0.5)
|
||||
else
|
||||
surface.DrawLine(w * 0.5, 0, w * 0.5, h)
|
||||
end
|
||||
end
|
||||
|
||||
return divider
|
||||
end
|
||||
|
||||
function PANEL:CreateAnimatedFrame(parent, dock, dockL, dockT, dockR, dockB, frameClr, callback)
|
||||
local panel = parent:Add("Panel")
|
||||
AccessorFunc(panel, "color", "Color")
|
||||
|
||||
panel:DockMargin(dockL, dockT, dockR, dockB)
|
||||
panel:Dock(dock)
|
||||
panel:InvalidateParent(true)
|
||||
|
||||
panel:SetColor(frameClr)
|
||||
|
||||
local wCoef = 0
|
||||
local hCoef = 0
|
||||
local anim = self:NewAnimation( 0.75, 0, -1)
|
||||
anim.Think = function( s, pnl, fraction )
|
||||
wCoef = fraction
|
||||
end
|
||||
local anim2 = self:NewAnimation( 0.8, 0.85, -1, function( s, pnl )
|
||||
if callback then
|
||||
callback()
|
||||
end
|
||||
end )
|
||||
anim2.Think = function( s, pnl, fraction )
|
||||
hCoef = fraction
|
||||
end
|
||||
|
||||
panel.Paint = function(s, w, h)
|
||||
w = w * wCoef
|
||||
h = h * hCoef
|
||||
|
||||
local clr = s:GetColor()
|
||||
clr.a = 100
|
||||
|
||||
surface.SetDrawColor(43, 42, 42, 200)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(clr)
|
||||
surface.SetMaterial(frameMat)
|
||||
surface.DrawTexturedRect(0, h * 0.95, w, h * 0.05)
|
||||
|
||||
surface.SetDrawColor(clr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
return panel
|
||||
end
|
||||
|
||||
function PANEL:PurgeInnerContent()
|
||||
for _, pnl in pairs(self.innerContent:GetChildren()) do
|
||||
pnl:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:CreateLock()
|
||||
self.lockPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.lockPanel) then return end
|
||||
|
||||
self.lockPanel:ColorTo(redClr, 0.5)
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button8.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
self.bottomWarning = self.lockPanel:Add("DLabel")
|
||||
self.bottomWarning:SetFont("WNTerminalLargeText")
|
||||
self.bottomWarning:SetText(string.utf8upper("BU TERMİNAL KULLANILIYOR"))
|
||||
self.bottomWarning:SetTextColor(redClr)
|
||||
self.bottomWarning:Dock(BOTTOM)
|
||||
self.bottomWarning:DockMargin(0, 0, 0, 32)
|
||||
self.bottomWarning:SetContentAlignment(5)
|
||||
self.bottomWarning:SizeToContents()
|
||||
self.bottomWarning:SetAlpha(0)
|
||||
|
||||
self.warningIcon = self.lockPanel:Add("DLabel")
|
||||
self.warningIcon:SetFont("WNTerminalVeryLargeText")
|
||||
self.warningIcon:SetTextColor(redClr)
|
||||
self.warningIcon:SetText("!")
|
||||
self.warningIcon:SetContentAlignment(5)
|
||||
self.warningIcon:Center()
|
||||
self.warningIcon:SetAlpha(0)
|
||||
self.warningIcon:SizeToContents()
|
||||
self.warningIcon.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(redClr)
|
||||
surface.DrawCircle(26, 133, 75)
|
||||
end
|
||||
|
||||
local alphishRedClr = redClr
|
||||
alphishRedClr.a = 50
|
||||
self.upperWarning = self.lockPanel:Add("DLabel")
|
||||
self.upperWarning:Dock(TOP)
|
||||
self.upperWarning:DockMargin(1, 64, 1, 0)
|
||||
self.upperWarning:SetHeight(self:GetParent():GetTall() * 0.1)
|
||||
self.upperWarning:SetContentAlignment(5)
|
||||
self.upperWarning:SetFont("WNTerminalMediumText")
|
||||
self.upperWarning:SetText(string.utf8upper("[LÜTFEN SABIRLI OLUN // SIRANIZI BEKLEYİN]"))
|
||||
self.upperWarning:SetTextColor(defClr)
|
||||
self.upperWarning.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(redClr)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetMaterial(cmbLabel)
|
||||
surface.SetDrawColor(alphishRedClr)
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
self.upperWarning:SetAlpha(0)
|
||||
|
||||
for _, child in pairs(self.lockPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:InitializeBootupSequence()
|
||||
self.wnLogo = self.innerContent:Add("Panel")
|
||||
self.wnLogo:SetSize(500, 500)
|
||||
self.wnLogo:CenterHorizontal(0.25)
|
||||
self.wnLogo:CenterVertical(0.5)
|
||||
self.wnLogo.Paint = function(s, w, h)
|
||||
surface.SetMaterial(wnLogo)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
self.wnLogo:SetAlpha(0)
|
||||
|
||||
self.cmbLogo = self.innerContent:Add("Panel")
|
||||
self.cmbLogo:SetSize(400, 500)
|
||||
self.cmbLogo:CenterHorizontal(0.75)
|
||||
self.cmbLogo:CenterVertical(0.5)
|
||||
self.cmbLogo.Paint = function(s, w, h)
|
||||
surface.SetMaterial(cmbLogo)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
self.cmbLogo:SetAlpha(0)
|
||||
|
||||
self.indicator = self.innerContent:Add("Panel")
|
||||
self.indicator:SetWide(25)
|
||||
self.indicator:SetHeight(self.innerContent:GetTall() - 2)
|
||||
self.indicator:Center()
|
||||
self.indicator:SetAlpha(0)
|
||||
|
||||
local defClrAlphish = defClr
|
||||
defClrAlphish.a = 100
|
||||
self.indicator.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(defClrAlphish)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
end
|
||||
|
||||
for _, child in pairs(self.innerContent:GetChildren()) do
|
||||
child:AlphaTo(255, 0.25, 0, function()
|
||||
self:GetTerminalEntity():EmitSound("wn_goi/terminal_turnon.mp3", 55, 100, 1, CHAN_VOICE, 0, 11)
|
||||
end)
|
||||
end
|
||||
|
||||
self.indicator:SizeTo(-1, 0, 1, 0.25, -1, function()
|
||||
self.cmbLogo:MoveTo(self.innerContent:GetWide() / 2.72, self.cmbLogo:GetY(), 1)
|
||||
self.cmbLogo:AlphaTo(0, 0.15, 0.5)
|
||||
self.wnLogo:MoveTo(self.innerContent:GetWide() / 3, self.wnLogo:GetY(), 1, 0, -1, function()
|
||||
self.wnLogo:AlphaTo(0, 0.25, 1.5, function()
|
||||
for _, child in pairs(self.innerContent:GetChildren()) do
|
||||
child:Remove()
|
||||
end
|
||||
self:Proceed()
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:BuildEncodingPanel()
|
||||
self.encodingPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.encodingPanel) then return end
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/combine_button7.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
local upperLabel = self.encodingPanel:Add("DLabel")
|
||||
upperLabel:SetFont("WNTerminalLargeText")
|
||||
upperLabel:SetText(string.utf8upper("TARANIYOR VE KODLANIYOR..."))
|
||||
upperLabel:SetTextColor(defClr)
|
||||
upperLabel:Dock(TOP)
|
||||
upperLabel:DockMargin(0, 32, 0, 0)
|
||||
upperLabel:SetContentAlignment(5)
|
||||
upperLabel:SizeToContents()
|
||||
upperLabel:SetAlpha(0)
|
||||
|
||||
local bottomLabel = self.encodingPanel:Add("DLabel")
|
||||
bottomLabel:SetFont("WNTerminalMediumText")
|
||||
bottomLabel:SetText(string.utf8upper("ELLERİNİZİ TERMİNAL DEPOSUNA SOKMAYIN"))
|
||||
bottomLabel:SetTextColor(defClr)
|
||||
bottomLabel:Dock(BOTTOM)
|
||||
bottomLabel:DockMargin(0, 0, 0, 32)
|
||||
bottomLabel:SetContentAlignment(5)
|
||||
bottomLabel:SizeToContents()
|
||||
bottomLabel:SetAlpha(0)
|
||||
|
||||
self:CreateDivider(self.encodingPanel, TOP)
|
||||
self:CreateDivider(self.encodingPanel, BOTTOM)
|
||||
|
||||
local barPanel = self.encodingPanel:Add("Panel")
|
||||
barPanel:Dock(FILL)
|
||||
barPanel:DockMargin(32, 32, 32, 32)
|
||||
barPanel.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
barPanel:SetAlpha(0)
|
||||
|
||||
local bar = barPanel:Add("Panel")
|
||||
bar:Dock(FILL)
|
||||
bar:DockMargin(16, 16, 16, 16)
|
||||
bar.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
end
|
||||
bar:SizeTo(0, -1, self:GetTerminalEntity().scanTimer - 2, 1, 1, function()
|
||||
bar:SetAlpha(0)
|
||||
self.encodingPanel:AlphaTo(0, 0.5, 0.5, function()
|
||||
self:PurgeInnerContent()
|
||||
self:Proceed()
|
||||
end)
|
||||
end)
|
||||
|
||||
for _, child in pairs(self.encodingPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:Encode()
|
||||
self:PurgeInnerContent()
|
||||
self:BuildEncodingPanel()
|
||||
end
|
||||
|
||||
function PANEL:OnDiscAttach()
|
||||
if self.discPanel then
|
||||
self.discPanel:ColorTo(greenClr, 0.5, 0, function()
|
||||
if (IsValid(self.bottomLabel) and IsValid(self.upperLabel)) then
|
||||
self.bottomLabel:AlphaTo(0, 0.25)
|
||||
self.upperLabel:AlphaTo(0, 0.25)
|
||||
end
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/combine_button5.wav", 55, 100, 1, nil, 0, 11)
|
||||
self.discPanel:AlphaTo(0, 0.5, 1, function()
|
||||
self.discPanel:Remove()
|
||||
self:ToInteraction()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:OnDiscDetach()
|
||||
self:SetDisc(nil)
|
||||
self:PurgeInnerContent()
|
||||
self:RequestDisc()
|
||||
end
|
||||
|
||||
function PANEL:RequestDisc()
|
||||
self.discPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.discPanel) then return end
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/combine_button1.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
self.bottomLabel = self.discPanel:Add("DLabel")
|
||||
self.bottomLabel:SetFont("WNTerminalLargeText")
|
||||
self.bottomLabel:SetText(string.utf8upper("empty data disc is required"))
|
||||
self.bottomLabel:SetTextColor(defClr)
|
||||
self.bottomLabel:Dock(BOTTOM)
|
||||
self.bottomLabel:DockMargin(0, 0, 0, 32)
|
||||
self.bottomLabel:SetContentAlignment(5)
|
||||
self.bottomLabel:SizeToContents()
|
||||
self.bottomLabel:SetAlpha(0)
|
||||
|
||||
local defClrAlphish = defClr
|
||||
defClrAlphish.a = 100
|
||||
self.upperLabel = self.discPanel:Add("DLabel")
|
||||
self.upperLabel:Dock(TOP)
|
||||
self.upperLabel:DockMargin(1, 64, 1, 0)
|
||||
self.upperLabel:SetHeight(self:GetParent():GetTall() * 0.1)
|
||||
self.upperLabel:SetContentAlignment(5)
|
||||
self.upperLabel:SetFont("WNTerminalMediumText")
|
||||
self.upperLabel:SetText(string.utf8upper("[INSERT EMPTY DATA DISK TO PROCEED // ENCODING DATA CENTRE]"))
|
||||
self.upperLabel:SetTextColor(defClr)
|
||||
self.upperLabel.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(self.discPanel:GetColor())
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetMaterial(cmbLabel)
|
||||
surface.SetDrawColor(self.discPanel:GetColor())
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
self.upperLabel:SetAlpha(0)
|
||||
|
||||
self.cmbLogo = self.discPanel:Add("Panel")
|
||||
self.cmbLogo:SetSize(400, 500)
|
||||
self.cmbLogo:Center()
|
||||
self.cmbLogo.Paint = function(s, w, h)
|
||||
surface.SetMaterial(cmbLogo)
|
||||
surface.SetDrawColor(self.discPanel:GetColor())
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
self.cmbLogo:SetAlpha(0)
|
||||
|
||||
for _, child in pairs(self.discPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:Proceed()
|
||||
if (!self:IsUsedByLocalPlayer()) then
|
||||
self:CreateLock()
|
||||
else
|
||||
if (!self:GetDisc()) then
|
||||
self:RequestDisc()
|
||||
else
|
||||
self:ToInteraction()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:BuildInteraction(parent)
|
||||
if self:GetDisc() != "" then
|
||||
local errorLabel = parent:Add("DLabel")
|
||||
errorLabel:Dock(FILL)
|
||||
errorLabel:SetContentAlignment(5)
|
||||
errorLabel:SetFont("WNTerminalMediumText")
|
||||
errorLabel:SetText(string.utf8upper("TAKILI DİSKTE ZATEN \n KODLANMIŞ BİR ÖĞE VAR"))
|
||||
errorLabel:SetTextColor(defClr)
|
||||
return
|
||||
end
|
||||
|
||||
local upperLabel = parent:Add("DLabel")
|
||||
upperLabel:Dock(TOP)
|
||||
upperLabel:DockMargin(0, 8, 0, 0)
|
||||
upperLabel:SetContentAlignment(5)
|
||||
upperLabel:SetFont("WNTerminalMediumText")
|
||||
upperLabel:SetText(string.utf8upper("KODLAMA SÜRECİ"))
|
||||
upperLabel:SetTextColor(defClr)
|
||||
self:CreateDivider(parent, TOP)
|
||||
|
||||
local bottomLabel = parent:Add("DLabel")
|
||||
bottomLabel:Dock(BOTTOM)
|
||||
bottomLabel:DockMargin(0, 0, 0, 16)
|
||||
bottomLabel:SetContentAlignment(5)
|
||||
bottomLabel:SetFont("WNTerminalMediumSmallerText")
|
||||
bottomLabel:SetText(string.utf8upper("GEREKLİ ÖĞEYİ YERLEŞTİRİN VE TARAMAYI ONAYLAYIN"))
|
||||
bottomLabel:SetTextColor(defClr)
|
||||
self:CreateDivider(parent, BOTTOM)
|
||||
|
||||
local confirmPanel = parent:Add("Panel")
|
||||
confirmPanel:Dock(FILL)
|
||||
confirmPanel:DockMargin(256, 64, 256, 64)
|
||||
confirmPanel.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
local confirmLabel = confirmPanel:Add("DLabel")
|
||||
confirmLabel:Dock(TOP)
|
||||
confirmLabel:DockMargin(0, 16, 0, 0)
|
||||
confirmLabel:SetContentAlignment(5)
|
||||
confirmLabel:SetFont("WNTerminalMediumSmallerText")
|
||||
confirmLabel:SetText(string.utf8upper("KODLAMAYA BAŞLA?"))
|
||||
confirmLabel:SetTextColor(defClr)
|
||||
confirmLabel:SizeToContents()
|
||||
self:CreateDivider(confirmPanel, TOP)
|
||||
|
||||
local confirmButton = confirmPanel:Add("DButton")
|
||||
CreateButton(confirmButton, "TARAMAYI ONAYLA", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
confirmButton:Dock(FILL)
|
||||
confirmButton:DockMargin(8, 8, 8, 8)
|
||||
confirmButton.DoClick = function(s)
|
||||
self:GetTerminalEntity():EmitSound("buttons/button18.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
net.Start("ix.terminal.Scan")
|
||||
net.WriteEntity(self:GetTerminalEntity())
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:ToInteraction()
|
||||
self.interactionPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.interactionPanel) then return end
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/combine_button1.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
self.interact = self.interactionPanel:Add("Panel")
|
||||
self.interact:SetWide(self.interactionPanel:GetWide() * 0.6)
|
||||
self.interact:SetTall(self.interactionPanel:GetTall() / 1.65)
|
||||
self.interact:Center()
|
||||
self.interact.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
self.interact:InvalidateParent(true)
|
||||
self.interact:SetAlpha(0)
|
||||
self:BuildInteraction(self.interact)
|
||||
|
||||
for _, child in pairs(self.interactionPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:OnDataDiscInsert(dData)
|
||||
if self.discPanel then
|
||||
self.bottomLabel:AlphaTo(0, 0.5)
|
||||
self.upperLabel:AlphaTo(0, 0.5)
|
||||
|
||||
self.discPanel:ColorTo(greenClr, 0.5, 0, function()
|
||||
self:GetTerminalEntity():EmitSound("buttons/combine_button5.wav", 55, 100, 1, nil, 0, 11)
|
||||
self.discPanel:AlphaTo(0, 0.5, 1, function()
|
||||
self.discPanel:Remove()
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:OnDiscRemoved()
|
||||
self:PurgeInnerContent()
|
||||
self:RequestDisc()
|
||||
end
|
||||
|
||||
function PANEL:IsUsedByLocalPlayer()
|
||||
return self:GetUsedBy() == LocalPlayer()
|
||||
end
|
||||
|
||||
function PANEL:Init()
|
||||
self:SetSize(scrwSrn, scrhSrn)
|
||||
self:SetPos(0, 0)
|
||||
self:SetAlpha(0)
|
||||
|
||||
self.innerContent = self:Add("Panel")
|
||||
self.innerContent:Dock(FILL)
|
||||
self.innerContent:DockMargin(118, 84, 118, 70)
|
||||
self.innerContent:InvalidateParent(true)
|
||||
self:SetPaintedManually( true )
|
||||
|
||||
self:AlphaTo(255, 0.5, 0, function()
|
||||
self:InitializeBootupSequence()
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:Destroy()
|
||||
self:AlphaTo(0, 0.5, 0, function(animData, pnl)
|
||||
self:GetTerminalEntity().terminalPanel = nil
|
||||
pnl:Remove()
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:Paint(w, h)
|
||||
surface.SetDrawColor(255, 255, 255, 100)
|
||||
surface.SetMaterial(screenMat)
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
|
||||
vgui.Register("ixDataEncoder", PANEL, "Panel")
|
||||
862
gamemodes/darkrp/plugins/goi_factory/derma/cl_fabpanel.lua
Normal file
862
gamemodes/darkrp/plugins/goi_factory/derma/cl_fabpanel.lua
Normal file
@@ -0,0 +1,862 @@
|
||||
--[[
|
||||
| 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 screenMat = Material("vgui/terminal_yellow.png", "smooth")
|
||||
local frameMat = Material("vgui/gradient-d", "smooth")
|
||||
local cmbLabel = Material("willardnetworks/datafile/licensedisabled2.png", "smooth")
|
||||
local cmbLogo = Material("vgui/icons/cmb_logo.png", "smooth")
|
||||
local wnLogo = Material("vgui/icons/wi_logo.png", "smooth")
|
||||
local defClr = Color(255, 223, 136)
|
||||
local redClr = Color(200, 36, 36)
|
||||
local greenClr = Color(36, 200, 61)
|
||||
local backgroundColor = Color(9, 9, 9, 75)
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
AccessorFunc(PANEL, "terminalEntity", "TerminalEntity")
|
||||
AccessorFunc(PANEL, "usedBy", "UsedBy")
|
||||
AccessorFunc(PANEL, "disc", "Disc")
|
||||
|
||||
local scrwSrn, scrhSrn = 1300, 970
|
||||
|
||||
local function CreateButton(name, text, path, font, alignment)
|
||||
name:SetContentAlignment(alignment or 4)
|
||||
name:SetTextInset(alignment and 0 or 10, 0)
|
||||
name:SetFont(font or "WNTerminalMediumText")
|
||||
name:SetText(string.utf8upper(text))
|
||||
name.Paint = function(self, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:CreateNextPrev(parent, buttonFont, buttonAlign, prevFunc, nextFunc, bHorizontal, manualWidth)
|
||||
local nextButton = parent:Add("DButton")
|
||||
CreateButton(nextButton, "next", buttonFont, buttonAlign)
|
||||
nextButton.DoClick = nextFunc
|
||||
|
||||
local prevButton = parent:Add("DButton")
|
||||
CreateButton(prevButton, "previous", buttonFont, buttonAlign)
|
||||
prevButton.DoClick = prevFunc
|
||||
|
||||
if !bHorizontal then
|
||||
nextButton:Dock(TOP)
|
||||
nextButton:SetTall(parent:GetTall() / 2.1)
|
||||
nextButton:DockMargin(2, 2, 2, 2)
|
||||
prevButton:Dock(FILL)
|
||||
prevButton:DockMargin(2, 2, 2, 2)
|
||||
else
|
||||
prevButton:Dock(LEFT)
|
||||
prevButton:DockMargin(5, 5, 5, 5)
|
||||
prevButton:SetWide(manualWidth or parent:GetWide() / 2)
|
||||
nextButton:Dock(FILL)
|
||||
nextButton:DockMargin(5, 5, 5, 5)
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:CreateDivider(parent, dock, bVertical)
|
||||
local divider = parent:Add("Panel")
|
||||
divider:Dock(dock)
|
||||
divider:DockMargin(8, 8, 8, 8)
|
||||
divider:SetHeight(10)
|
||||
divider.bVertical = bVertical
|
||||
divider.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
if !bVertical then
|
||||
surface.DrawLine(0, h * 0.5, w, h * 0.5)
|
||||
else
|
||||
surface.DrawLine(w * 0.5, 0, w * 0.5, h)
|
||||
end
|
||||
end
|
||||
|
||||
return divider
|
||||
end
|
||||
|
||||
function PANEL:CreateAnimatedFrame(parent, dock, dockL, dockT, dockR, dockB, frameClr, callback)
|
||||
local panel = parent:Add("Panel")
|
||||
AccessorFunc(panel, "color", "Color")
|
||||
|
||||
panel:DockMargin(dockL, dockT, dockR, dockB)
|
||||
panel:Dock(dock)
|
||||
panel:InvalidateParent(true)
|
||||
|
||||
panel:SetColor(frameClr)
|
||||
|
||||
local wCoef = 0
|
||||
local hCoef = 0
|
||||
local anim = self:NewAnimation( 0.75, 0, -1)
|
||||
anim.Think = function( s, pnl, fraction )
|
||||
wCoef = fraction
|
||||
end
|
||||
local anim2 = self:NewAnimation( 0.8, 0.85, -1, function( s, pnl )
|
||||
if callback then
|
||||
callback()
|
||||
end
|
||||
end )
|
||||
anim2.Think = function( s, pnl, fraction )
|
||||
hCoef = fraction
|
||||
end
|
||||
|
||||
panel.Paint = function(s, w, h)
|
||||
w = w * wCoef
|
||||
h = h * hCoef
|
||||
|
||||
local clr = s:GetColor()
|
||||
clr.a = 100
|
||||
|
||||
surface.SetDrawColor(43, 42, 42, 200)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(clr)
|
||||
surface.SetMaterial(frameMat)
|
||||
surface.DrawTexturedRect(0, h * 0.95, w, h * 0.05)
|
||||
|
||||
surface.SetDrawColor(clr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
return panel
|
||||
end
|
||||
|
||||
function PANEL:PurgeInnerContent()
|
||||
for _, pnl in pairs(self.innerContent:GetChildren()) do
|
||||
pnl:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:CreateLock()
|
||||
self.lockPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.lockPanel) then return end
|
||||
|
||||
self.lockPanel:ColorTo(redClr, 0.5)
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button8.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
self.bottomWarning = self.lockPanel:Add("DLabel")
|
||||
self.bottomWarning:SetFont("WNTerminalLargeText")
|
||||
self.bottomWarning:SetText(string.utf8upper("this terminal is occupied"))
|
||||
self.bottomWarning:SetTextColor(redClr)
|
||||
self.bottomWarning:Dock(BOTTOM)
|
||||
self.bottomWarning:DockMargin(0, 0, 0, 32)
|
||||
self.bottomWarning:SetContentAlignment(5)
|
||||
self.bottomWarning:SizeToContents()
|
||||
self.bottomWarning:SetAlpha(0)
|
||||
|
||||
self.warningIcon = self.lockPanel:Add("DLabel")
|
||||
self.warningIcon:SetFont("WNTerminalVeryLargeText")
|
||||
self.warningIcon:SetTextColor(redClr)
|
||||
self.warningIcon:SetText("!")
|
||||
self.warningIcon:SetContentAlignment(5)
|
||||
self.warningIcon:Center()
|
||||
self.warningIcon:SetAlpha(0)
|
||||
self.warningIcon:SizeToContents()
|
||||
self.warningIcon.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(redClr)
|
||||
surface.DrawCircle(26, 133, 75)
|
||||
end
|
||||
|
||||
local alphishRedClr = redClr
|
||||
alphishRedClr.a = 50
|
||||
self.upperWarning = self.lockPanel:Add("DLabel")
|
||||
self.upperWarning:Dock(TOP)
|
||||
self.upperWarning:DockMargin(1, 64, 1, 0)
|
||||
self.upperWarning:SetHeight(self:GetParent():GetTall() * 0.1)
|
||||
self.upperWarning:SetContentAlignment(5)
|
||||
self.upperWarning:SetFont("WNTerminalMediumText")
|
||||
self.upperWarning:SetText(string.utf8upper("[PLEASE BE PATIENT // WAIT FOR YOUR TURN]"))
|
||||
self.upperWarning:SetTextColor(defClr)
|
||||
self.upperWarning.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(redClr)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetMaterial(cmbLabel)
|
||||
surface.SetDrawColor(alphishRedClr)
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
self.upperWarning:SetAlpha(0)
|
||||
|
||||
for _, child in pairs(self.lockPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:InitializeBootupSequence()
|
||||
self.wnLogo = self.innerContent:Add("Panel")
|
||||
self.wnLogo:SetSize(500, 500)
|
||||
self.wnLogo:CenterHorizontal(0.25)
|
||||
self.wnLogo:CenterVertical(0.5)
|
||||
self.wnLogo.Paint = function(s, w, h)
|
||||
surface.SetMaterial(wnLogo)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
self.wnLogo:SetAlpha(0)
|
||||
|
||||
self.cmbLogo = self.innerContent:Add("Panel")
|
||||
self.cmbLogo:SetSize(400, 500)
|
||||
self.cmbLogo:CenterHorizontal(0.75)
|
||||
self.cmbLogo:CenterVertical(0.5)
|
||||
self.cmbLogo.Paint = function(s, w, h)
|
||||
surface.SetMaterial(cmbLogo)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
self.cmbLogo:SetAlpha(0)
|
||||
|
||||
self.indicator = self.innerContent:Add("Panel")
|
||||
self.indicator:SetWide(2)
|
||||
self.indicator:SetHeight(self.innerContent:GetTall() - 2)
|
||||
self.indicator:Center()
|
||||
self.indicator:SetAlpha(0)
|
||||
|
||||
local defClrAlphish = defClr
|
||||
defClrAlphish.a = 100
|
||||
self.indicator.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(defClrAlphish)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
end
|
||||
|
||||
for _, child in pairs(self.innerContent:GetChildren()) do
|
||||
child:AlphaTo(255, 0.25, 0, function()
|
||||
self:GetTerminalEntity():EmitSound("wn_goi/terminal_turnon.mp3", 55, 100, 1, CHAN_VOICE, 0, 11)
|
||||
end)
|
||||
end
|
||||
|
||||
self.indicator:SizeTo(-1, 0, 1, 0.25, -1, function()
|
||||
self.cmbLogo:MoveTo(self.innerContent:GetWide() / 2.72, self.cmbLogo:GetY(), 1)
|
||||
self.cmbLogo:AlphaTo(0, 0.15, 0.5)
|
||||
self.wnLogo:MoveTo(self.innerContent:GetWide() / 3.5, self.wnLogo:GetY(), 1, 0, -1, function()
|
||||
self.wnLogo:AlphaTo(0, 0.25, 1.5, function()
|
||||
for _, child in pairs(self.innerContent:GetChildren()) do
|
||||
child:Remove()
|
||||
end
|
||||
self:Proceed()
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:OnDiscDetach()
|
||||
if (self.fabricatingPanel) then
|
||||
self:PurgeInnerContent()
|
||||
self:CreateFabricating()
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:OnDiscAttach()
|
||||
if (self.fabricatingPanel) then
|
||||
self:PurgeInnerContent()
|
||||
self:CreateFabricating()
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:FillDiscInteraction(parent)
|
||||
local itemID = self:GetDisc()
|
||||
if !itemID then return end
|
||||
|
||||
local item = ix.item.list[itemID]
|
||||
self.itemIcon = parent:Add("SpawnIcon")
|
||||
self.itemIcon:SetSize(176, 176)
|
||||
self.itemIcon:SetModel(item.model)
|
||||
self.itemIcon:Center()
|
||||
self.itemIcon.PaintOver = function(s, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
local itemName = parent:Add("DLabel")
|
||||
itemName:Dock(TOP)
|
||||
itemName:DockMargin(0, 16, 0, 0)
|
||||
itemName:SetContentAlignment(5)
|
||||
itemName:SetFont("WNTerminalMediumText")
|
||||
itemName:SetText(string.utf8upper("encoded item: " .. item.name))
|
||||
itemName:SetTextColor(defClr)
|
||||
itemName:SizeToContents()
|
||||
self:CreateDivider(parent, TOP)
|
||||
|
||||
local fabricateButtonPanel = parent:Add("Panel")
|
||||
fabricateButtonPanel:Dock(BOTTOM)
|
||||
fabricateButtonPanel:SetTall(64)
|
||||
fabricateButtonPanel:DockMargin(128, 0, 128, 16)
|
||||
fabricateButtonPanel.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
local fabButton = fabricateButtonPanel:Add("DButton")
|
||||
CreateButton(fabButton, "SYNTHESIZE", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
fabButton:Dock(FILL)
|
||||
fabButton:DockMargin(8, 8, 450, 8)
|
||||
fabButton.DoClick = function(s)
|
||||
self:GetTerminalEntity():EmitSound("buttons/button4.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
net.Start("ix.terminal.Fabricate")
|
||||
net.WriteEntity(self:GetTerminalEntity())
|
||||
net.WriteBool(false)
|
||||
net.WriteInt(1, 5)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local fabButtonMass = fabricateButtonPanel:Add("DButton")
|
||||
CreateButton(fabButtonMass, "BULK SYNTHESIZE", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
fabButtonMass:Dock(FILL)
|
||||
fabButtonMass:DockMargin(450, 8, 8, 8)
|
||||
fabButtonMass.DoClick = function(s)
|
||||
self:GetTerminalEntity():EmitSound("buttons/button4.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
net.Start("ix.terminal.Fabricate")
|
||||
net.WriteEntity(self:GetTerminalEntity())
|
||||
net.WriteBool(true)
|
||||
net.WriteInt(5, 5)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local resinLabel = parent:Add("DLabel")
|
||||
resinLabel:Dock(BOTTOM)
|
||||
resinLabel:DockMargin(0, 0, 0, 8)
|
||||
resinLabel:SetContentAlignment(5)
|
||||
resinLabel:SetFont("WNTerminalMediumText")
|
||||
resinLabel:SetText(string.utf8upper("resin amount required: " .. ix.fabrication:Get(itemID).mainMaterialCost))
|
||||
resinLabel:SetTextColor(defClr)
|
||||
resinLabel:SizeToContents()
|
||||
end
|
||||
|
||||
function PANEL:CreateFabricating()
|
||||
self:PurgeInnerContent()
|
||||
self.fabricatingPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.fabricatingPanel) then return end
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button6.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
local returnButton = self.fabricatingPanel:Add("DButton")
|
||||
CreateButton(returnButton, "RETURN", "buttonnoarrow.png", "WNTerminalLargeText", 5)
|
||||
returnButton:Dock(TOP)
|
||||
returnButton:SetTall(128)
|
||||
returnButton:DockMargin(8, 8, 8, 8)
|
||||
returnButton.DoClick = function(s)
|
||||
if s.bClosing then return end
|
||||
s.bClosing = true
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button18.wav", 55, 100, 1, nil, 0, 11)
|
||||
self.fabricatingPanel:AlphaTo(0, 0.5, 0, function()
|
||||
self:PurgeInnerContent()
|
||||
self:CreateSelector()
|
||||
end)
|
||||
end
|
||||
returnButton:SetAlpha(0)
|
||||
|
||||
if (!self:GetDisc() or self:GetDisc() == "") then
|
||||
local errorLabel = self.fabricatingPanel:Add("DLabel")
|
||||
errorLabel:SetContentAlignment(5)
|
||||
errorLabel:SetFont("WNTerminalLargeText")
|
||||
errorLabel:SetText(string.utf8upper("encoded data\ndisk required!"))
|
||||
errorLabel:SetTextColor(defClr)
|
||||
errorLabel:SetAlpha(0)
|
||||
errorLabel:SizeToContents()
|
||||
errorLabel:CenterHorizontal(0.525)
|
||||
errorLabel:CenterVertical(0.5)
|
||||
for _, child in pairs(self.fabricatingPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local upperLabel = self.fabricatingPanel:Add("DLabel")
|
||||
upperLabel:Dock(TOP)
|
||||
upperLabel:SetContentAlignment(5)
|
||||
upperLabel:SetFont("WNTerminalLargeText")
|
||||
upperLabel:SetText(string.utf8upper("encoded info"))
|
||||
upperLabel:SetTextColor(defClr)
|
||||
upperLabel:SetAlpha(0)
|
||||
upperLabel:SizeToContents()
|
||||
|
||||
local d = self:CreateDivider(self.fabricatingPanel, TOP)
|
||||
d:SetAlpha(0)
|
||||
|
||||
self.eFab = self.fabricatingPanel:Add("Panel")
|
||||
self.eFab:Dock(FILL)
|
||||
self.eFab:DockMargin(16, 16, 16, 48)
|
||||
self.eFab:InvalidateParent(true)
|
||||
self.eFab.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
self.eFab:SetAlpha(0)
|
||||
self:FillDiscInteraction(self.eFab)
|
||||
|
||||
for _, child in pairs(self.fabricatingPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:FillRecycleInteraction(parent)
|
||||
local fcLabel = parent:Add("DLabel")
|
||||
fcLabel:Dock(TOP)
|
||||
fcLabel:DockMargin(0, 32, 0, 0)
|
||||
fcLabel:SetContentAlignment(5)
|
||||
fcLabel:SetFont("WNTerminalMediumText")
|
||||
fcLabel:SetText(string.utf8upper("fabricator controls"))
|
||||
fcLabel:SetTextColor(defClr)
|
||||
fcLabel:SizeToContents()
|
||||
|
||||
local wLabel = parent:Add("DLabel")
|
||||
wLabel:Dock(TOP)
|
||||
wLabel:DockMargin(0, 8, 0, 0)
|
||||
wLabel:SetContentAlignment(5)
|
||||
wLabel:SetFont("WNTerminalMediumText")
|
||||
wLabel:SetText(string.utf8upper("[keep your hands away from fabricator depot]"))
|
||||
wLabel:SetTextColor(defClr)
|
||||
wLabel:SizeToContents()
|
||||
|
||||
local buttonsPanel = parent:Add("Panel")
|
||||
buttonsPanel:Dock(FILL)
|
||||
buttonsPanel:DockMargin(parent:GetWide() / 3, 8, parent:GetWide() / 3, 16)
|
||||
buttonsPanel:InvalidateParent(true)
|
||||
buttonsPanel.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
local toggleDepot = buttonsPanel:Add("DButton")
|
||||
CreateButton(toggleDepot, "open\n/\nclose", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
toggleDepot:Dock(LEFT)
|
||||
toggleDepot:SetWide(buttonsPanel:GetWide() / 2.15)
|
||||
toggleDepot:DockMargin(8, 8, 4, 8)
|
||||
toggleDepot.DoClick = function(s)
|
||||
self:GetTerminalEntity():EmitSound("buttons/button4.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
net.Start("ix.terminal.ToggleDepot")
|
||||
net.WriteEntity(self:GetTerminalEntity())
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local recycle = buttonsPanel:Add("DButton")
|
||||
CreateButton(recycle, "recycle", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
recycle:Dock(FILL)
|
||||
recycle:DockMargin(4, 8, 8, 8)
|
||||
recycle.DoClick = function(s)
|
||||
self:GetTerminalEntity():EmitSound("buttons/button4.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
net.Start("ix.terminal.Recycle")
|
||||
net.WriteEntity(self:GetTerminalEntity())
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:CreateRecycling()
|
||||
self:PurgeInnerContent()
|
||||
self.recyclingPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.recyclingPanel) then return end
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button6.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
local returnButton = self.recyclingPanel:Add("DButton")
|
||||
CreateButton(returnButton, "RETURN", "buttonnoarrow.png", "WNTerminalLargeText", 5)
|
||||
returnButton:Dock(TOP)
|
||||
returnButton:SetTall(128)
|
||||
returnButton:DockMargin(8, 8, 8, 8)
|
||||
returnButton.DoClick = function(s)
|
||||
if s.bClosing then return end
|
||||
s.bClosing = true
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button18.wav", 55, 100, 1, nil, 0, 11)
|
||||
self.recyclingPanel:AlphaTo(0, 0.5, 0, function()
|
||||
self:PurgeInnerContent()
|
||||
self:CreateSelector()
|
||||
end)
|
||||
end
|
||||
returnButton:SetAlpha(0)
|
||||
|
||||
local upperLabel = self.recyclingPanel:Add("DLabel")
|
||||
upperLabel:Dock(TOP)
|
||||
upperLabel:SetContentAlignment(5)
|
||||
upperLabel:SetFont("WNTerminalLargeText")
|
||||
upperLabel:SetText(string.utf8upper("recycling"))
|
||||
upperLabel:SetTextColor(defClr)
|
||||
upperLabel:SetAlpha(0)
|
||||
upperLabel:SizeToContents()
|
||||
|
||||
local d = self:CreateDivider(self.recyclingPanel, TOP)
|
||||
d:SetAlpha(0)
|
||||
|
||||
self.recControl = self.recyclingPanel:Add("Panel")
|
||||
self.recControl:Dock(FILL)
|
||||
self.recControl:DockMargin(16, 16, 16, 48)
|
||||
self.recControl:InvalidateParent(true)
|
||||
self.recControl.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
self.recControl:SetAlpha(0)
|
||||
self:FillRecycleInteraction(self.recControl)
|
||||
|
||||
for _, child in pairs(self.recyclingPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:CreateOptionButtons(parent)
|
||||
local bClosing = false
|
||||
|
||||
local fabricate = parent:Add("DButton")
|
||||
CreateButton(fabricate, "FABRICATE", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
fabricate:Dock(LEFT)
|
||||
fabricate:DockMargin(8, 16, 4, 16)
|
||||
fabricate:SetWide(parent:GetWide() / 3)
|
||||
fabricate.DoClick = function(s)
|
||||
if bClosing then return end
|
||||
bClosing = true
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button18.wav", 55, 100, 1, nil, 0, 11)
|
||||
self.selectorPanel:AlphaTo(0, 0.5, 0, function()
|
||||
self:CreateFabricating()
|
||||
end)
|
||||
end
|
||||
|
||||
local recycle = parent:Add("DButton")
|
||||
CreateButton(recycle, "RECYCLE", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
recycle:Dock(LEFT)
|
||||
recycle:DockMargin(4, 32, 4, 32)
|
||||
recycle:SetWide(parent:GetWide() / 3)
|
||||
recycle.DoClick = function(s)
|
||||
if bClosing then return end
|
||||
bClosing = true
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button18.wav", 55, 100, 1, nil, 0, 11)
|
||||
self.selectorPanel:AlphaTo(0, 0.5, 0, function()
|
||||
self:CreateRecycling()
|
||||
end)
|
||||
end
|
||||
|
||||
local bioprocessing = parent:Add("DButton")
|
||||
CreateButton(bioprocessing, "BIOPROCESS", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
bioprocessing:Dock(FILL)
|
||||
bioprocessing:DockMargin(4, 16, 8, 16)
|
||||
bioprocessing.DoClick = function(s)
|
||||
if bClosing then return end
|
||||
bClosing = true
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button18.wav", 55, 100, 1, nil, 0, 11)
|
||||
self.selectorPanel:AlphaTo(0, 0.5, 0, function()
|
||||
self:CreateBioprocess()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:FillBioPanel(parent)
|
||||
local nextPrev = parent:Add("Panel")
|
||||
nextPrev:Dock(TOP)
|
||||
nextPrev:SetTall(80)
|
||||
nextPrev:InvalidateParent(true)
|
||||
nextPrev.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
local incrementFunc = function(s)
|
||||
self:GetTerminalEntity():EmitSound("willardnetworks/datapad/back.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
self.itemIcon:Increment()
|
||||
end
|
||||
local decrementFunc = function(s)
|
||||
self:GetTerminalEntity():EmitSound("willardnetworks/datapad/back.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
self.itemIcon:Decrement()
|
||||
end
|
||||
self:CreateNextPrev(nextPrev, nil, nil, decrementFunc, incrementFunc, true)
|
||||
|
||||
local bioprocessButtonPanel = parent:Add("Panel")
|
||||
bioprocessButtonPanel:Dock(BOTTOM)
|
||||
bioprocessButtonPanel:SetTall(64)
|
||||
bioprocessButtonPanel:DockMargin(128, 0, 128, 16)
|
||||
bioprocessButtonPanel.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
local bioButton = bioprocessButtonPanel:Add("DButton")
|
||||
CreateButton(bioButton, "SYNTHESIZE", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
bioButton:Dock(FILL)
|
||||
bioButton:DockMargin(8, 8, 450, 8)
|
||||
bioButton.DoClick = function(s)
|
||||
self:GetTerminalEntity():EmitSound("buttons/button4.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
net.Start("ix.terminal.Bioprocess")
|
||||
net.WriteEntity(self:GetTerminalEntity())
|
||||
net.WriteString(self.itemIcon.fabID)
|
||||
net.WriteBool(false)
|
||||
net.WriteInt(1, 5)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local bioButtonMass = bioprocessButtonPanel:Add("DButton")
|
||||
CreateButton(bioButtonMass, "BULK SYNTHESIZE", "buttonnoarrow.png", "WNTerminalMediumText", 5)
|
||||
bioButtonMass:Dock(FILL)
|
||||
bioButtonMass:DockMargin(450, 8, 8, 8)
|
||||
bioButtonMass.DoClick = function(s)
|
||||
self:GetTerminalEntity():EmitSound("buttons/button4.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
net.Start("ix.terminal.Bioprocess")
|
||||
net.WriteEntity(self:GetTerminalEntity())
|
||||
net.WriteString(self.itemIcon.fabID)
|
||||
net.WriteBool(true)
|
||||
net.WriteInt(5, 5)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local itemInfo = parent:Add("Panel")
|
||||
itemInfo:Dock(LEFT)
|
||||
itemInfo:DockMargin(0, 0, 0, 0)
|
||||
itemInfo:SetWide(400)
|
||||
|
||||
local itemName = itemInfo:Add("DLabel")
|
||||
itemName:Dock(TOP)
|
||||
itemName:DockMargin(16, 16, 0, 8)
|
||||
itemName:SetContentAlignment(5)
|
||||
itemName:SetFont("WNTerminalMediumText")
|
||||
itemName:SetText("")
|
||||
itemName:SetTextColor(defClr)
|
||||
|
||||
local itemMats = itemInfo:Add("DLabel")
|
||||
itemMats:Dock(TOP)
|
||||
itemMats:DockMargin(16, 16, 0, 8)
|
||||
itemMats:SetContentAlignment(5)
|
||||
itemMats:SetFont("WNTerminalMediumText")
|
||||
itemMats:SetText("")
|
||||
itemMats:SetTextColor(defClr)
|
||||
|
||||
local itemP = itemInfo:Add("DLabel")
|
||||
itemP:Dock(TOP)
|
||||
itemP:DockMargin(16, 16, 0, 8)
|
||||
itemP:SetContentAlignment(5)
|
||||
itemP:SetFont("WNTerminalMediumText")
|
||||
itemP:SetText("")
|
||||
itemP:SetTextColor(defClr)
|
||||
|
||||
self.itemIcon = parent:Add("SpawnIcon")
|
||||
self.itemIcon:SetSize(176, 176)
|
||||
self.itemIcon:SetModel("models/Gibs/HGIBS.mdl")
|
||||
self.itemIcon:CenterHorizontal(0.5)
|
||||
self.itemIcon:CenterVertical(0.55)
|
||||
self.itemIcon.PaintOver = function(s, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
self.itemIcon.SetItem = function(s, fabPos)
|
||||
s.fabID = self.biofabs[fabPos].id
|
||||
s.fab = self.biofabs[fabPos].fab
|
||||
s.fabPos = fabPos
|
||||
s:OnItemChanged()
|
||||
end
|
||||
|
||||
self.itemIcon.OnItemChanged = function(s)
|
||||
local curItem = ix.item.list[s.fabID]
|
||||
s:SetModel(curItem.model)
|
||||
itemName:SetText(string.utf8upper(curItem.name))
|
||||
itemMats:SetText(string.utf8upper("biopaste cost: " .. s.fab.mainMaterialCost))
|
||||
itemP:SetText("[ " .. s.fabPos .. " / " .. #self.biofabs .. " ]")
|
||||
end
|
||||
|
||||
self.itemIcon.Increment = function(s)
|
||||
if self.biofabs[s.fabPos + 1] then
|
||||
s:SetItem(s.fabPos + 1)
|
||||
end
|
||||
end
|
||||
|
||||
self.itemIcon.Decrement = function(s)
|
||||
if self.biofabs[s.fabPos - 1] then
|
||||
s:SetItem(s.fabPos - 1)
|
||||
end
|
||||
end
|
||||
|
||||
self.itemIcon:SetItem(1)
|
||||
end
|
||||
|
||||
function PANEL:CreateBioprocess()
|
||||
self:PurgeInnerContent()
|
||||
self.bioprocessPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.bioprocessPanel) then return end
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button6.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
local returnButton = self.bioprocessPanel:Add("DButton")
|
||||
CreateButton(returnButton, "RETURN", "buttonnoarrow.png", "WNTerminalLargeText", 5)
|
||||
returnButton:Dock(TOP)
|
||||
returnButton:SetTall(128)
|
||||
returnButton:DockMargin(8, 8, 8, 8)
|
||||
returnButton.DoClick = function(s)
|
||||
if s.bClosing then return end
|
||||
s.bClosing = true
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/button18.wav", 55, 100, 1, nil, 0, 11)
|
||||
self.bioprocessPanel:AlphaTo(0, 0.5, 0, function()
|
||||
self:PurgeInnerContent()
|
||||
self:CreateSelector()
|
||||
end)
|
||||
end
|
||||
returnButton:SetAlpha(0)
|
||||
|
||||
local upperLabel = self.bioprocessPanel:Add("DLabel")
|
||||
upperLabel:Dock(TOP)
|
||||
upperLabel:SetContentAlignment(5)
|
||||
upperLabel:SetFont("WNTerminalLargeText")
|
||||
upperLabel:SetText(string.utf8upper("bioprocessing"))
|
||||
upperLabel:SetTextColor(defClr)
|
||||
upperLabel:SetAlpha(0)
|
||||
upperLabel:SizeToContents()
|
||||
|
||||
local d = self:CreateDivider(self.bioprocessPanel, TOP)
|
||||
d:SetAlpha(0)
|
||||
|
||||
self.bioPanel = self.bioprocessPanel:Add("Panel")
|
||||
self.bioPanel:Dock(FILL)
|
||||
self.bioPanel:DockMargin(16, 16, 16, 48)
|
||||
self.bioPanel:InvalidateParent(true)
|
||||
self.bioPanel.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
self.bioPanel:SetAlpha(0)
|
||||
self:FillBioPanel(self.bioPanel)
|
||||
|
||||
for _, child in pairs(self.bioprocessPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:CreateSelector()
|
||||
self.selectorPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.selectorPanel) then return end
|
||||
|
||||
self:GetTerminalEntity():EmitSound("buttons/combine_button1.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
local upperLabel = self.selectorPanel:Add("DLabel")
|
||||
upperLabel:Dock(TOP)
|
||||
upperLabel:DockMargin(0, 36, 0, 6)
|
||||
upperLabel:SetContentAlignment(5)
|
||||
upperLabel:SetFont("WNTerminalLargeText")
|
||||
upperLabel:SetText("PROCEEDING")
|
||||
upperLabel:SetTextColor(defClr)
|
||||
upperLabel:SetAlpha(0)
|
||||
upperLabel:SizeToContents()
|
||||
|
||||
local d = self:CreateDivider(self.selectorPanel, TOP)
|
||||
d:SetAlpha(0)
|
||||
|
||||
self.sButtonPanel = self.selectorPanel:Add("Panel")
|
||||
self.sButtonPanel:Dock(FILL)
|
||||
self.sButtonPanel:DockMargin(106, 36, 106, 112)
|
||||
self.sButtonPanel:InvalidateParent(true)
|
||||
self.sButtonPanel:SetAlpha(0)
|
||||
self.sButtonPanel.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
self:CreateOptionButtons(self.sButtonPanel)
|
||||
|
||||
for _, child in pairs(self.selectorPanel:GetChildren()) do
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:Proceed()
|
||||
if (!self:IsUsedByLocalPlayer()) then
|
||||
self:CreateLock()
|
||||
else
|
||||
self:CreateSelector()
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:IsUsedByLocalPlayer()
|
||||
return self:GetUsedBy() == LocalPlayer()
|
||||
end
|
||||
|
||||
function PANEL:SortBiofabs()
|
||||
self.biofabs = {}
|
||||
for id, fab in pairs(ix.fabrication.list) do
|
||||
if fab.category != "bio" then continue end
|
||||
|
||||
self.biofabs[#self.biofabs + 1] = {
|
||||
id = id,
|
||||
fab = fab,
|
||||
fabPos = #self.biofabs + 1
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:Init()
|
||||
self:SetSize(scrwSrn, scrhSrn)
|
||||
self:SetPos(0, 0)
|
||||
self:SetAlpha(0)
|
||||
|
||||
self.innerContent = self:Add("Panel")
|
||||
self.innerContent:Dock(FILL)
|
||||
self.innerContent:DockMargin(84, 94, 84, 78)
|
||||
self.innerContent:InvalidateParent(true)
|
||||
self:SetPaintedManually( true )
|
||||
|
||||
self:SortBiofabs()
|
||||
|
||||
self:AlphaTo(255, 0.5, 0, function()
|
||||
self:InitializeBootupSequence()
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:Destroy()
|
||||
self:AlphaTo(0, 0.5, 0, function(animData, pnl)
|
||||
self:GetTerminalEntity().terminalPanel = nil
|
||||
pnl:Remove()
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:Paint(w, h)
|
||||
surface.SetDrawColor(255, 255, 255, 200)
|
||||
surface.SetMaterial(screenMat)
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
|
||||
vgui.Register("ixFabricator", PANEL, "Panel")
|
||||
374
gamemodes/darkrp/plugins/goi_factory/derma/cl_shopterminal.lua
Normal file
374
gamemodes/darkrp/plugins/goi_factory/derma/cl_shopterminal.lua
Normal file
@@ -0,0 +1,374 @@
|
||||
--[[
|
||||
| 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 screenMat = Material("willardnetworks/datafile/workshifterminal.png", "smooth")
|
||||
local frameMat = Material("vgui/gradient-d", "smooth")
|
||||
local cmbLabel = Material("willardnetworks/datafile/licensedisabled2.png", "smooth")
|
||||
local defClr = Color(16, 224, 207)
|
||||
local redClr = Color(200, 36, 36)
|
||||
local greenClr = Color(36, 200, 61)
|
||||
local backgroundColor = Color(9, 9, 9, 75)
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
AccessorFunc(PANEL, "terminalEntity", "TerminalEntity")
|
||||
|
||||
local scrwSrn, scrhSrn = 1600, 1400
|
||||
|
||||
PANEL.shopTerminal = true
|
||||
|
||||
local function CreateButton(name, text, path, font, alignment)
|
||||
name:SetContentAlignment(alignment or 4)
|
||||
name:SetTextInset(alignment and 0 or 10, 0)
|
||||
name:SetFont(font or "WNTerminalMediumText")
|
||||
name:SetText(string.utf8upper(text))
|
||||
name.Paint = function(self, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:CreateDivider(parent, dock, bVertical)
|
||||
local divider = parent:Add("Panel")
|
||||
divider:Dock(dock)
|
||||
divider:DockMargin(8, 8, 8, 8)
|
||||
divider:SetHeight(10)
|
||||
divider.bVertical = bVertical
|
||||
divider.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
if !bVertical then
|
||||
surface.DrawLine(0, h * 0.5, w, h * 0.5)
|
||||
else
|
||||
surface.DrawLine(w * 0.5, 0, w * 0.5, h)
|
||||
end
|
||||
end
|
||||
|
||||
return divider
|
||||
end
|
||||
|
||||
function PANEL:CreateAnimatedFrame(parent, dock, dockL, dockT, dockR, dockB, frameClr, callback)
|
||||
local panel = parent:Add("Panel")
|
||||
AccessorFunc(panel, "color", "Color")
|
||||
|
||||
panel:DockMargin(dockL, dockT, dockR, dockB)
|
||||
panel:Dock(dock)
|
||||
panel:InvalidateParent(true)
|
||||
|
||||
panel:SetColor(frameClr)
|
||||
panel:SetAlpha(0)
|
||||
|
||||
panel:AlphaTo(255, 0.75, 0, function()
|
||||
if callback then
|
||||
callback()
|
||||
end
|
||||
end)
|
||||
|
||||
panel.Paint = function(s, w, h)
|
||||
local clr = s:GetColor()
|
||||
clr.a = 100
|
||||
|
||||
surface.SetDrawColor(43, 42, 42, 200)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(clr)
|
||||
surface.SetMaterial(frameMat)
|
||||
surface.DrawTexturedRect(0, h * 0.95, w, h * 0.05)
|
||||
|
||||
surface.SetDrawColor(clr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
return panel
|
||||
end
|
||||
|
||||
function PANEL:CreateNextPrev(parent, buttonFont, buttonAlign, prevFunc, nextFunc, bHorizontal, manualWidth)
|
||||
print(buttonFont)
|
||||
local nextButton = parent:Add("DButton")
|
||||
CreateButton(nextButton, "next", nil, buttonFont, buttonAlign)
|
||||
nextButton.DoClick = nextFunc
|
||||
|
||||
local prevButton = parent:Add("DButton")
|
||||
CreateButton(prevButton, "previous", nil, buttonFont, buttonAlign)
|
||||
prevButton.DoClick = prevFunc
|
||||
|
||||
if !bHorizontal then
|
||||
nextButton:Dock(TOP)
|
||||
nextButton:SetTall(parent:GetTall() / 2.1)
|
||||
nextButton:DockMargin(2, 2, 2, 2)
|
||||
prevButton:Dock(FILL)
|
||||
prevButton:DockMargin(2, 2, 2, 2)
|
||||
else
|
||||
prevButton:Dock(LEFT)
|
||||
prevButton:DockMargin(5, 5, 5, 5)
|
||||
prevButton:SetWide(manualWidth or parent:GetWide() / 2)
|
||||
nextButton:Dock(FILL)
|
||||
nextButton:DockMargin(5, 5, 5, 5)
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:Init()
|
||||
self:SetSize(scrwSrn, scrhSrn)
|
||||
self:SetPos(0, 0)
|
||||
|
||||
self.innerContent = self:Add("Panel")
|
||||
self.innerContent:Dock(FILL)
|
||||
self.innerContent:DockMargin(107, 134, 107, 114)
|
||||
self.innerContent:InvalidateParent(true)
|
||||
self:SetPaintedManually( true )
|
||||
|
||||
self.selectedPermits = 0
|
||||
self.permits = {}
|
||||
for k, permit in pairs(ix.permits.list) do
|
||||
self.permits[#self.permits + 1] = {id = k, pInfo = permit, selected = false}
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:PurgeInnerContent()
|
||||
for _, pnl in pairs(self.innerContent:GetChildren()) do
|
||||
pnl:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:CreatePermitSelector(parent)
|
||||
local nextPrev = parent:Add("Panel")
|
||||
nextPrev:Dock(TOP)
|
||||
nextPrev:SetTall(parent:GetTall() / 2)
|
||||
nextPrev:InvalidateParent(true)
|
||||
nextPrev.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
local incrementFunc = function(s)
|
||||
self:GetTerminalEntity():EmitSound("willardnetworks/datapad/back.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
if (self.curPermit) then
|
||||
self.curPermit:Increment()
|
||||
end
|
||||
end
|
||||
local decrementFunc = function(s)
|
||||
self:GetTerminalEntity():EmitSound("willardnetworks/datapad/back.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
if (self.curPermit) then
|
||||
self.curPermit:Decrement()
|
||||
end
|
||||
end
|
||||
self:CreateNextPrev(nextPrev, "WNTerminalMediumText", 5, decrementFunc, incrementFunc, true)
|
||||
|
||||
self.curPermit = parent:Add("DLabel")
|
||||
self.curPermit:Dock(FILL)
|
||||
self.curPermit:DockMargin(6, 6, 6, 6)
|
||||
self.curPermit:SetContentAlignment(5)
|
||||
self.curPermit:SetFont("WNTerminalLargeText")
|
||||
self.curPermit:SetText(string.utf8upper(self.permits[1].id))
|
||||
self.curPermit:SizeToContents()
|
||||
self.curPermit.pos = 1
|
||||
self.curPermit:SetTextColor(self.permits[self.curPermit.pos].selected and greenClr or redClr)
|
||||
|
||||
self.curPermit.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
self.curPermit.Increment = function(s)
|
||||
if self.permits[s.pos + 1] then
|
||||
s.pos = s.pos + 1
|
||||
s:Update()
|
||||
end
|
||||
end
|
||||
|
||||
self.curPermit.Decrement = function(s)
|
||||
if self.permits[s.pos - 1] then
|
||||
s.pos = s.pos - 1
|
||||
s:Update()
|
||||
end
|
||||
end
|
||||
|
||||
self.curPermit.Update = function(s)
|
||||
s:SetText(string.utf8upper(self.permits[s.pos].id))
|
||||
s:SetTextColor(self.permits[s.pos].selected and greenClr or redClr)
|
||||
|
||||
if self.sPermits then
|
||||
self.sPermits:SetText(string.utf8upper("selected permits: ").."["..self.selectedPermits.."/3]")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:CanSelectPermit()
|
||||
return self.selectedPermits < 3
|
||||
end
|
||||
|
||||
function PANEL:BuildShopPanel(shop)
|
||||
self:PurgeInnerContent()
|
||||
|
||||
self.shopPanel = self:CreateAnimatedFrame(self.innerContent, FILL, 0, 0, 0, 0,
|
||||
defClr,
|
||||
function()
|
||||
if !IsValid(self.shopPanel) then return end
|
||||
|
||||
for _, child in pairs(self.shopPanel:GetChildren()) do
|
||||
child:Remove()
|
||||
end
|
||||
|
||||
local upperLabel = self.shopPanel:Add("DLabel")
|
||||
upperLabel:Dock(TOP)
|
||||
upperLabel:DockMargin(0, 32, 0, 0)
|
||||
upperLabel:SetContentAlignment(5)
|
||||
upperLabel:SetFont("WNTerminalMoreLargerText")
|
||||
upperLabel:SetText(string.utf8upper("shop terminal"))
|
||||
upperLabel:SetTextColor(defClr)
|
||||
upperLabel:SizeToContents()
|
||||
|
||||
self:CreateDivider(self.shopPanel, TOP)
|
||||
|
||||
if shop.shopName and shop.cost and shop.scReq and shop.rent then
|
||||
self.shopName = self.shopPanel:Add("DLabel")
|
||||
self.shopName:Dock(TOP)
|
||||
self.shopName:DockMargin(0, 8, 0, 0)
|
||||
self.shopName:SetContentAlignment(5)
|
||||
self.shopName:SetFont("WNTerminalLargeText")
|
||||
self.shopName:SetText(string.utf8upper(shop.shopName))
|
||||
self.shopName:SetTextColor(defClr)
|
||||
self.shopName:SizeToContents()
|
||||
|
||||
self.shopInfo = self.shopPanel:Add("DLabel")
|
||||
self.shopInfo:Dock(TOP)
|
||||
self.shopInfo:DockMargin(0, 8, 0, 0)
|
||||
self.shopInfo:SetContentAlignment(5)
|
||||
self.shopInfo:SetFont("WNTerminalLargeText")
|
||||
self.shopInfo:SetText(string.utf8upper("sc req: ")..shop.scReq.." | "..shop.cost..string.utf8upper(" credits").." | " .. shop.rent .. string.utf8upper(" rent"))
|
||||
self.shopInfo:SetTextColor(defClr)
|
||||
self.shopInfo:SizeToContents()
|
||||
|
||||
self:CreateDivider(self.shopPanel, TOP)
|
||||
|
||||
local isPurchasable = self:GetTerminalEntity():GetNetVar("isPurchasable", false)
|
||||
self.isPurchasable = self.shopPanel:Add("DLabel")
|
||||
self.isPurchasable:Dock(TOP)
|
||||
self.isPurchasable:DockMargin(0, 8, 0, 0)
|
||||
self.isPurchasable:SetContentAlignment(5)
|
||||
self.isPurchasable:SetFont("WNTerminalLargeText")
|
||||
self.isPurchasable:SetText(isPurchasable and string.utf8upper("this shop is purchasable") or string.utf8upper("this shop is not purchasable"))
|
||||
self.isPurchasable:SetTextColor(isPurchasable and greenClr or redClr)
|
||||
self.isPurchasable:SizeToContents()
|
||||
|
||||
self:CreateDivider(self.shopPanel, TOP)
|
||||
|
||||
if isPurchasable then
|
||||
local permitSelector = self.shopPanel:Add("Panel")
|
||||
permitSelector:Dock(TOP)
|
||||
permitSelector:DockMargin(16, 8, 16, 0)
|
||||
permitSelector:SetTall(168)
|
||||
permitSelector:InvalidateParent(true)
|
||||
self:CreatePermitSelector(permitSelector)
|
||||
|
||||
self.selectPermit = self.shopPanel:Add("DButton")
|
||||
CreateButton(self.selectPermit, "toggle permit", nil, "WNTerminalMediumText", 5)
|
||||
self.selectPermit:Dock(TOP)
|
||||
self.selectPermit:DockMargin(32, 0, 32, 0)
|
||||
self.selectPermit:SizeToContents()
|
||||
self.selectPermit.DoClick = function()
|
||||
if self.permits[self.curPermit.pos].selected then
|
||||
self.selectedPermits = self.selectedPermits - 1
|
||||
self.permits[self.curPermit.pos].selected = !self.permits[self.curPermit.pos].selected
|
||||
self.curPermit:Update()
|
||||
self:GetTerminalEntity():EmitSound("buttons/button18.wav", 55, 100, 1, nil, 0, 11)
|
||||
else
|
||||
if self:CanSelectPermit() then
|
||||
self.selectedPermits = self.selectedPermits + 1
|
||||
self.permits[self.curPermit.pos].selected = !self.permits[self.curPermit.pos].selected
|
||||
self.curPermit:Update()
|
||||
self:GetTerminalEntity():EmitSound("buttons/button18.wav", 55, 100, 1, nil, 0, 11)
|
||||
else
|
||||
self:GetTerminalEntity():EmitSound("buttons/button8.wav", 55, 100, 1, nil, 0, 11)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.sPermits = self.shopPanel:Add("DLabel")
|
||||
self.sPermits:Dock(TOP)
|
||||
self.sPermits:DockMargin(0, 8, 0, 0)
|
||||
self.sPermits:SetContentAlignment(5)
|
||||
self.sPermits:SetFont("WNTerminalMediumText")
|
||||
self.sPermits:SetTextColor(defClr)
|
||||
self.sPermits:SetText(string.utf8upper("selected permits: ").."["..self.selectedPermits.."/3]")
|
||||
self.sPermits:SizeToContents()
|
||||
|
||||
local buttonPanel = self.shopPanel:Add("Panel")
|
||||
buttonPanel:Dock(BOTTOM)
|
||||
buttonPanel:DockMargin(12, 0, 12, 108)
|
||||
buttonPanel:SetTall(108)
|
||||
buttonPanel.Paint = function(s, w, h)
|
||||
surface.SetDrawColor(backgroundColor)
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
surface.SetDrawColor(defClr)
|
||||
surface.DrawOutlinedRect(0, 0, w, h, 1)
|
||||
end
|
||||
|
||||
self.purchaseButton = buttonPanel:Add("DButton")
|
||||
CreateButton(self.purchaseButton, "purchase shop", nil, "WNTerminalLargeText", 5)
|
||||
self.purchaseButton:Dock(FILL)
|
||||
self.purchaseButton:DockMargin(8, 8, 8, 8)
|
||||
self.purchaseButton.DoClick = function()
|
||||
local permits = {}
|
||||
for _, permit in pairs(self.permits) do
|
||||
if permit.selected then
|
||||
permits[permit.id] = true
|
||||
end
|
||||
end
|
||||
|
||||
netstream.Start("BuyShopViaTerminal", self:GetTerminalEntity(), permits)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, child in pairs(self.shopPanel:GetChildren()) do
|
||||
child:SetAlpha(0)
|
||||
child:AlphaTo(255, 0.95)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:Destroy()
|
||||
self:AlphaTo(0, 0.5, 0, function(animData, pnl)
|
||||
self:GetTerminalEntity().terminalPanel = nil
|
||||
pnl:Remove()
|
||||
end)
|
||||
end
|
||||
|
||||
function PANEL:Paint(w, h)
|
||||
surface.SetDrawColor(255, 255, 255, 245)
|
||||
surface.SetMaterial(screenMat)
|
||||
surface.DrawTexturedRect(0, 0, w, h)
|
||||
end
|
||||
|
||||
vgui.Register("ixShopTerminal", PANEL, "Panel")
|
||||
|
||||
netstream.Hook("UpdateShopScreen", function()
|
||||
local panelList = ix.factoryPanels.list
|
||||
|
||||
for i = 1, #ix.factoryPanels.list do
|
||||
local panel = panelList[i]
|
||||
|
||||
if panel.shopTerminal then
|
||||
local ent = panel:GetTerminalEntity()
|
||||
panel:BuildShopPanel({
|
||||
shopName = ent:GetShop(),
|
||||
cost = ent:GetShopCost(),
|
||||
scReq = ent:GetShopSocialCreditReq(),
|
||||
rent = ent:GetNetVar("Rent", 0)
|
||||
})
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,49 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
-- some cool glowing code is taken from open-source LVS base originally used
|
||||
-- for shield impacting
|
||||
|
||||
function EFFECT:Init( data )
|
||||
self.ent = data:GetEntity()
|
||||
|
||||
self.lt = data:GetScale()
|
||||
self.dt = CurTime() + self.lt
|
||||
|
||||
if IsValid( self.ent ) then
|
||||
self.model = ClientsideModel( self.ent:GetModel(), RENDERMODE_TRANSCOLOR )
|
||||
self.model:SetMaterial("models/alyx/emptool_glow")
|
||||
self.model:SetColor( Color(255, 223, 136) )
|
||||
self.model:SetParent( self.ent, 0 )
|
||||
self.model:SetMoveType( MOVETYPE_NONE )
|
||||
self.model:SetLocalPos( Vector( 0, 0, 0 ) )
|
||||
self.model:SetLocalAngles( Angle( 0, 0, 0 ) )
|
||||
self.model:AddEffects( EF_BONEMERGE )
|
||||
end
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
if not IsValid( self.ent ) and IsValid(self.model) then
|
||||
self.model:Remove()
|
||||
end
|
||||
|
||||
if self.dt < CurTime() then
|
||||
if IsValid( self.model ) then
|
||||
self.model:Remove()
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
@@ -0,0 +1,66 @@
|
||||
--[[
|
||||
| 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 smoke = {
|
||||
"particle/smokesprites_0001",
|
||||
"particle/smokesprites_0002",
|
||||
"particle/smokesprites_0003",
|
||||
"particle/smokesprites_0004",
|
||||
"particle/smokesprites_0005",
|
||||
"particle/smokesprites_0006",
|
||||
"particle/smokesprites_0007",
|
||||
"particle/smokesprites_0008",
|
||||
"particle/smokesprites_0009",
|
||||
"particle/smokesprites_0010",
|
||||
"particle/smokesprites_0011",
|
||||
"particle/smokesprites_0012",
|
||||
"particle/smokesprites_0013",
|
||||
"particle/smokesprites_0014",
|
||||
"particle/smokesprites_0015",
|
||||
"particle/smokesprites_0016"
|
||||
}
|
||||
|
||||
function EFFECT:Init( data )
|
||||
self.pos = data:GetOrigin()
|
||||
local emitter = ParticleEmitter( self.pos, false )
|
||||
|
||||
for i = 1, 40 do
|
||||
local Pos = Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 2)
|
||||
local particle = emitter:Add( smoke[math.random(1, #smoke)], self.pos + Pos * 2 )
|
||||
if ( particle ) then
|
||||
particle:SetVelocity( Pos * 1.35 )
|
||||
|
||||
particle:SetLifeTime( 0 )
|
||||
particle:SetDieTime( 3 )
|
||||
|
||||
particle:SetStartAlpha( 255 )
|
||||
particle:SetEndAlpha( 0 )
|
||||
|
||||
particle:SetColor(255, 223, 136)
|
||||
particle:SetRoll( math.Rand( -1, 1 ) )
|
||||
|
||||
local Size = math.random( 8, 10 )
|
||||
particle:SetStartSize( Size )
|
||||
particle:SetEndSize( Size )
|
||||
|
||||
particle:SetAirResistance( 50 )
|
||||
particle:SetGravity( Vector( math.Rand( -1, 1 ) * 4, math.Rand( -1, 1 ) * 4, 0.5 ) )
|
||||
|
||||
end
|
||||
end
|
||||
emitter:Finish()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
@@ -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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT
|
||||
local glowMaterial = Material("sprites/glow04_noz")
|
||||
|
||||
function ENT:DrawTranslucent()
|
||||
self:DrawModel()
|
||||
|
||||
local spritePos = self:GetPos() + self:GetUp() * 50.5 + self:GetRight() * 16.3 + self:GetForward() * 7.8
|
||||
|
||||
if (!self.hideSprite) then
|
||||
render.SetMaterial(glowMaterial)
|
||||
render.DrawSprite(spritePos, 2.5, 2.5, Color(255, 0, 0))
|
||||
end
|
||||
|
||||
if (imgui.Entity3D2D(self, Vector(7.3, -18, 52.5), Angle(0, 90, 90), 0.01)) then -- I didn't wanna fuck with button positions
|
||||
if (imgui.xButton(0, 0, 350, 350, 0, Color(255, 255, 255, 255), Color(255, 255, 255, 255), Color(255, 255, 255, 255))) then
|
||||
if (LocalPlayer():EyePos():DistToSqr(spritePos) > 3000) then imgui.End3D2D() return end
|
||||
|
||||
self.hideSprite = true
|
||||
|
||||
net.Start("ixBatteryChargerUse")
|
||||
net.WriteEntity(self)
|
||||
net.SendToServer()
|
||||
|
||||
timer.Simple(0.1, function()
|
||||
self.hideSprite = false
|
||||
end)
|
||||
end
|
||||
|
||||
imgui.End3D2D()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,251 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
util.AddNetworkString("ixBatteryChargerUse")
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/willardnetworks/gearsofindustry/wn_machinery_01.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
self:SetTrigger(true)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnCharge(client)
|
||||
if (client:EyePos():DistToSqr(self:GetPos()) > 10000) then return end
|
||||
|
||||
self:EmitSound("buttons/lightswitch2.wav", 75, 80)
|
||||
|
||||
if (!self.attachedBattery or !self.attachedBattery:IsValid() or self.charging) then return end
|
||||
local selfPos, up, right, forward = self:GetPos(), self:GetUp(), self:GetRight(), self:GetForward()
|
||||
local boxMin, boxMax = selfPos + up * 45 + right * 13 + forward * -7, selfPos + up * 55 + right * -10 + forward * 7
|
||||
|
||||
for _, entity in ipairs(ents.FindInBox(boxMin, boxMax)) do
|
||||
if (entity:GetClass() != "ix_item") then continue end
|
||||
|
||||
self.attachedItem = entity
|
||||
|
||||
break
|
||||
end
|
||||
|
||||
if (!self.attachedItem or !self.attachedItem:IsValid()) then return end
|
||||
|
||||
self.charging = true
|
||||
self.attachedItem.inUse = true
|
||||
self.attachedBattery.inUse = true
|
||||
self:ResetSequence("Working")
|
||||
|
||||
local zap1 = ents.Create("point_tesla")
|
||||
zap1:SetParent(self)
|
||||
zap1:SetKeyValue("m_SoundName" ,"DoSpark")
|
||||
zap1:SetKeyValue("texture" ,"sprites/physbeam.vmt")
|
||||
zap1:SetKeyValue("m_Color" ,"255 255 164")
|
||||
zap1:SetKeyValue("m_flRadius" , "1")
|
||||
zap1:SetKeyValue("beamcount_min" ,"4")
|
||||
zap1:SetKeyValue("beamcount_max", "6")
|
||||
zap1:SetKeyValue("thick_min", ".5")
|
||||
zap1:SetKeyValue("thick_max", "2")
|
||||
zap1:SetKeyValue("lifetime_min" ,".1")
|
||||
zap1:SetKeyValue("lifetime_max", ".5")
|
||||
zap1:SetKeyValue("interval_min", "0.1")
|
||||
zap1:SetKeyValue("interval_max" ,"1")
|
||||
zap1:SetPos(self:GetPos() + self:GetUp() * 53 + self:GetRight() * 8)
|
||||
zap1:Spawn()
|
||||
zap1:Fire("DoSpark", "", 0.1)
|
||||
zap1:Fire("DoSpark", "", 0.4)
|
||||
zap1:Fire("DoSpark", "", 1.7)
|
||||
zap1:Fire("DoSpark", "", 2.5)
|
||||
zap1:Fire("DoSpark", "", 2.7)
|
||||
zap1:Fire("kill", "", 3)
|
||||
|
||||
local zap2 = ents.Create("point_tesla")
|
||||
zap2:SetParent(self)
|
||||
zap2:SetKeyValue("m_SoundName" ,"DoSpark")
|
||||
zap2:SetKeyValue("texture" ,"sprites/physbeam.vmt")
|
||||
zap2:SetKeyValue("m_Color" ,"255 255 164")
|
||||
zap2:SetKeyValue("m_flRadius" , "1")
|
||||
zap2:SetKeyValue("beamcount_min" ,"4")
|
||||
zap2:SetKeyValue("beamcount_max", "6")
|
||||
zap2:SetKeyValue("thick_min", ".5")
|
||||
zap2:SetKeyValue("thick_max", "2")
|
||||
zap2:SetKeyValue("lifetime_min" ,".1")
|
||||
zap2:SetKeyValue("lifetime_max", ".5")
|
||||
zap2:SetKeyValue("interval_min", "0.1")
|
||||
zap2:SetKeyValue("interval_max" ,"1")
|
||||
zap2:SetPos(self:GetPos() + self:GetUp() * 53 + self:GetRight() * -4)
|
||||
zap2:Spawn()
|
||||
zap2:Fire("DoSpark", "", 0.1)
|
||||
zap2:Fire("DoSpark", "", 0.4)
|
||||
zap2:Fire("DoSpark", "", 1.7)
|
||||
zap2:Fire("DoSpark", "", 2.5)
|
||||
zap2:Fire("DoSpark", "", 2.7)
|
||||
zap2:Fire("kill", "", 3)
|
||||
|
||||
local zap3 = ents.Create("point_tesla")
|
||||
zap3:SetParent(self)
|
||||
zap3:SetKeyValue("m_SoundName" ,"DoSpark")
|
||||
zap3:SetKeyValue("texture" ,"sprites/physbeam.vmt")
|
||||
zap3:SetKeyValue("m_Color" ,"255 255 164")
|
||||
zap3:SetKeyValue("m_flRadius" , "0")
|
||||
zap3:SetKeyValue("beamcount_min" ,"4")
|
||||
zap3:SetKeyValue("beamcount_max", "6")
|
||||
zap3:SetKeyValue("thick_min", ".5")
|
||||
zap3:SetKeyValue("thick_max", "2")
|
||||
zap3:SetKeyValue("lifetime_min" ,".1")
|
||||
zap3:SetKeyValue("lifetime_max", ".5")
|
||||
zap3:SetKeyValue("interval_min", "0.1")
|
||||
zap3:SetKeyValue("interval_max" ,"1")
|
||||
zap3:SetPos(self.attachedItem:GetPos())
|
||||
zap3:Spawn()
|
||||
zap3:Fire("DoSpark", "", 0.1)
|
||||
zap3:Fire("DoSpark", "", 0.4)
|
||||
zap3:Fire("DoSpark", "", 1.7)
|
||||
zap3:Fire("DoSpark", "", 2.5)
|
||||
zap3:Fire("DoSpark", "", 2.7)
|
||||
zap3:Fire("kill", "", 3)
|
||||
|
||||
self:EmitSound("ambient/machines/combine_terminal_idle3.wav")
|
||||
self:EmitSound("ambient/machines/combine_terminal_loop1.wav")
|
||||
|
||||
timer.Simple(1, function()
|
||||
if (!self.attachedItem or !self.attachedItem:IsValid()) then
|
||||
self:StopCharging()
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local dissolver = ents.Create("env_entity_dissolver")
|
||||
dissolver:SetKeyValue("dissolvetype", 4)
|
||||
dissolver:SetKeyValue("magnitude", 0)
|
||||
dissolver:SetPos(selfPos)
|
||||
dissolver:Spawn()
|
||||
|
||||
self.attachedItem:SetName("ix_batterycharger_dissolve_target")
|
||||
|
||||
dissolver:Fire("Dissolve", self.attachedItem:GetName())
|
||||
dissolver:Fire("Kill", "", 0)
|
||||
|
||||
timer.Simple(1.5, function()
|
||||
local itemInstance = ix.item.instances[self.attachedBattery.ixItemID]
|
||||
if (!self.attachedBattery or !self.attachedBattery:IsValid() or !itemInstance) then
|
||||
self:StopCharging()
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local charge = itemInstance:GetData("charge", 0) + 1
|
||||
itemInstance:SetData("charge", charge)
|
||||
|
||||
self:EmitSound("items/suitchargeok1.wav")
|
||||
self:StopSound("ambient/machines/combine_terminal_idle3.wav")
|
||||
self:StopSound("ambient/machines/combine_terminal_loop1.wav")
|
||||
|
||||
if (charge <= 10) then
|
||||
self:StopCharging()
|
||||
else
|
||||
self.attachedBattery.ixIsDestroying = true -- Setting this early to stop Helix from destroying the battery once it takes fire damage.
|
||||
self.attachedBattery:Ignite(4, 0)
|
||||
|
||||
for i = 1, 15 do
|
||||
timer.Simple(0.25 * i, function()
|
||||
if (!self.attachedBattery or !self.attachedBattery:IsValid()) then
|
||||
self.charging = false
|
||||
self.attachedItem.inUse = false
|
||||
self.attachedBattery.inUse = false
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
self.attachedBattery:SetNetVar("beeping", true)
|
||||
self.attachedBattery:EmitSound("hl1/fvox/beep.wav")
|
||||
|
||||
if (i != 15) then
|
||||
timer.Simple(0.125, function()
|
||||
self.attachedBattery:SetNetVar("beeping", false)
|
||||
end)
|
||||
else
|
||||
local batteryPos = self.attachedBattery:GetPos()
|
||||
local effectData = EffectData()
|
||||
effectData:SetStart(batteryPos)
|
||||
effectData:SetOrigin(batteryPos)
|
||||
util.Effect("cball_explode", effectData)
|
||||
|
||||
self.attachedBattery:EmitSound("npc/roller/mine/rmine_explode_shock1.wav")
|
||||
self.attachedBattery:Remove()
|
||||
self:StopCharging()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:StopCharging(fake)
|
||||
if (!fake) then
|
||||
self.charging = false
|
||||
end
|
||||
|
||||
self:StopSound("ambient/machines/combine_terminal_idle3.wav")
|
||||
self:StopSound("ambient/machines/combine_terminal_loop1.wav")
|
||||
|
||||
if (IsValid(self.attachedItem)) then
|
||||
self.attachedItem.inUse = false
|
||||
end
|
||||
|
||||
if (IsValid(self.attachedBattery)) then
|
||||
self.attachedBattery.inUse = false
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StartTouch(entity)
|
||||
if (entity:GetClass() != "ix_item" or entity.attached) then return end
|
||||
if (entity:GetItemID() != "combinebattery") then return end
|
||||
if (self.attachedBattery and self.attachedBattery != NULL) then return end
|
||||
|
||||
local physObj = entity:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
|
||||
entity:SetPos(self:GetPos() + self:GetUp() * 43.2 + self:GetRight() * -21.4 + self:GetForward() * 6.55)
|
||||
entity:SetAngles(self:GetAngles())
|
||||
entity:SetParent(self)
|
||||
|
||||
self.attachedBattery = entity
|
||||
entity.attached = true
|
||||
|
||||
self:EmitSound("physics/metal/weapon_impact_soft" .. math.random(1, 3) .. ".wav")
|
||||
end
|
||||
|
||||
net.Receive("ixBatteryChargerUse", function(_, client)
|
||||
local entity = net.ReadEntity()
|
||||
if (!entity or !entity:IsValid() or entity:GetClass() != "ix_batterycharger") then return end
|
||||
|
||||
entity:OnCharge(client)
|
||||
end)
|
||||
@@ -0,0 +1,18 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Battery Charger"
|
||||
ENT.Category = "HL2 RP"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminOnly = true
|
||||
ENT.PhysgunDisable = true
|
||||
ENT.PhysgunAllowAdmin = true
|
||||
@@ -0,0 +1,130 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT
|
||||
|
||||
ENT.nextClickTime = 0
|
||||
|
||||
function ENT:TurnOn()
|
||||
net.Start("ix.terminal.turnOn")
|
||||
net.WriteEntity(self)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
function ENT:TurnOff()
|
||||
net.Start("ix.terminal.turnOff")
|
||||
net.WriteEntity(self)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
function ENT:CreateStartScreen(client, data)
|
||||
local cwuMenu = ix.factoryPanels:CreatePanel("ixCWUTerminalMenu", self)
|
||||
cwuMenu:SetUsedBy(client)
|
||||
cwuMenu:SetUserGenData(istable(data) and !table.IsEmpty(data) and data[1] or nil)
|
||||
cwuMenu.cidCardInserted = data[1] and true or nil
|
||||
cwuMenu.cwuCardInserted = data[2] and true or nil
|
||||
cwuMenu.authError = data[3]
|
||||
|
||||
|
||||
self:EmitSound("buttons/button1.wav")
|
||||
end
|
||||
|
||||
function ENT:PurgeScreenPanels(muteSound)
|
||||
ix.factoryPanels:PurgeEntityPanels(self)
|
||||
if (!muteSound) then
|
||||
self:EmitSound("buttons/button5.wav")
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
self:PurgeScreenPanels(true)
|
||||
self:StopSound("wn_goi/terminal_turnon.mp3")
|
||||
end
|
||||
|
||||
ENT.vguiLocalizedTransform = {
|
||||
vec = Vector(4.53, -8.15, 44.03),
|
||||
ang = Angle(0, 90, 55),
|
||||
res = 0.01
|
||||
}
|
||||
|
||||
function ENT:DrawTranslucent()
|
||||
self:DrawModel()
|
||||
|
||||
-- main panel
|
||||
vgui.Start3D2D( self:LocalToWorld(self.vguiLocalizedTransform.vec), self:LocalToWorldAngles(self.vguiLocalizedTransform.ang), self.vguiLocalizedTransform.res )
|
||||
if self.terminalPanel then
|
||||
self.terminalPanel:Paint3D2D()
|
||||
end
|
||||
vgui.End3D2D()
|
||||
|
||||
-- buttons
|
||||
if (imgui.Entity3D2D(self, Vector(7.19, 10.16, 41.73), Angle(0, 90, 55), 0.01)) then
|
||||
if (imgui.xButton(22, -315, 100, 210, 5, Color(255, 44, 44, 0), Color(255, 44, 44, 255), Color(255, 44, 44, 10))) then
|
||||
if (!self.terminalPanel and self.nextClickTime < CurTime()) then
|
||||
self:TurnOn()
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
elseif (self.terminalPanel and self.nextClickTime < CurTime()) then
|
||||
self:TurnOff()
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
end
|
||||
end
|
||||
|
||||
draw.SimpleText("CITY STOCK", "ButtonLabel", 470, 30, Color(0, 0, 0, 225), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
if (imgui.xButton(0, 5, 150, 50, 5, Color(255, 255, 255, 0), Color(255, 255, 255, 255), Color(255, 255, 255, 10)) and self.terminalPanel and self.nextClickTime < CurTime()) then
|
||||
if self.terminalPanel then
|
||||
self.terminalPanel:CreateOption(string.utf8upper("city stock"))
|
||||
end
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
end
|
||||
|
||||
draw.SimpleText("MARKET", "ButtonLabel", 470, 155, Color(0, 0, 0, 225), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
if (imgui.xButton(0, 130, 150, 50, 5, Color(255, 255, 255, 0), Color(255, 255, 255, 255), Color(255, 255, 255, 10)) and self.nextClickTime < CurTime()) then
|
||||
if self.terminalPanel then
|
||||
self.terminalPanel:CreateOption(string.utf8upper("market"))
|
||||
end
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
end
|
||||
|
||||
draw.SimpleText("CART", "ButtonLabel", 470, 280, Color(0, 0, 0, 225), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
if (imgui.xButton(0, 254, 150, 50, 5, Color(255, 255, 255, 0), Color(255, 255, 255, 255), Color(255, 255, 255, 10)) and self.nextClickTime < CurTime()) then
|
||||
if self.terminalPanel then
|
||||
self.terminalPanel:CreateOption(string.utf8upper("cart"))
|
||||
end
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
end
|
||||
|
||||
draw.SimpleText("STATUS", "ButtonLabel", 470, 405, Color(0, 0, 0, 225), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
if (imgui.xButton(0, 378, 150, 50, 5, Color(255, 255, 255, 0), Color(255, 255, 255, 255), Color(255, 255, 255, 10)) and self.nextClickTime < CurTime()) then
|
||||
if self.terminalPanel then
|
||||
self.terminalPanel:CreateOption(string.utf8upper("status"))
|
||||
end
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
end
|
||||
|
||||
draw.SimpleText("SHIFT", "ButtonLabel", 470, 530, Color(0, 0, 0, 225), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
if (imgui.xButton(0, 503, 150, 50, 5, Color(255, 255, 255, 0), Color(255, 255, 255, 255), Color(255, 255, 255, 10)) and self.nextClickTime < CurTime()) then
|
||||
if self.terminalPanel then
|
||||
self.terminalPanel:CreateOption(string.utf8upper("shift"))
|
||||
end
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
end
|
||||
|
||||
--[[draw.SimpleText("CALL-IN", "ButtonLabel", 470, 653, Color(0, 0, 0, 225), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
if (imgui.xButton(0, 628, 150, 50, 5, Color(255, 255, 255, 0), Color(255, 255, 255, 255), Color(255, 255, 255, 10)) and self.nextClickTime < CurTime()) then
|
||||
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
end--]]
|
||||
|
||||
imgui.End3D2D()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,263 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
ENT.localizedCIDTransform = {
|
||||
vec = Vector(4.281931, -13.669882, 44.2),
|
||||
ang = Angle(31, -178.43, 180)
|
||||
}
|
||||
|
||||
ENT.localizedCWUCardTransform = {
|
||||
vec = Vector(11.407880, -13.500206, 33.918171),
|
||||
ang = Angle(-0.828, 0.935, 0.204)
|
||||
}
|
||||
|
||||
function ENT:CreateUserTimer()
|
||||
timer.Create("ixCWUTerminal" .. self:GetCreationID(), 5, 0, function()
|
||||
if !IsValid(self) then return end
|
||||
|
||||
local user = self:GetUsedBy()
|
||||
if user == self then
|
||||
if self:GetNetVar("broadcasting", false) then
|
||||
self:ToggleBroadcast()
|
||||
end
|
||||
return timer.Remove("ixCWUTerminal" .. self:GetCreationID())
|
||||
end
|
||||
|
||||
if (!IsValid(user) or !user:IsPlayer() or user:EyePos():DistToSqr(self:GetPos()) > 62500 or user:IsAFK()) then
|
||||
if self:GetNetVar("broadcasting", false) then
|
||||
self:ToggleBroadcast()
|
||||
end
|
||||
|
||||
if (IsValid(user)) then
|
||||
if user:GetNetVar("broadcastAuth", false) then
|
||||
user:SetNetVar("broadcastAuth", nil)
|
||||
end
|
||||
end
|
||||
|
||||
self:SetUsedBy(self)
|
||||
|
||||
net.Start("ix.terminal.turnOff")
|
||||
net.WriteEntity(self)
|
||||
net.Broadcast()
|
||||
|
||||
timer.Remove("ixCWUTerminal" .. self:GetCreationID())
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:ToggleBroadcast()
|
||||
local user = self:GetUsedBy()
|
||||
local broadcast = !self:GetNetVar("broadcasting", false)
|
||||
self:SetNetVar("broadcasting", broadcast)
|
||||
|
||||
net.Start("ix.terminal.CWUWorkshiftSound")
|
||||
net.Broadcast()
|
||||
|
||||
self.nextBroadcast = CurTime() + 5
|
||||
if user and user:IsPlayer() then
|
||||
ix.chat.Send(user, "event", broadcast and "Şehrin hoparlörleri bir anons sesiyle canlanıyor." or "Son belirgin duyuru sesi çalındıktan sonra şehrin hoparlörleri kapanıyor.", false, nil)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/willardnetworks/gearsofindustry/wn_machinery_04.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
self:SetCID(-1)
|
||||
self:SetCWUCard(-1)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:SendCharGenData(id)
|
||||
-- insert gendata later
|
||||
local genData
|
||||
local isCCA = false
|
||||
if ix.char.loaded[id] then
|
||||
genData = ix.char.loaded[id]:GetGenericdata()
|
||||
isCCA = ix.char.loaded[id]:GetFaction() == FACTION_ADMIN
|
||||
self:ConfirmCID(genData, isCCA)
|
||||
else
|
||||
local charQuery = mysql:Select("ix_characters")
|
||||
charQuery:Where("id", tostring(charID))
|
||||
charQuery:Callback(function(cResult)
|
||||
if (!istable(cResult) or #cResult == 0) then
|
||||
return
|
||||
end
|
||||
isCCA = ix.faction.GetIndex(cResult[1].faction) == FACTION_ADMIN
|
||||
|
||||
local query = mysql:Select("ix_characters_data")
|
||||
query:Where("key", "genericdata")
|
||||
query:Where("id", tostring(charID))
|
||||
query:Select("data")
|
||||
query:Callback(function(result)
|
||||
if (!istable(result) or #result == 0) then
|
||||
return
|
||||
end
|
||||
|
||||
genData = util.JSONToTable(result[1]["data"])
|
||||
self:ConfirmCID(genData, isCCA)
|
||||
end)
|
||||
query:Execute()
|
||||
end)
|
||||
charQuery:Execute()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:ConfirmCID(genData, isCCA)
|
||||
self.curGenData = genData
|
||||
self.curGenData.isCCA = isCCA
|
||||
local client = self:GetUsedBy()
|
||||
if client and client:IsPlayer() then
|
||||
net.Start("ix.terminal.SendCIDInfo")
|
||||
net.WriteString(util.TableToJSON(genData))
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:IsFullyAuthed()
|
||||
if (self:HasCID()) then
|
||||
if self.curGenData and self.curGenData.combine or self.curGenData and self.curGenData.isCCA then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if (!self:HasCWUCard() or !self:HasCID()) then
|
||||
return false
|
||||
end
|
||||
|
||||
if ix.item.instances[self:GetCWUCard()]:GetData("cardID") != self:GetCID() then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:HasCID()
|
||||
return self:GetCID() != -1
|
||||
end
|
||||
|
||||
function ENT:OnCIDInsert()
|
||||
local cid
|
||||
local client = self:GetUsedBy()
|
||||
|
||||
if self:HasCWUCard() then
|
||||
if !self:IsFullyAuthed() then
|
||||
ix.combineNotify:AddImportantNotification("WRN:// Unauthorized access to CWU terminal", nil, "unknown", self:GetPos())
|
||||
|
||||
if (client and client:IsPlayer()) then
|
||||
net.Start("ix.terminal.AuthError")
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
|
||||
return
|
||||
else
|
||||
cid = ix.item.instances[self:GetCID()]
|
||||
self:SendCharGenData(cid:GetData("owner"))
|
||||
end
|
||||
else
|
||||
cid = ix.item.instances[self:GetCID()]
|
||||
self:SendCharGenData(cid:GetData("owner"))
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnCIDDetach()
|
||||
self.curGenData = nil
|
||||
|
||||
local client = self:GetUsedBy()
|
||||
if (client and client:IsPlayer()) then
|
||||
net.Start("ix.terminal.SendCIDRemoved")
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:HasCWUCard()
|
||||
return self:GetCWUCard() != -1
|
||||
end
|
||||
|
||||
function ENT:OnCWUCardInsert()
|
||||
local client = self:GetUsedBy()
|
||||
|
||||
if self:HasCID() then
|
||||
if !self:IsFullyAuthed() then
|
||||
ix.combineNotify:AddImportantNotification("WRN:// Unauthorized access to CWU terminal", nil, "unknown", self:GetPos())
|
||||
|
||||
if (client and client:IsPlayer()) then
|
||||
net.Start("ix.terminal.AuthError")
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
|
||||
return
|
||||
else
|
||||
if (client and client:IsPlayer()) then
|
||||
net.Start("ix.terminal.CWUCardInserted")
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
else
|
||||
if (client and client:IsPlayer()) then
|
||||
net.Start("ix.terminal.CWUCardInserted")
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnCWUCardDetach()
|
||||
local client = self:GetUsedBy()
|
||||
if (client and client:IsPlayer()) then
|
||||
net.Start("ix.terminal.CWUCardRemoved")
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StartTouch(entity)
|
||||
if (entity:GetClass() != "ix_item" or entity.attached) then return end
|
||||
if (entity:GetItemID() != "id_card" and entity:GetItemID() != "cwu_card") then return end
|
||||
if (self.attachedCID and self.attachedCID != NULL and self.attachedCWUCard and self.attachedCWUCard != NULL) then return end
|
||||
|
||||
local physObj = entity:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
|
||||
if entity:GetItemID() == "id_card" then
|
||||
self:CIDInsert(entity)
|
||||
elseif entity:GetItemID() == "cwu_card" then
|
||||
self:CWUInsert(entity)
|
||||
end
|
||||
|
||||
self:EmitSound("physics/metal/weapon_impact_soft" .. math.random(1, 3) .. ".wav")
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
timer.Remove("ixCWUTerminal" .. self:GetCreationID())
|
||||
end
|
||||
@@ -0,0 +1,48 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "CWU Terminal"
|
||||
ENT.Category = "HL2 RP"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminOnly = true
|
||||
ENT.PhysgunDisable = true
|
||||
ENT.PhysgunAllowAdmin = true
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("Entity", 0, "UsedBy")
|
||||
self:NetworkVar("Int", 1, "CID")
|
||||
self:NetworkVar("Int", 2, "CWUCard")
|
||||
end
|
||||
|
||||
function ENT:CIDInsert(entity)
|
||||
entity:SetPos(self:LocalToWorld(self.localizedCIDTransform.vec))
|
||||
entity:SetAngles(self:LocalToWorldAngles(self.localizedCIDTransform.ang))
|
||||
entity:SetParent(self)
|
||||
|
||||
self.attachedCID = entity
|
||||
entity.attached = self
|
||||
|
||||
self:SetCID(entity.ixItemID)
|
||||
self:OnCIDInsert()
|
||||
end
|
||||
|
||||
function ENT:CWUInsert(entity)
|
||||
entity:SetPos(self:LocalToWorld(self.localizedCWUCardTransform.vec))
|
||||
entity:SetAngles(self:LocalToWorldAngles(self.localizedCWUCardTransform.ang))
|
||||
entity:SetParent(self)
|
||||
|
||||
self.attachedCWUCard = entity
|
||||
entity.attached = self
|
||||
|
||||
self:SetCWUCard(entity.ixItemID)
|
||||
self:OnCWUCardInsert()
|
||||
end
|
||||
@@ -0,0 +1,99 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT
|
||||
ENT.nextClickTime = 0
|
||||
|
||||
function ENT:TurnOn()
|
||||
net.Start("ix.terminal.turnOn")
|
||||
net.WriteEntity(self)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
function ENT:TurnOff()
|
||||
net.Start("ix.terminal.turnOff")
|
||||
net.WriteEntity(self)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
function ENT:CreateStartScreen(client, data)
|
||||
local encoderMenu = ix.factoryPanels:CreatePanel("ixDataEncoder", self)
|
||||
encoderMenu:SetUsedBy(client)
|
||||
encoderMenu:SetDisc(data[1] or false)
|
||||
self:EmitSound("buttons/button1.wav")
|
||||
end
|
||||
|
||||
function ENT:PurgeScreenPanels(muteSound)
|
||||
ix.factoryPanels:PurgeEntityPanels(self)
|
||||
if (!muteSound) then
|
||||
self:EmitSound("buttons/button5.wav")
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
self:PurgeScreenPanels(true)
|
||||
self:StopSound("wn_goi/terminal_turnon.mp3")
|
||||
end
|
||||
|
||||
ENT.vguiLocalizedTransform = {
|
||||
vec = Vector(6, -8.9, 65.710434),
|
||||
ang = Angle(0, 90, 90),
|
||||
res = 0.01
|
||||
}
|
||||
|
||||
function ENT:DrawTranslucent()
|
||||
self:DrawModel()
|
||||
|
||||
vgui.Start3D2D( self:LocalToWorld(self.vguiLocalizedTransform.vec), self:LocalToWorldAngles(self.vguiLocalizedTransform.ang), self.vguiLocalizedTransform.res )
|
||||
if self.terminalPanel then
|
||||
self.terminalPanel:Paint3D2D()
|
||||
end
|
||||
vgui.End3D2D()
|
||||
|
||||
if (imgui.Entity3D2D(self, Vector(5.502635, -6.055101, 55.513432), Angle(90, 0, 0), 0.01)) then
|
||||
if (imgui.xButton(-75, -150, 100, 300, 5, Color(255, 44, 44, 0), Color(255, 44, 44, 75), Color(255, 44, 44, 10))) then
|
||||
if (!self.terminalPanel and self.nextClickTime < CurTime()) then
|
||||
self:TurnOn()
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
elseif (self.terminalPanel and self.nextClickTime < CurTime()) then
|
||||
self:TurnOff()
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
end
|
||||
end
|
||||
|
||||
imgui.End3D2D()
|
||||
end
|
||||
|
||||
if (!self:GetNetVar("scanning") or !IsEntity(self:GetNetVar("scanning")) or !IsValid(self:GetNetVar("scanning"))) then return end
|
||||
|
||||
local topPos = self:LocalToWorld(Vector(0.139367, -0.340202, 47.403870))
|
||||
|
||||
if (!LocalPlayer():IsLineOfSightClear(topPos)) then return end
|
||||
|
||||
local trace = {}
|
||||
|
||||
trace.mask = CONTENTS_SOLID + CONTENTS_MOVEABLE + CONTENTS_OPAQUE + CONTENTS_DEBRIS + CONTENTS_HITBOX + CONTENTS_MONSTER
|
||||
trace.start = LocalPlayer():EyePos()
|
||||
trace.endpos = topPos
|
||||
trace.filter = {LocalPlayer()}
|
||||
|
||||
trace = util.TraceLine(trace)
|
||||
|
||||
if (trace.Fraction < 0.75) then return end
|
||||
|
||||
local right = self:GetRight() * math.sin(CurTime()) * 2
|
||||
|
||||
for i = 1, 4 do
|
||||
render.DrawLine(self:LocalToWorld(self.linePoses[i]), self:GetNetVar("scanning"):LocalToWorld(self:GetNetVar("scanning"):OBBCenter()) + right * (i / 2), Color(255, math.random(50, 255), 0, math.random(100)))
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,238 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
ENT.scanBox = {
|
||||
mins = Vector(-8.344721, -7.158762, 39.878693),
|
||||
maxs = Vector(2.849499, 6.975823, 49.807785)
|
||||
}
|
||||
|
||||
ENT.nextScan = 0
|
||||
ENT.batteryChargeReq = 1
|
||||
|
||||
function ENT:CreateUserTimer()
|
||||
timer.Create("ixDiscScanner" .. self:GetCreationID(), 5, 0, function()
|
||||
if !IsValid(self) then return end
|
||||
|
||||
local user = self:GetUsedBy()
|
||||
if user == self then return timer.Remove("ixDiscScanner" .. self:GetCreationID()) end
|
||||
|
||||
if (!IsValid(user) or !user:IsPlayer() or user:EyePos():DistToSqr(self:GetPos()) > 62500 or user:IsAFK()) then
|
||||
self:SetUsedBy(self)
|
||||
|
||||
net.Start("ix.terminal.turnOff")
|
||||
net.WriteEntity(self)
|
||||
net.Broadcast()
|
||||
|
||||
timer.Remove("ixDiscScanner" .. self:GetCreationID())
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
timer.Remove("ixDiscScanner" .. self:GetCreationID())
|
||||
end
|
||||
|
||||
function ENT:HasBattery()
|
||||
return IsValid(self.attachedBattery)
|
||||
end
|
||||
|
||||
function ENT:BatteryHasCharge(charge)
|
||||
return self.attachedBattery:GetData("charge", 0) >= charge
|
||||
end
|
||||
|
||||
function ENT:TakeBatteryCharge(charge)
|
||||
ix.item.instances[self.attachedBattery.ixItemID]:SetData("charge", self.attachedBattery:GetData("charge") - charge)
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/willardnetworks/gearsofindustry/wn_machinery_02.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
self:SetTrigger(true)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:SearchForItem()
|
||||
local mins = self:LocalToWorld(self.scanBox.mins)
|
||||
local maxs = self:LocalToWorld(self.scanBox.maxs)
|
||||
for _, item in pairs(ents.FindInBox(mins, maxs)) do
|
||||
if item:GetClass() != "ix_item" then continue end
|
||||
|
||||
return item
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Scan(client)
|
||||
if self.bScanning then return end
|
||||
|
||||
local item = self:SearchForItem()
|
||||
|
||||
if item then
|
||||
if !ix.fabrication:GetTech(item:GetItemID()) and !ix.fabrication:GetAdvancedTech(item:GetItemID()) then
|
||||
return "This item cannot be encoded into data disc."
|
||||
end
|
||||
if self.attachedDisc:GetData("item", "") != "" then
|
||||
return "This disc already have data on it."
|
||||
end
|
||||
if !self:HasBattery() then return "Data-disc encoder requires combine battery in order to function!" end
|
||||
if !self:BatteryHasCharge(self.batteryChargeReq) then return "Battery don't have enough charge." end
|
||||
self:TakeBatteryCharge(self.batteryChargeReq)
|
||||
|
||||
item:GetPhysicsObject():EnableMotion(false)
|
||||
|
||||
local ef = EffectData()
|
||||
ef:SetEntity(item)
|
||||
ef:SetScale(self.scanTimer)
|
||||
util.Effect("scanGlow", ef)
|
||||
|
||||
self:SetNetVar("scanning", item)
|
||||
self.bScanning = true
|
||||
|
||||
if client and client:IsPlayer() then
|
||||
net.Start("ix.terminal.Scan")
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
|
||||
item.inUse = true
|
||||
self.attachedDisc.inUse = true
|
||||
|
||||
self:EmitSound("wn_goi/disc_encode_start.wav", 55, 100, 1, nil, 0, 11)
|
||||
timer.Simple(SoundDuration("wn_goi/disc_encode_start.wav"), function()
|
||||
self:EmitSound("wn_goi/disc_encode_loop.wav", 55, 100, 1, nil, 0, 11)
|
||||
end)
|
||||
|
||||
timer.Simple(self.scanTimer, function()
|
||||
if (item and IsValid(item)) then
|
||||
item.inUse = nil
|
||||
item:GetPhysicsObject():EnableMotion(true)
|
||||
end
|
||||
|
||||
if (self.attachedDisc and IsValid(self.attachedDisc)) then
|
||||
self.attachedDisc.inUse = nil
|
||||
end
|
||||
|
||||
if !IsValid(self) or !IsValid(item) or !IsValid(self.attachedDisc) then
|
||||
if IsValid(self) then
|
||||
self:StopSound("wn_goi/disc_encode_loop.wav")
|
||||
end
|
||||
return "Error!"
|
||||
end
|
||||
|
||||
self.bScanning = false
|
||||
self:SetNetVar("scanning", nil)
|
||||
self:StopSound("wn_goi/disc_encode_loop.wav")
|
||||
self:EmitSound("wn_goi/disc_encode_stop.wav", 55, 100, 1, nil, 0, 11)
|
||||
|
||||
ix.item.instances[self.attachedDisc.ixItemID]:SetData("item", item:GetItemID())
|
||||
self:SetDiscItemID(self.attachedDisc:GetData("item", ""))
|
||||
|
||||
ef = EffectData()
|
||||
ef:SetOrigin(self:LocalToWorld(Vector(4.453487, 0.434061, 39.031250)))
|
||||
util.Effect("scanVaporize", ef)
|
||||
item:Remove()
|
||||
|
||||
self:EmitSound("ambience/3d-sounds/steam/steam07.wav")
|
||||
|
||||
if client and client:IsPlayer() then
|
||||
net.Start("ix.terminal.DiscAttach")
|
||||
net.WriteEntity(self)
|
||||
net.WriteString(self:GetDiscItemID() or "")
|
||||
net.Send(client)
|
||||
end
|
||||
end)
|
||||
else
|
||||
return "There's no items in terminal depot."
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:SetDiscItemID(itemID)
|
||||
self.dItemID = itemID
|
||||
end
|
||||
|
||||
function ENT:GetDiscItemID()
|
||||
return self.dItemID or ""
|
||||
end
|
||||
|
||||
function ENT:OnDiscAttach(disc)
|
||||
self:SetDiscItemID(disc:GetData("item", ""))
|
||||
self:SetNetVar("attachedDisc", disc)
|
||||
|
||||
local client = self:GetUsedBy()
|
||||
|
||||
if client and client:IsPlayer() then
|
||||
net.Start("ix.terminal.DiscAttach")
|
||||
net.WriteEntity(self)
|
||||
net.WriteString(self:GetDiscItemID() or "")
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnDiscDetach(disc)
|
||||
self:SetDiscItemID(nil)
|
||||
self:SetNetVar("attachedDisc", nil)
|
||||
|
||||
local client = self:GetUsedBy()
|
||||
|
||||
if client and client:IsPlayer() then
|
||||
net.Start("ix.terminal.DiscDetach")
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StartTouch(entity)
|
||||
if (entity:GetClass() != "ix_item" or entity.attached) then return end
|
||||
local attachmentPos = self:GetPos()
|
||||
local attachmentAngle = self:GetAngles()
|
||||
|
||||
if (entity:GetItemID() == "combinebattery") then
|
||||
if (self.attachedBattery and self.attachedBattery != NULL) then return end
|
||||
|
||||
attachmentPos = self:LocalToWorld(Vector(-3.006432, -14.451619, 10.576401))
|
||||
attachmentAngle = self:LocalToWorldAngles(Angle(-0.281, -89.269, 89.798))
|
||||
self.attachedBattery = entity
|
||||
elseif (entity:GetItemID() == "datadisc") then
|
||||
if (self.attachedDisc and self.attachedDisc != NULL) then return end
|
||||
|
||||
attachmentPos = self:GetPos() + self:GetUp() * 55.4 + self:GetRight() * -4.5 + self:GetForward() * 5
|
||||
self.attachedDisc = entity
|
||||
self:OnDiscAttach(entity)
|
||||
else return end
|
||||
|
||||
local physObj = entity:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
|
||||
entity:SetPos(attachmentPos)
|
||||
entity:SetAngles(attachmentAngle)
|
||||
entity:SetParent(self)
|
||||
|
||||
entity.attached = self
|
||||
|
||||
self:EmitSound("physics/metal/weapon_impact_soft" .. math.random(1, 3) .. ".wav")
|
||||
end
|
||||
@@ -0,0 +1,29 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Data-Disc Scanner"
|
||||
ENT.Category = "HL2 RP"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminOnly = true
|
||||
ENT.PhysgunDisable = true
|
||||
ENT.PhysgunAllowAdmin = true
|
||||
|
||||
ENT.scanTimer = 5
|
||||
ENT.linePoses = {
|
||||
Vector(-0.591944, 2.154315, 50),
|
||||
Vector(0.672625, -0.008970, 50),
|
||||
Vector(-0.630802, -2.203331, 50),
|
||||
Vector(-1.493779, -0.068308, 50)
|
||||
}
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("Entity", 0, "UsedBy")
|
||||
end
|
||||
@@ -0,0 +1,75 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT
|
||||
ENT.nextClickTime = 0
|
||||
|
||||
function ENT:TurnOn()
|
||||
net.Start("ix.terminal.turnOn")
|
||||
net.WriteEntity(self)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
function ENT:TurnOff()
|
||||
net.Start("ix.terminal.turnOff")
|
||||
net.WriteEntity(self)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
function ENT:CreateStartScreen(client, data)
|
||||
local fabricatorMenu = ix.factoryPanels:CreatePanel("ixFabricator", self)
|
||||
fabricatorMenu:SetUsedBy(client)
|
||||
fabricatorMenu:SetDisc(data[1] or "")
|
||||
self:EmitSound("buttons/button1.wav")
|
||||
end
|
||||
|
||||
function ENT:PurgeScreenPanels(muteSound)
|
||||
ix.factoryPanels:PurgeEntityPanels(self)
|
||||
if (!muteSound) then
|
||||
self:EmitSound("buttons/button5.wav")
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
self:PurgeScreenPanels(true)
|
||||
self:StopSound("wn_goi/terminal_turnon.mp3")
|
||||
end
|
||||
|
||||
ENT.vguiLocalizedTransform = {
|
||||
vec = Vector(16, -40.15, 43.25),
|
||||
ang = Angle(0, 65, 55),
|
||||
res = 0.01
|
||||
}
|
||||
|
||||
function ENT:DrawTranslucent()
|
||||
self:DrawModel()
|
||||
|
||||
vgui.Start3D2D( self:LocalToWorld(self.vguiLocalizedTransform.vec), self:LocalToWorldAngles(self.vguiLocalizedTransform.ang), self.vguiLocalizedTransform.res )
|
||||
if self.terminalPanel then
|
||||
self.terminalPanel:Paint3D2D()
|
||||
end
|
||||
vgui.End3D2D()
|
||||
|
||||
if (imgui.Entity3D2D(self, Vector(17.592129, -44.555752, 40.282715), Angle(0, 65, 55), 0.01)) then
|
||||
if (imgui.xButton(-165, 10, 285, 135, 5, Color(255, 44, 44, 0), Color(255, 44, 44, 255), Color(255, 44, 44, 10))) then
|
||||
if (!self.terminalPanel and self.nextClickTime < CurTime()) then
|
||||
self:TurnOn()
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
elseif (self.terminalPanel and self.nextClickTime < CurTime()) then
|
||||
self:TurnOff()
|
||||
self.nextClickTime = CurTime() + 1.5
|
||||
end
|
||||
end
|
||||
imgui.End3D2D()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,429 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
ENT.nextInteraction = 0
|
||||
ENT.interactionCooldown = 0.25
|
||||
ENT.batteryChargeReq = 1
|
||||
|
||||
function ENT:CreateUserTimer()
|
||||
timer.Create("ixFabricator" .. self:GetCreationID(), 5, 0, function()
|
||||
if !IsValid(self) then return end
|
||||
|
||||
local user = self:GetUsedBy()
|
||||
if user == self then return timer.Remove("ixFabricator" .. self:GetCreationID()) end
|
||||
|
||||
if (!IsValid(user) or !user:IsPlayer() or user:EyePos():DistToSqr(self:GetPos()) > 62500 or user:IsAFK()) then
|
||||
self:SetUsedBy(self)
|
||||
|
||||
net.Start("ix.terminal.turnOff")
|
||||
net.WriteEntity(self)
|
||||
net.Broadcast()
|
||||
|
||||
timer.Remove("ixFabricator" .. self:GetCreationID())
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
timer.Remove("ixFabricator" .. self:GetCreationID())
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/willardnetworks/gearsofindustry/wn_machinery_03.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
self:SetTrigger(true)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
self.opened = false
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:HasBattery()
|
||||
return IsValid(self.attachedBattery)
|
||||
end
|
||||
|
||||
function ENT:BatteryHasCharge(charge)
|
||||
return self.attachedBattery:GetData("charge", 0) >= charge
|
||||
end
|
||||
|
||||
function ENT:TakeBatteryCharge(charge)
|
||||
ix.item.instances[self.attachedBattery.ixItemID]:SetData("charge", self.attachedBattery:GetData("charge") - charge)
|
||||
end
|
||||
|
||||
function ENT:SetDiscItemID(itemID)
|
||||
self.dItemID = itemID
|
||||
end
|
||||
|
||||
function ENT:GetDiscItemID()
|
||||
return self.dItemID or ""
|
||||
end
|
||||
|
||||
function ENT:OnDiscAttach(disc)
|
||||
local client = self:GetUsedBy()
|
||||
|
||||
if !ix.fabrication:Get(disc:GetData("item", "")) then
|
||||
if client and client:IsPlayer() then
|
||||
client:NotifyLocalized("Data disc is corrupted.")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
self:SetDiscItemID(disc:GetData("item", ""))
|
||||
self:SetNetVar("attachedDisc", disc)
|
||||
|
||||
if client and client:IsPlayer() then
|
||||
net.Start("ix.terminal.DiscAttach")
|
||||
net.WriteEntity(self)
|
||||
net.WriteString(self:GetDiscItemID() or "")
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnDiscDetach(disc)
|
||||
self:SetDiscItemID("")
|
||||
self:SetNetVar("attachedDisc", nil)
|
||||
|
||||
local client = self:GetUsedBy()
|
||||
|
||||
if client and client:IsPlayer() then
|
||||
net.Start("ix.terminal.DiscDetach")
|
||||
net.WriteEntity(self)
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
|
||||
ENT.dispenseBox = {
|
||||
mins = Vector(5.035011, 4.218863, 45.633255),
|
||||
maxs = Vector(17.356579, -23.244238, 33.593277)
|
||||
}
|
||||
|
||||
function ENT:SearchForItem()
|
||||
local mins = self:LocalToWorld(self.dispenseBox.mins)
|
||||
local maxs = self:LocalToWorld(self.dispenseBox.maxs)
|
||||
for _, item in pairs(ents.FindInBox(mins, maxs)) do
|
||||
if item:GetClass() != "ix_item" then continue end
|
||||
if self.attachedDisc and item == self.attachedDisc then continue end
|
||||
|
||||
return item
|
||||
end
|
||||
end
|
||||
|
||||
ENT.nextDepotToggle = 0
|
||||
|
||||
function ENT:OpenDepot()
|
||||
self:ResetSequence("Open")
|
||||
self.opened = true
|
||||
end
|
||||
|
||||
function ENT:CloseDepot()
|
||||
self:ResetSequence("Close")
|
||||
self.opened = false
|
||||
end
|
||||
|
||||
function ENT:ToggleDepot()
|
||||
if self.bSynthesizing then return "Fabricator is active: you can't do anything else with it yet." end
|
||||
if self.nextDepotToggle > CurTime() then return "You have to wait a bit before using this again." end
|
||||
if self.opened then self:CloseDepot() else self:OpenDepot() end
|
||||
self.nextDepotToggle = CurTime() + 2.5
|
||||
end
|
||||
|
||||
function ENT:Recycle(client)
|
||||
if self.bSynthesizing then return "Fabricator is active: you can't do anything else with it yet." end
|
||||
if self.nextInteraction > CurTime() then return "You have to wait a bit until next interaction." end
|
||||
self.nextInteraction = CurTime() + self.interactionCooldown
|
||||
if !IsValid(client) or !client:IsPlayer() then return "Invalid client." end
|
||||
if !self:HasBattery() then return "Fabricator requires combine battery in order to function!" end
|
||||
if !self:BatteryHasCharge(self.batteryChargeReq) then return "Battery don't have enough charge." end
|
||||
self:TakeBatteryCharge(self.batteryChargeReq)
|
||||
|
||||
local recycledItem
|
||||
local item = self:SearchForItem()
|
||||
if !item then
|
||||
return "There's no item in fabricator depot."
|
||||
end
|
||||
|
||||
local itemID = item:GetItemID()
|
||||
for _, material in pairs(ix.fabrication.MAIN_MATS) do
|
||||
if material == itemID then
|
||||
return "You can't recycle this!"
|
||||
end
|
||||
end
|
||||
|
||||
local bClosedDepot = true
|
||||
|
||||
if self.opened then
|
||||
self:CloseDepot()
|
||||
bClosedDepot = false
|
||||
end
|
||||
self.bSynthesizing = true
|
||||
|
||||
timer.Simple(bClosedDepot and 0.1 or 2.5, function()
|
||||
if (!IsValid(self)) then return end
|
||||
if (!IsValid(item)) then
|
||||
self.bSynthesizing = false
|
||||
return self:OpenDepot()
|
||||
end
|
||||
|
||||
self:EmitSound("ambience/3d-sounds/electronics/hipowerup_01.wav")
|
||||
recycledItem = item.ixItemID
|
||||
item:Remove()
|
||||
|
||||
timer.Simple(6.6, function()
|
||||
if (!IsValid(self)) then return end
|
||||
|
||||
for _, pipe in pairs(self.smallSteamPipes) do
|
||||
ParticleEffect("steamjet", self:LocalToWorld(pipe.vec), self:LocalToWorldAngles(pipe.ang), self)
|
||||
end
|
||||
|
||||
self:EmitSound("ambience/3d-sounds/electronics/openingpowerup_13.wav")
|
||||
self:DispenseRecycledMaterials(recycledItem)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:DispenseRecycledMaterials(item)
|
||||
item = ix.item.instances[item]
|
||||
|
||||
if !item then
|
||||
self.bSynthesizing = false
|
||||
return self:OpenDepot()
|
||||
end
|
||||
|
||||
local itemToDispense
|
||||
local matAmount = item.category != "Ammunition" and item:GetData("stack", 1) or 1
|
||||
|
||||
if item.category == "Food" or item.category == "Ingredient" then
|
||||
itemToDispense = ix.fabrication.MAIN_MATS["bio"]
|
||||
else
|
||||
itemToDispense = ix.fabrication.MAIN_MATS["tech"]
|
||||
end
|
||||
|
||||
local fabrication = ix.fabrication:Get(item.uniqueID)
|
||||
if fabrication then
|
||||
itemToDispense = ix.fabrication.MAIN_MATS[fabrication:GetCategory()]
|
||||
if item.category == "Ammunition" then
|
||||
matAmount = fabrication:GetMainMaterialCost()
|
||||
else
|
||||
matAmount = fabrication:GetMainMaterialCost() * item:GetData("stack", 1)
|
||||
end
|
||||
end
|
||||
|
||||
if matAmount > 1 then
|
||||
self:MultipleDispense(itemToDispense, matAmount)
|
||||
else
|
||||
self:Dispense(itemToDispense)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:MultipleDispense(item, amount)
|
||||
self.mDispensing = {item = item, amount = amount}
|
||||
|
||||
self:Dispense(item)
|
||||
end
|
||||
|
||||
function ENT:Dispense(item)
|
||||
ix.item.Spawn(item, self:GetPos(), function(_, ent)
|
||||
ent:SetPos(self:GetAttachment(1).Pos)
|
||||
|
||||
self.dispensedObject = ent
|
||||
ent.dispenser = self
|
||||
|
||||
ent:GetPhysicsObject():EnableMotion(false)
|
||||
end, self:GetAngles())
|
||||
|
||||
self:OpenDepot()
|
||||
end
|
||||
|
||||
function ENT:OnDispensedItemTaken()
|
||||
if self.mDispensing then
|
||||
if self.mDispensing.amount > 1 then
|
||||
self:CloseDepot()
|
||||
end
|
||||
|
||||
self.mDispensing.amount = self.mDispensing.amount - 1
|
||||
|
||||
timer.Simple(2, function()
|
||||
if (!IsValid(self)) then return end
|
||||
if (!self.mDispensing) then return end
|
||||
|
||||
self:Dispense(self.mDispensing.item)
|
||||
end)
|
||||
|
||||
if self.mDispensing.amount > 0 then
|
||||
return
|
||||
else
|
||||
self.mDispensing = nil
|
||||
end
|
||||
end
|
||||
|
||||
self.bSynthesizing = false
|
||||
|
||||
if self.opened and self.mDispensing and self.mDispensing.amount > 0 then
|
||||
self:CloseDepot()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:SynthesizeFabrication(client, fabrication, isBulk, amount)
|
||||
if self.bSynthesizing then return "Fabricator is active: you can't do anything else with it yet." end
|
||||
if self.nextInteraction > CurTime() then return "You have to wait a bit until next interaction." end
|
||||
self.nextInteraction = CurTime() + self.interactionCooldown
|
||||
if !IsValid(client) or !client:IsPlayer() then return "Invalid client." end
|
||||
fabrication = ix.fabrication:Get(fabrication)
|
||||
if !fabrication then return "Selected fabrication is invalid." end
|
||||
if !self:HasBattery() then return "Fabricator requires combine battery in order to function!" end
|
||||
if !self:BatteryHasCharge(self.batteryChargeReq) then return "Battery don't have enough charge." end
|
||||
|
||||
local character = client:GetCharacter()
|
||||
local inventory = character:GetInventory()
|
||||
local resourceItemID = ix.fabrication.MAIN_MATS[fabrication:GetCategory()]
|
||||
local resourceItem = ix.item.list[resourceItemID]
|
||||
local hasItem = inventory:GetItemsByUniqueID(resourceItemID)
|
||||
local isStackable = resourceItem.maxStackSize != nil
|
||||
local resourcesToTake = fabrication:GetMainMaterialCost()
|
||||
|
||||
if (isBulk) then
|
||||
resourcesToTake = resourcesToTake * amount
|
||||
end
|
||||
|
||||
if !hasItem or !istable(hasItem) or table.IsEmpty(hasItem) then
|
||||
return "Unable to find required materials in your inventory."
|
||||
end
|
||||
|
||||
local totalItemCount = 0
|
||||
|
||||
if isStackable then
|
||||
for _, rItem in pairs(hasItem) do
|
||||
totalItemCount = totalItemCount + rItem:GetStackSize()
|
||||
end
|
||||
|
||||
if totalItemCount >= resourcesToTake then
|
||||
for _, rItem in pairs(hasItem) do
|
||||
if resourcesToTake <= 0 then
|
||||
break
|
||||
end
|
||||
|
||||
local actualStackSize = rItem:GetStackSize()
|
||||
rItem:RemoveStack(resourcesToTake)
|
||||
resourcesToTake = resourcesToTake - actualStackSize
|
||||
end
|
||||
else
|
||||
return "You don't have enough resources for this fabrication."
|
||||
end
|
||||
else
|
||||
totalItemCount = totalItemCount + #hasItem
|
||||
|
||||
if totalItemCount >= resourcesToTake then
|
||||
for _, rItem in pairs(hasItem) do
|
||||
if resourcesToTake <= 0 then break end
|
||||
rItem:Remove()
|
||||
resourcesToTake = resourcesToTake - 1
|
||||
end
|
||||
else
|
||||
return "You don't have enough resources for this fabrication."
|
||||
end
|
||||
end
|
||||
|
||||
if self.opened then
|
||||
self:CloseDepot()
|
||||
end
|
||||
|
||||
self.bSynthesizing = true
|
||||
|
||||
self:TakeBatteryCharge(self.batteryChargeReq)
|
||||
|
||||
self:EmitSound("ambience/3d-sounds/electronics/hipowerup_01.wav")
|
||||
|
||||
-- i frickin' love timer simple pyramids
|
||||
timer.Simple(6.6, function()
|
||||
if (!IsValid(self)) then return end
|
||||
|
||||
self:EmitSound("ambience/3d-sounds/steam/steam2.wav")
|
||||
ParticleEffect("steam_jet_50", self:LocalToWorld(self.bigSteamJet.vec), self:LocalToWorldAngles(self.bigSteamJet.ang), self)
|
||||
|
||||
timer.Simple(2.9, function()
|
||||
if (!IsValid(self)) then return end
|
||||
self:StopParticles()
|
||||
self:EmitSound("ambience/3d-sounds/nexus/printer_verb.ogg")
|
||||
|
||||
timer.Simple(11.2, function()
|
||||
if (!IsValid(self)) then return end
|
||||
self:EmitSound("ambience/3d-sounds/steam/steam01.wav")
|
||||
for _, pipe in pairs(self.smallSteamPipes) do
|
||||
ParticleEffect("steamjet", self:LocalToWorld(pipe.vec), self:LocalToWorldAngles(pipe.ang), self)
|
||||
end
|
||||
|
||||
timer.Simple(1.8, function()
|
||||
if (!IsValid(self)) then return end
|
||||
if (isBulk) then
|
||||
self:MultipleDispense(fabrication:GetID(), amount)
|
||||
else
|
||||
self:Dispense(fabrication:GetID())
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
self:NextThink( CurTime() )
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:StartTouch(entity)
|
||||
if (entity:GetClass() != "ix_item" or entity.attached) then return end
|
||||
local attachmentPos = self:GetPos()
|
||||
local attachmentAngle = self:GetAngles()
|
||||
|
||||
if (entity:GetItemID() == "combinebattery") then
|
||||
if (self.attachedBattery and self.attachedBattery != NULL) then return end
|
||||
|
||||
attachmentPos = self:LocalToWorld(Vector(17.081011, -3.726678, 25.982630))
|
||||
attachmentAngle = self:LocalToWorldAngles(Angle(8.451, 7.097, 98.399))
|
||||
self.attachedBattery = entity
|
||||
elseif (entity:GetItemID() == "datadisc") then
|
||||
if (self.attachedDisc and self.attachedDisc != NULL) then return end
|
||||
|
||||
attachmentPos = self:LocalToWorld(Vector(21.495632, -24.401604, 37.726032))
|
||||
attachmentAngle = self:LocalToWorldAngles(Angle(0.693, 2.259, 88.879))
|
||||
self.attachedDisc = entity
|
||||
self:OnDiscAttach(entity)
|
||||
else return end
|
||||
|
||||
local physObj = entity:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
|
||||
entity:SetPos(attachmentPos)
|
||||
entity:SetAngles(attachmentAngle)
|
||||
entity:SetParent(self)
|
||||
|
||||
entity.attached = self
|
||||
|
||||
self:EmitSound("physics/metal/weapon_impact_soft" .. math.random(1, 3) .. ".wav")
|
||||
end
|
||||
@@ -0,0 +1,34 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Fabricator"
|
||||
ENT.Category = "HL2 RP"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminOnly = true
|
||||
ENT.PhysgunDisable = true
|
||||
ENT.PhysgunAllowAdmin = true
|
||||
ENT.AutomaticFrameAdvance = true
|
||||
|
||||
ENT.bigSteamJet = {
|
||||
vec = Vector(1.659318, 56.163685, 33.053894),
|
||||
ang = Angle(0, 90, 0)
|
||||
}
|
||||
ENT.smallSteamPipes = {
|
||||
{vec = Vector(20.475733, 34.197407, 12.701706), ang = Angle(-60, -75, 0)},
|
||||
{vec = Vector(20.420990, 28.903364, 12.851990), ang = Angle(-60, -75, 0)},
|
||||
{vec = Vector(20.008125, -16.373440, 23.055595), ang = Angle(-90, -90, 0)}
|
||||
}
|
||||
ENT.dispensePos = Vector(12.057754, -13.228306, 39.473038)
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("Entity", 0, "UsedBy")
|
||||
end
|
||||
@@ -0,0 +1,53 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
ENT.RenderGroup = RENDERGROUP_TRANSLUCENT
|
||||
|
||||
function ENT:CreateStartScreen()
|
||||
local shopMenu = ix.factoryPanels:CreatePanel("ixShopTerminal", self)
|
||||
shopMenu:BuildShopPanel({
|
||||
shopName = self:GetShop(),
|
||||
cost = self:GetShopCost(),
|
||||
scReq = self:GetShopSocialCreditReq(),
|
||||
rent = self:GetNetVar("Rent", 0)
|
||||
})
|
||||
end
|
||||
|
||||
function ENT:PurgeScreenPanels(muteSound)
|
||||
ix.factoryPanels:PurgeEntityPanels(self)
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
self:PurgeScreenPanels(true)
|
||||
end
|
||||
|
||||
ENT.vguiLocalizedTransform = {
|
||||
vec = Vector(13, -6.7, 20),
|
||||
ang = Angle(0, 90, 90),
|
||||
res = 0.01
|
||||
}
|
||||
|
||||
function ENT:DrawTranslucent()
|
||||
self:DrawModel()
|
||||
|
||||
vgui.Start3D2D( self:LocalToWorld(self.vguiLocalizedTransform.vec), self:LocalToWorldAngles(self.vguiLocalizedTransform.ang), self.vguiLocalizedTransform.res )
|
||||
if self.terminalPanel then
|
||||
self.terminalPanel:Paint3D2D()
|
||||
end
|
||||
vgui.End3D2D()
|
||||
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self:CreateStartScreen()
|
||||
end
|
||||
@@ -0,0 +1,110 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/props_combine/combine_smallmonitor001.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
self:SetTrigger(true)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
|
||||
self:SetNetVar("isPurchasable", self:IsPurchasable())
|
||||
end
|
||||
|
||||
function ENT:SetShop(shop)
|
||||
local housing = ix.plugin.Get("housing")
|
||||
local foundShop = false
|
||||
for k, apartment in pairs(housing.apartments) do
|
||||
if apartment.name == shop and apartment.type == "shop" then
|
||||
self:SetNetVar("shop", shop)
|
||||
self:SetNetVar("shopID", i)
|
||||
foundShop = true
|
||||
end
|
||||
end
|
||||
|
||||
if !foundShop then
|
||||
return "No shops found"
|
||||
end
|
||||
|
||||
self:UpdateScreen()
|
||||
end
|
||||
|
||||
function ENT:GetShopID()
|
||||
local shop = self:GetShop()
|
||||
local housing = ix.plugin.Get("housing")
|
||||
for k, fShop in pairs(housing.apartments) do
|
||||
if fShop.name == shop and fShop.type == "shop" then
|
||||
return k
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function ENT:SetShopCost(cost)
|
||||
if !self:GetShop() then return "You must link this terminal with shop first!" end
|
||||
|
||||
self:SetNetVar("cost", cost)
|
||||
|
||||
self:UpdateScreen()
|
||||
end
|
||||
|
||||
function ENT:SetShopSocialCreditReq(sc)
|
||||
if !self:GetShop() then return "You must link this terminal with shop first!" end
|
||||
|
||||
self:SetNetVar("sc", sc)
|
||||
|
||||
self:UpdateScreen()
|
||||
end
|
||||
|
||||
function ENT:UpdateRent()
|
||||
local shop = self:GetShop()
|
||||
if !shop then return false end
|
||||
|
||||
local housing = ix.plugin.Get("housing")
|
||||
local foundShop = false
|
||||
for k, fShop in pairs(housing.apartments) do
|
||||
if fShop.name == shop and fShop.type == "shop" then
|
||||
foundShop = fShop
|
||||
end
|
||||
end
|
||||
|
||||
if !foundShop then
|
||||
return false
|
||||
end
|
||||
|
||||
self:SetNetVar("Rent", foundShop.rent)
|
||||
end
|
||||
|
||||
function ENT:UpdateScreen()
|
||||
self:SetNetVar("isPurchasable", self:IsPurchasable())
|
||||
self:UpdateRent()
|
||||
|
||||
for _, client in ipairs(player.GetAll()) do
|
||||
netstream.Start(client, "UpdateShopScreen")
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:StartTouch(entity)
|
||||
|
||||
end
|
||||
@@ -0,0 +1,53 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Shop Terminal"
|
||||
ENT.Category = "HL2 RP"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminOnly = true
|
||||
ENT.PhysgunDisable = true
|
||||
ENT.PhysgunAllowAdmin = true
|
||||
|
||||
function ENT:GetShop()
|
||||
return self:GetNetVar("shop", false)
|
||||
end
|
||||
|
||||
function ENT:GetShopCost()
|
||||
return self:GetNetVar("cost", false)
|
||||
end
|
||||
|
||||
function ENT:GetShopSocialCreditReq()
|
||||
return self:GetNetVar("sc", false)
|
||||
end
|
||||
|
||||
function ENT:IsPurchasable()
|
||||
local shop = self:GetShop()
|
||||
if !shop then return false end
|
||||
|
||||
local housing = ix.plugin.Get("housing")
|
||||
local foundShop = false
|
||||
for _, fShop in pairs(housing.apartments) do
|
||||
if fShop.name == shop and fShop.type == "shop" then
|
||||
foundShop = fShop
|
||||
end
|
||||
end
|
||||
|
||||
if !foundShop then
|
||||
return false
|
||||
end
|
||||
|
||||
if foundShop.tenants and table.IsEmpty(foundShop.tenants) then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
36
gamemodes/darkrp/plugins/goi_factory/items/sh_biopaste.lua
Normal file
36
gamemodes/darkrp/plugins/goi_factory/items/sh_biopaste.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
ITEM.base = "base_stackable"
|
||||
ITEM.maxStackSize = 16
|
||||
|
||||
ITEM.name = "Biyomacun"
|
||||
ITEM.description = "Tuhaf malzemeyle dolu beyaz bir kavanoz."
|
||||
ITEM.category = "Ingredient"
|
||||
ITEM.model = "models/props_lab/jar01b.mdl"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(6.22, -199.61, 10.73),
|
||||
ang = Angle(3.12, 91.84, 0),
|
||||
fov = 3.64
|
||||
}
|
||||
ITEM.holdData = {
|
||||
vectorOffset = {
|
||||
right = -1.5,
|
||||
up = 0,
|
||||
forward = 0
|
||||
},
|
||||
angleOffset = {
|
||||
right = 0,
|
||||
up = 0,
|
||||
forward = 0
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
--[[
|
||||
| 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 PLUGIN = PLUGIN
|
||||
|
||||
ITEM.name = "Combine Bataryası"
|
||||
ITEM.model = "models/willardnetworks/gearsofindustry/wn_battery.mdl"
|
||||
ITEM.category = "Combine"
|
||||
ITEM.description = "Küçük, şarj edilebilir bir batarya. Arkasında bir şarj girişi ve batarya durumunu gösteren bir sayaç var."
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(199.98, 5.3, 7.35),
|
||||
ang = Angle(0.66, -178.43, 0),
|
||||
fov = 3.08
|
||||
}
|
||||
|
||||
function ITEM:OnInstanced(invID, x, y, item)
|
||||
self:SetData("charge", 0)
|
||||
end
|
||||
|
||||
ITEM.functions.SetFullCharge = { -- sorry, for name order.
|
||||
name = "Set Full Charge",
|
||||
tip = "repairTip",
|
||||
icon = "icon16/wrench.png",
|
||||
OnRun = function(item)
|
||||
item:SetData("charge", 10)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
local client = item.player
|
||||
return IsValid(client) and client:IsAdmin()
|
||||
end
|
||||
}
|
||||
|
||||
-- Setting damageInfo manually because we're doing some weirdness with the item destruction.
|
||||
function ITEM:OnEntityTakeDamage(entity, damageInfo)
|
||||
entity.ixDamageInfo = {damageInfo:GetAttacker(), damage, damageInfo:GetInflictor()}
|
||||
end
|
||||
|
||||
if (SERVER) then return end
|
||||
|
||||
function ITEM:PopulateTooltip(tooltip)
|
||||
local charge = self:GetData("charge", 0)
|
||||
local color = PLUGIN.chargeIndicatorColors[charge] or Color(255, 0, 0)
|
||||
|
||||
local name = tooltip:GetRow("name")
|
||||
name:SetBackgroundColor(color)
|
||||
|
||||
local chargePnl = tooltip:AddRow("charge")
|
||||
chargePnl:SetBackgroundColor(color)
|
||||
chargePnl:SetText("Şarj: " .. (charge * 10) .. "%")
|
||||
chargePnl:SizeToContents()
|
||||
end
|
||||
|
||||
function ITEM:DrawEntity(entity)
|
||||
if (entity.colorSetup) then return end
|
||||
|
||||
entity.GetBatteryColor = function()
|
||||
local color = entity:GetNetVar("beeping", false) and Color(255, 0, 0) or PLUGIN.chargeIndicatorColors[entity:GetData("charge", 0)] or Color(0, 255, 255)
|
||||
|
||||
return Vector(color.r / 255, color.g / 255, color.b / 255)
|
||||
end
|
||||
|
||||
entity.colorSetup = true
|
||||
end
|
||||
|
||||
function ITEM:OnInventoryDraw(entity)
|
||||
entity.GetBatteryColor = function()
|
||||
local color = PLUGIN.chargeIndicatorColors[self:GetData("charge", 0)] or Color(255, 0, 0)
|
||||
|
||||
return Vector(color.r / 255, color.g / 255, color.b / 255)
|
||||
end
|
||||
end
|
||||
|
||||
matproxy.Add({
|
||||
name = "BatteryColor",
|
||||
init = function(self, mat, values)
|
||||
self.ResultTo = values.resultvar
|
||||
end,
|
||||
bind = function(self, mat, ent)
|
||||
if (ent.GetBatteryColor) then
|
||||
mat:SetVector(self.ResultTo, ent:GetBatteryColor())
|
||||
end
|
||||
end
|
||||
})
|
||||
28
gamemodes/darkrp/plugins/goi_factory/items/sh_datadisc.lua
Normal file
28
gamemodes/darkrp/plugins/goi_factory/items/sh_datadisc.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.name = "Data-Disk"
|
||||
ITEM.model = "models/willardnetworks/gearsofindustry/wn_data_card.mdl"
|
||||
ITEM.category = "Combine"
|
||||
ITEM.description = "Küçük, veri depolamak için ince bir metalik disk."
|
||||
|
||||
function ITEM:GetSkin()
|
||||
return self:GetData("item") and 0 or 1
|
||||
end
|
||||
|
||||
function ITEM:PopulateTooltip(tooltip)
|
||||
local item = self:GetData("item")
|
||||
|
||||
local itemPnl = tooltip:AddRow("item")
|
||||
itemPnl:SetBackgroundColor(derma.GetColor(item and "Info" or "Error", tooltip))
|
||||
itemPnl:SetText(item and "Kodlanmış Öğe: " .. ix.item.list[item].name or "Diskte Kodlanmış Veri Yok")
|
||||
itemPnl:SizeToContents()
|
||||
end
|
||||
94
gamemodes/darkrp/plugins/goi_factory/items/sh_itemlabel.lua
Normal file
94
gamemodes/darkrp/plugins/goi_factory/items/sh_itemlabel.lua
Normal file
@@ -0,0 +1,94 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.name = "Item Label"
|
||||
ITEM.model = "models/props_lab/box01a.mdl"
|
||||
ITEM.description = "A label that can be applied on any item to change its name & description."
|
||||
|
||||
function ITEM:GetName()
|
||||
local name = self:GetData("labelInfoName")
|
||||
return self.name .. (name and (" \"" .. name .. "\"") or "")
|
||||
end
|
||||
|
||||
function ITEM:GetDescription()
|
||||
local description = self:GetData("labelInfoDesc")
|
||||
return self.description .. (description and (" It reads: \"" .. description .. "\"") or "")
|
||||
end
|
||||
|
||||
ITEM.functions.editAName = { -- Sorry, I wanted it at the top
|
||||
name = "Edit Name",
|
||||
icon = "icon16/tag_blue_edit.png",
|
||||
OnRun = function(item, data)
|
||||
local client = item.player
|
||||
|
||||
client:RequestString("Edit Label Name", "Bu etiketin sahip olması gereken adı girin:", function(name)
|
||||
item:SetData("labelInfoName", name)
|
||||
client:Notify("Bu etiketin adını değiştirdiniz.")
|
||||
end, "")
|
||||
|
||||
return false
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.editDesc = {
|
||||
name = "Edit Description",
|
||||
icon = "icon16/tag_blue_edit.png",
|
||||
OnRun = function(item, data)
|
||||
local client = item.player
|
||||
|
||||
client:RequestString("Edit Label Description", "Bu etiketin sahip olması gereken açıklamayı girin:", function(description)
|
||||
item:SetData("labelInfoDesc", description)
|
||||
|
||||
client:Notify("Bu etiketin adını değiştirdiniz.")
|
||||
end, "")
|
||||
|
||||
return false
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.combined = {
|
||||
OnRun = function(item, data)
|
||||
local targetItem = ix.item.instances[data[1]]
|
||||
|
||||
if (!targetItem) then return false end
|
||||
|
||||
if (targetItem.functions.combine) then
|
||||
client:Notify("Bu öğeye etiket uygulayamazsınız!")
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
local client = item.player
|
||||
|
||||
if (targetItem.uniqueID == "itemlabel") then
|
||||
client:Notify("Bir etiketi başka bir etikete uygulayamazsınız!")
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
local name = item:GetData("labelInfoName", false)
|
||||
local description = item:GetData("labelInfoDesc", false)
|
||||
|
||||
if (!name and !description) then
|
||||
client:Notify("Etiket boş!")
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
targetItem:SetData("labelName", name)
|
||||
targetItem:SetData("labelDescription", description)
|
||||
|
||||
client:Notify("Etiketi şuna uyguladınız: " .. targetItem.name .. ".")
|
||||
end,
|
||||
OnCanRun = function(item, data)
|
||||
return true
|
||||
end
|
||||
}
|
||||
101
gamemodes/darkrp/plugins/goi_factory/libs/sh_fabrication.lua
Normal file
101
gamemodes/darkrp/plugins/goi_factory/libs/sh_fabrication.lua
Normal file
@@ -0,0 +1,101 @@
|
||||
--[[
|
||||
| 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 ix = ix
|
||||
ix.fabrication = ix.fabrication or {}
|
||||
ix.fabrication.list = ix.fabrication.list or {}
|
||||
ix.fabrication.EXISTING_CATS = {
|
||||
["advancedtech"] = true,
|
||||
["tech"] = true,
|
||||
["bio"] = true
|
||||
}
|
||||
ix.fabrication.MAIN_MATS = {
|
||||
["advancedtech"] = "comp_condensed_resin",
|
||||
["tech"] = "comp_resin",
|
||||
["bio"] = "biopaste"
|
||||
}
|
||||
|
||||
function ix.fabrication:Register(id, category, mainMaterialCost)
|
||||
local fabrication = setmetatable({
|
||||
id = id,
|
||||
category = "",
|
||||
mainMaterialCost = 1
|
||||
}, ix.meta.fabrication)
|
||||
|
||||
local cat = fabrication:SetCategory(category)
|
||||
local material = fabrication:SetMainMaterialCost(mainMaterialCost)
|
||||
|
||||
if !cat or !material then
|
||||
fabrication = nil
|
||||
return
|
||||
end
|
||||
|
||||
ix.fabrication.list[id] = fabrication
|
||||
return fabrication
|
||||
end
|
||||
|
||||
function ix.fabrication:Get(id)
|
||||
return ix.fabrication.list[id]
|
||||
end
|
||||
|
||||
function ix.fabrication:GetAll()
|
||||
return ix.fabrication.list
|
||||
end
|
||||
|
||||
function ix.fabrication:GetAllAdvancedTech()
|
||||
local t = {}
|
||||
for id, fab in pairs(ix.fabrication.list) do
|
||||
if fab.category != "advancedtech" then continue end
|
||||
t[id] = fab
|
||||
end
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
function ix.fabrication:GetAllTech()
|
||||
local t = {}
|
||||
for id, fab in pairs(ix.fabrication.list) do
|
||||
if fab.category != "tech" then continue end
|
||||
t[id] = fab
|
||||
end
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
function ix.fabrication:GetAllBio()
|
||||
local t = {}
|
||||
for id, fab in pairs(ix.fabrication.list) do
|
||||
if fab.category != "bio" then continue end
|
||||
t[id] = fab
|
||||
end
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
function ix.fabrication:GetAdvancedTech(id)
|
||||
local fabrication = ix.fabrication.list[id]
|
||||
if fabrication and fabrication.category == "advancedtech" then
|
||||
return fabrication
|
||||
end
|
||||
end
|
||||
|
||||
function ix.fabrication:GetTech(id)
|
||||
local fabrication = ix.fabrication.list[id]
|
||||
if fabrication and fabrication.category == "tech" then
|
||||
return fabrication
|
||||
end
|
||||
end
|
||||
|
||||
function ix.fabrication:GetBio(id)
|
||||
local fabrication = ix.fabrication.list[id]
|
||||
if fabrication and fabrication.category == "bio" then
|
||||
return fabrication
|
||||
end
|
||||
end
|
||||
55
gamemodes/darkrp/plugins/goi_factory/meta/sh_fabrication.lua
Normal file
55
gamemodes/darkrp/plugins/goi_factory/meta/sh_fabrication.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
--[[
|
||||
| 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 FABRICATION = ix.meta.fabrication or {}
|
||||
FABRICATION.__index = FABRICATION
|
||||
FABRICATION.id = ""
|
||||
FABRICATION.category = ""
|
||||
FABRICATION.mainMaterialCost = 1
|
||||
|
||||
function FABRICATION:__tostring()
|
||||
return "FABRICATION: " .. self.id
|
||||
end
|
||||
|
||||
function FABRICATION:__eq(other)
|
||||
return self:GetID() == other:GetID()
|
||||
end
|
||||
|
||||
function FABRICATION:SetCategory(category)
|
||||
if !category or !ix.fabrication.EXISTING_CATS[category] then
|
||||
return false
|
||||
end
|
||||
self.category = category
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function FABRICATION:GetCategory()
|
||||
return self.category
|
||||
end
|
||||
|
||||
function FABRICATION:SetMainMaterialCost(mainMaterialCost)
|
||||
if !mainMaterialCost or !isnumber(mainMaterialCost) then
|
||||
return false
|
||||
end
|
||||
self.mainMaterialCost = mainMaterialCost
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function FABRICATION:GetMainMaterialCost()
|
||||
return self.mainMaterialCost
|
||||
end
|
||||
|
||||
function FABRICATION:GetID()
|
||||
return self.id
|
||||
end
|
||||
|
||||
ix.meta.fabrication = FABRICATION
|
||||
423
gamemodes/darkrp/plugins/goi_factory/sh_fabrication_list.lua
Normal file
423
gamemodes/darkrp/plugins/goi_factory/sh_fabrication_list.lua
Normal file
@@ -0,0 +1,423 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
/*
|
||||
Resin Costs:
|
||||
Bio = 6 Credits
|
||||
Tech = 12 Credits (Price is designed to help CWU afford Product)
|
||||
AdvancedTech = 120 Credits
|
||||
*/
|
||||
|
||||
-- Food --
|
||||
ix.fabrication:Register("proc_nutrient_bar", "bio", 1)
|
||||
ix.fabrication:Register("proc_paste", "bio", 1)
|
||||
ix.fabrication:Register("metropolicesupplements", "bio", 3)
|
||||
ix.fabrication:Register("artificial_cheesepaste", "bio", 1)
|
||||
ix.fabrication:Register("artificial_cheese", "bio", 1)
|
||||
ix.fabrication:Register("artificial_meatpaste", "bio", 2)
|
||||
ix.fabrication:Register("artificial_stew", "bio", 4)
|
||||
ix.fabrication:Register("artificial_stirfry", "bio", 6)
|
||||
ix.fabrication:Register("artificial_skewer", "bio", 1)
|
||||
ix.fabrication:Register("artificial_meat", "bio", 2)
|
||||
ix.fabrication:Register("baking_bread_slice", "bio", 1)
|
||||
ix.fabrication:Register("baking_treat", "bio", 1)
|
||||
ix.fabrication:Register("baking_doughnut", "bio", 1)
|
||||
ix.fabrication:Register("baking_bread_half", "bio", 2)
|
||||
ix.fabrication:Register("baking_bread", "bio", 3)
|
||||
ix.fabrication:Register("pickled_egg", "bio", 1)
|
||||
ix.fabrication:Register("pickled_leech", "bio", 1)
|
||||
ix.fabrication:Register("pickled_vegetables", "bio", 2)
|
||||
ix.fabrication:Register("food_crackers", "bio", 1)
|
||||
ix.fabrication:Register("food_crisps", "bio", 1)
|
||||
ix.fabrication:Register("food_peanuts", "bio", 1)
|
||||
ix.fabrication:Register("leech_skewer", "bio", 1)
|
||||
ix.fabrication:Register("comfort_toast", "bio", 1)
|
||||
ix.fabrication:Register("comfort_pancake", "bio", 2)
|
||||
ix.fabrication:Register("luxury_choc", "bio", 3)
|
||||
|
||||
-- Drinks --
|
||||
ix.fabrication:Register("drink_breen_water", "bio", 1)
|
||||
ix.fabrication:Register("drink_premium_water", "bio", 1)
|
||||
ix.fabrication:Register("drink_sparkling_water", "bio", 1)
|
||||
ix.fabrication:Register("drink_proc_beer", "bio", 1)
|
||||
ix.fabrication:Register("drink_proc_bourbon", "bio", 1)
|
||||
ix.fabrication:Register("drink_proc_fruit_juice", "bio", 1)
|
||||
ix.fabrication:Register("drink_proc_lemonade", "bio", 1)
|
||||
ix.fabrication:Register("drink_proc_vodka", "bio", 1)
|
||||
ix.fabrication:Register("drink_proc_whiskey", "bio", 1)
|
||||
ix.fabrication:Register("drink_banksoda_grey", "bio", 2)
|
||||
ix.fabrication:Register("drink_beer", "bio", 3)
|
||||
ix.fabrication:Register("drink_boboriginal", "bio", 2)
|
||||
ix.fabrication:Register("drink_milk", "bio", 1)
|
||||
ix.fabrication:Register("nutrientdrink", "bio", 2)
|
||||
ix.fabrication:Register("drink_wi_coffee", "bio", 2)
|
||||
|
||||
-- Fabricator Only --
|
||||
ix.fabrication:Register("fab_beef", "bio", 2)
|
||||
ix.fabrication:Register("fab_butter", "bio", 1)
|
||||
ix.fabrication:Register("fab_cheese", "bio", 1)
|
||||
ix.fabrication:Register("fab_dish", "bio", 3)
|
||||
ix.fabrication:Register("fab_fish", "bio", 3)
|
||||
ix.fabrication:Register("fab_meatpaste", "bio", 2)
|
||||
ix.fabrication:Register("fab_noddles", "bio", 1)
|
||||
ix.fabrication:Register("fab_sandwich", "bio", 1)
|
||||
ix.fabrication:Register("combinebattery", "tech", 10)
|
||||
|
||||
-- Audiobook Languages --
|
||||
ix.fabrication:Register("languagebox_albanian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_arabic", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_bengali", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_bosnian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_bulgarian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_chinese", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_croatian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_czech", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_danish", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_dutch", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_finnish", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_flipino", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_french", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_gaeilge", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_gaelic", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_german", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_greek", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_hebrew", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_hindi", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_hungarian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_indonesian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_italian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_japanese", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_korean", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_polish", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_portuguese", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_romanian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_russian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_serbian", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_spanish", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_swahili", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_swedish", "tech", 5)
|
||||
ix.fabrication:Register("languagebox_turkish", "tech", 5)
|
||||
|
||||
-- Clothing --
|
||||
ix.fabrication:Register("head_blue_beanie", "tech", 1)
|
||||
ix.fabrication:Register("beanie_brown", "tech", 1)
|
||||
ix.fabrication:Register("beanie_red", "tech", 1)
|
||||
ix.fabrication:Register("beanie_grey", "tech", 1)
|
||||
ix.fabrication:Register("head_green_beanie", "tech", 1)
|
||||
ix.fabrication:Register("head_visor_cap", "tech", 1)
|
||||
ix.fabrication:Register("head_military_cap", "tech", 1)
|
||||
ix.fabrication:Register("head_chef_hat", "tech", 1)
|
||||
ix.fabrication:Register("head_flat_cap", "tech", 1)
|
||||
ix.fabrication:Register("head_boonie_hat", "tech", 1)
|
||||
ix.fabrication:Register("face_bandana", "tech", 1)
|
||||
ix.fabrication:Register("head_gasmask", "tech", 2)
|
||||
ix.fabrication:Register("face_mask", "tech", 1)
|
||||
ix.fabrication:Register("hardhat_blue", "tech", 1)
|
||||
ix.fabrication:Register("head_hardhat", "tech", 1)
|
||||
ix.fabrication:Register("hardhat_green", "tech", 1)
|
||||
ix.fabrication:Register("hardhat_grey", "tech", 1)
|
||||
ix.fabrication:Register("hardhat_white", "tech", 1)
|
||||
ix.fabrication:Register("worker_blue", "tech", 2)
|
||||
ix.fabrication:Register("worker_dark", "tech", 2)
|
||||
ix.fabrication:Register("worker_green", "tech", 2)
|
||||
ix.fabrication:Register("worker_grey", "tech", 2)
|
||||
ix.fabrication:Register("worker_orange", "tech", 2)
|
||||
ix.fabrication:Register("torso_red_worker_jacket", "tech", 2)
|
||||
ix.fabrication:Register("torso_yellow_worker_jacket", "tech", 2)
|
||||
ix.fabrication:Register("worker_uniform", "tech", 3)
|
||||
ix.fabrication:Register("worker_uniform2", "tech", 3)
|
||||
ix.fabrication:Register("white_hazmat_uniform", "tech", 3)
|
||||
ix.fabrication:Register("orange_hazmat_uniform", "tech", 3)
|
||||
ix.fabrication:Register("yellow_hazmat_uniform", "tech", 3)
|
||||
ix.fabrication:Register("vortigaunt_head_hardhat", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_torso_cwu", "tech", 2)
|
||||
ix.fabrication:Register("buttoned_black", "tech", 1)
|
||||
ix.fabrication:Register("buttoned_beige", "tech", 1)
|
||||
ix.fabrication:Register("buttoned_blue", "tech", 1)
|
||||
ix.fabrication:Register("jumpsuit_black", "tech", 1)
|
||||
ix.fabrication:Register("jumpsuit_blue", "tech", 1)
|
||||
ix.fabrication:Register("medic_blue", "tech", 2)
|
||||
ix.fabrication:Register("medic_green", "tech", 2)
|
||||
ix.fabrication:Register("torso_medic_shirt", "tech", 2)
|
||||
ix.fabrication:Register("medic_red", "tech", 2)
|
||||
ix.fabrication:Register("buttoned_white", "tech", 1)
|
||||
ix.fabrication:Register("jumpsuit_red", "tech", 1)
|
||||
ix.fabrication:Register("buttoned_red", "tech", 1)
|
||||
ix.fabrication:Register("jumpsuit_orange", "tech", 1)
|
||||
ix.fabrication:Register("hands_medical_gloves", "tech", 1)
|
||||
ix.fabrication:Register("buttoned_lightblue", "tech", 1)
|
||||
ix.fabrication:Register("jumpsuit_grey", "tech", 1)
|
||||
ix.fabrication:Register("buttoned_green", "tech", 1)
|
||||
ix.fabrication:Register("hands_gloves", "tech", 1)
|
||||
ix.fabrication:Register("hands_tipless_gloves", "tech", 1)
|
||||
ix.fabrication:Register("jumpsuit", "tech", 1)
|
||||
ix.fabrication:Register("buttoned_brown", "tech", 1)
|
||||
ix.fabrication:Register("jumpsuit_brown", "tech", 1)
|
||||
ix.fabrication:Register("torso_blue_rebel_uniform", "advancedtech", 1)
|
||||
ix.fabrication:Register("torso_green_rebel_uniform", "advancedtech", 1)
|
||||
ix.fabrication:Register("torso_medical_rebel_uniform", "advancedtech", 1)
|
||||
ix.fabrication:Register("legs_blue_padded_pants", "tech", 2)
|
||||
ix.fabrication:Register("legs_black_padded_pants", "tech", 2)
|
||||
ix.fabrication:Register("legs_green_padded_pants", "tech", 2)
|
||||
ix.fabrication:Register("torso_brown_trench", "advancedtech", 1)
|
||||
ix.fabrication:Register("legs_civilian_beige", "tech", 1)
|
||||
ix.fabrication:Register("legs_jumpsuit_black", "tech", 1)
|
||||
ix.fabrication:Register("legs_civilian_black", "tech", 1)
|
||||
ix.fabrication:Register("legs_jumpsuit_blue", "tech", 1)
|
||||
ix.fabrication:Register("legs_blue_pants", "tech", 1)
|
||||
ix.fabrication:Register("legs_jumpsuit_brown", "tech", 1)
|
||||
ix.fabrication:Register("legs_civilian_brown", "tech", 1)
|
||||
ix.fabrication:Register("legs_green_pants", "tech", 1)
|
||||
ix.fabrication:Register("legs_grey_pants", "tech", 1)
|
||||
ix.fabrication:Register("legs_civilian_darkred", "tech", 1)
|
||||
ix.fabrication:Register("legs_jumpsuit_green", "tech", 1)
|
||||
ix.fabrication:Register("legs_civilian_green", "tech", 1)
|
||||
ix.fabrication:Register("legs_jumpsuit_grey", "tech", 1)
|
||||
ix.fabrication:Register("legs_light_grey_pants", "tech", 1)
|
||||
ix.fabrication:Register("legs_jumpsuit", "tech", 1)
|
||||
ix.fabrication:Register("legs_civilian_lightblue", "tech", 1)
|
||||
ix.fabrication:Register("legs_jumpsuit_orange", "tech", 1)
|
||||
ix.fabrication:Register("legs_civilian_purple", "tech", 1)
|
||||
ix.fabrication:Register("legs_jumpsuit_red", "tech", 1)
|
||||
ix.fabrication:Register("legs_civilian_red", "tech", 1)
|
||||
ix.fabrication:Register("legs_civilian_teal", "tech", 1)
|
||||
ix.fabrication:Register("legs_civilian_yellow", "tech", 1)
|
||||
ix.fabrication:Register("shoes_black_shoes", "tech", 1)
|
||||
ix.fabrication:Register("shoes_leather_brown", "tech", 1)
|
||||
ix.fabrication:Register("shoes_brown_shoes", "tech", 1)
|
||||
ix.fabrication:Register("shoes_blue_shoes", "tech", 1)
|
||||
ix.fabrication:Register("shoes_red", "tech", 1)
|
||||
ix.fabrication:Register("shoes_leather_dark", "tech", 1)
|
||||
ix.fabrication:Register("shoes_grey", "tech", 1)
|
||||
ix.fabrication:Register("shoes_rain_boots", "tech", 1)
|
||||
ix.fabrication:Register("torso_labcoat", "tech", 3)
|
||||
ix.fabrication:Register("torso_black_coat", "tech", 1)
|
||||
ix.fabrication:Register("denim_black", "tech", 1)
|
||||
ix.fabrication:Register("khaki_black", "tech", 1)
|
||||
ix.fabrication:Register("weather_black", "tech", 1)
|
||||
ix.fabrication:Register("worn_black", "tech", 1)
|
||||
ix.fabrication:Register("zipper_black", "tech", 1)
|
||||
ix.fabrication:Register("denim_blue", "tech", 1)
|
||||
ix.fabrication:Register("khaki_blue", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_blue", "tech", 1)
|
||||
ix.fabrication:Register("plaid_blue", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_blue", "tech", 1)
|
||||
ix.fabrication:Register("weather_blue", "tech", 1)
|
||||
ix.fabrication:Register("wool_blue", "tech", 1)
|
||||
ix.fabrication:Register("worn_blue", "tech", 1)
|
||||
ix.fabrication:Register("zipper_blue", "tech", 1)
|
||||
ix.fabrication:Register("torso_khaki_jacket", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_brown", "tech", 1)
|
||||
ix.fabrication:Register("plaid_brown", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_brown", "tech", 1)
|
||||
ix.fabrication:Register("weather_brown", "tech", 1)
|
||||
ix.fabrication:Register("wool_brown", "tech", 1)
|
||||
ix.fabrication:Register("weather_burgundy", "tech", 1)
|
||||
ix.fabrication:Register("wool_burgundy", "tech", 1)
|
||||
ix.fabrication:Register("casual_blue", "tech", 1)
|
||||
ix.fabrication:Register("casual_bluered", "tech", 1)
|
||||
ix.fabrication:Register("casual_brown", "tech", 1)
|
||||
ix.fabrication:Register("casual_darkblue", "tech", 1)
|
||||
ix.fabrication:Register("casual_darkred", "tech", 1)
|
||||
ix.fabrication:Register("casual_green", "tech", 1)
|
||||
ix.fabrication:Register("torso_black_jacket", "tech", 1)
|
||||
ix.fabrication:Register("casual_greygreen", "tech", 1)
|
||||
ix.fabrication:Register("casual_orange", "tech", 1)
|
||||
ix.fabrication:Register("casual_purple", "tech", 1)
|
||||
ix.fabrication:Register("casual_red", "tech", 1)
|
||||
ix.fabrication:Register("weather_darkblue", "tech", 1)
|
||||
ix.fabrication:Register("plaid_darkbrown", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_darkgreen", "tech", 1)
|
||||
ix.fabrication:Register("plaid_darkgrey", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_dark", "tech", 1)
|
||||
ix.fabrication:Register("plaid_dark", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_dark", "tech", 1)
|
||||
ix.fabrication:Register("weather_fuscous", "tech", 1)
|
||||
ix.fabrication:Register("denim_green", "tech", 1)
|
||||
ix.fabrication:Register("jumpsuit_green", "tech", 1)
|
||||
ix.fabrication:Register("khaki_green", "tech", 1)
|
||||
ix.fabrication:Register("torso_green_jacket", "tech", 1)
|
||||
ix.fabrication:Register("plaid_green", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_green", "tech", 1)
|
||||
ix.fabrication:Register("weather_green", "tech", 1)
|
||||
ix.fabrication:Register("torso_green_coat", "tech", 1)
|
||||
ix.fabrication:Register("worn_green", "tech", 1)
|
||||
ix.fabrication:Register("zipper_green", "tech", 1)
|
||||
ix.fabrication:Register("torso_blue_shirt", "tech", 1)
|
||||
ix.fabrication:Register("khaki_grey", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_grey", "tech", 1)
|
||||
ix.fabrication:Register("torso_blue_jacket", "tech", 1)
|
||||
ix.fabrication:Register("torso_black_stylilanguagejacket", "tech", 1)
|
||||
ix.fabrication:Register("wool_green", "tech", 1)
|
||||
ix.fabrication:Register("worn_grey", "tech", 1)
|
||||
ix.fabrication:Register("wool_gunmetal", "tech", 1)
|
||||
ix.fabrication:Register("khaki_hurricane", "tech", 1)
|
||||
ix.fabrication:Register("zipper_kombu", "tech", 1)
|
||||
ix.fabrication:Register("weather_lavender", "tech", 1)
|
||||
ix.fabrication:Register("torso_leather_jacket", "tech", 1)
|
||||
ix.fabrication:Register("plaid_lightbrown", "tech", 1)
|
||||
ix.fabrication:Register("plaid_lightgrey", "tech", 1)
|
||||
ix.fabrication:Register("torso_plaid_jacket", "tech", 1)
|
||||
ix.fabrication:Register("khaki_matterhorn", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_murky", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_murky", "tech", 1)
|
||||
ix.fabrication:Register("weather_murky", "tech", 1)
|
||||
ix.fabrication:Register("zipper_oldburgundy", "tech", 1)
|
||||
ix.fabrication:Register("wool_onyx", "tech", 1)
|
||||
ix.fabrication:Register("weather_nickel", "tech", 1)
|
||||
ix.fabrication:Register("khaki_orange", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_orange", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_orange", "tech", 1)
|
||||
ix.fabrication:Register("weather_orange", "tech", 1)
|
||||
ix.fabrication:Register("wool_orange", "tech", 1)
|
||||
ix.fabrication:Register("zipper_orange", "tech", 1)
|
||||
ix.fabrication:Register("khaki_purple", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_purple", "tech", 1)
|
||||
ix.fabrication:Register("plaid_purple", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_purple", "tech", 1)
|
||||
ix.fabrication:Register("weather_purple", "tech", 1)
|
||||
ix.fabrication:Register("wool_purple", "tech", 1)
|
||||
ix.fabrication:Register("zipper_purple", "tech", 1)
|
||||
ix.fabrication:Register("denim_red", "tech", 1)
|
||||
ix.fabrication:Register("khaki_red", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_red", "tech", 1)
|
||||
ix.fabrication:Register("plaid_red", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_red", "tech", 1)
|
||||
ix.fabrication:Register("torso_red_jacket", "tech", 1)
|
||||
ix.fabrication:Register("torso_winter_jacket", "tech", 1)
|
||||
ix.fabrication:Register("wool_red", "tech", 1)
|
||||
ix.fabrication:Register("worn_red", "tech", 1)
|
||||
ix.fabrication:Register("zipper_red", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_shady", "tech", 1)
|
||||
ix.fabrication:Register("khaki_shuttle", "tech", 1)
|
||||
ix.fabrication:Register("torso_sporty_jacket", "tech", 1)
|
||||
ix.fabrication:Register("zipper_taupe", "tech", 1)
|
||||
ix.fabrication:Register("overcoat_teal", "tech", 1)
|
||||
ix.fabrication:Register("weather_teal", "tech", 1)
|
||||
ix.fabrication:Register("weather_white", "tech", 1)
|
||||
ix.fabrication:Register("raincoat_yellow", "tech", 1)
|
||||
ix.fabrication:Register("weather_yellow", "tech", 1)
|
||||
ix.fabrication:Register("torso_grey_jacket", "tech", 1)
|
||||
ix.fabrication:Register("shoes_heels", "advancedtech", 4) -- It's well known that heels & dress shoes are actually bulletproof which is why they cost 500cr each...
|
||||
ix.fabrication:Register("shoes_dress_shoes", "advancedtech", 4)
|
||||
ix.fabrication:Register("vortigaunt_head_fedora", "tech", 3)
|
||||
ix.fabrication:Register("vortigaunt_bandana", "tech", 1)
|
||||
ix.fabrication:Register("vortigaunt_head_chefhat", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_head_hardhat", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_head_flatcap", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_head_boonie", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_torso_hoodie", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_torso_sweater", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_torso_light", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_torso_light2", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_bandages", "tech", 2)
|
||||
ix.fabrication:Register("vortigaunt_belt", "tech", 2)
|
||||
|
||||
-- Ingredients --
|
||||
ix.fabrication:Register("ing_herbs", "bio", 1)
|
||||
ix.fabrication:Register("ing_margarine", "bio", 1)
|
||||
ix.fabrication:Register("ing_noodles", "bio", 1)
|
||||
ix.fabrication:Register("ing_spices", "bio", 1)
|
||||
ix.fabrication:Register("ing_protein", "bio", 1)
|
||||
ix.fabrication:Register("ing_sweet", "bio", 1)
|
||||
ix.fabrication:Register("ing_salt", "bio", 1)
|
||||
ix.fabrication:Register("ing_vegetable_pack", "bio", 1)
|
||||
ix.fabrication:Register("ing_coffee_powder", "bio", 1)
|
||||
|
||||
-- Materials / Crafting --
|
||||
ix.fabrication:Register("comp_scrap", "tech", 1)
|
||||
ix.fabrication:Register("comp_cloth", "tech", 1)
|
||||
ix.fabrication:Register("comp_plastic", "tech", 1)
|
||||
ix.fabrication:Register("comp_screws", "tech", 1)
|
||||
ix.fabrication:Register("comp_electronics", "tech", 1)
|
||||
ix.fabrication:Register("comp_adhesive", "tech", 2)
|
||||
ix.fabrication:Register("comp_charcoal", "tech", 2)
|
||||
ix.fabrication:Register("comp_wood", "tech", 1)
|
||||
ix.fabrication:Register("crafting_water", "bio", 1)
|
||||
ix.fabrication:Register("drug_artificialfun", "bio", 2)
|
||||
ix.fabrication:Register("comp_condensed_resin", "tech", 10)
|
||||
ix.fabrication:Register("ing_flour", "bio", 1)
|
||||
ix.fabrication:Register("ing_vinegar", "bio", 1)
|
||||
|
||||
-- Medical --
|
||||
ix.fabrication:Register("comp_syringe", "tech", 1)
|
||||
ix.fabrication:Register("comp_alcohol", "bio", 1)
|
||||
ix.fabrication:Register("comp_chemicals", "bio", 2)
|
||||
ix.fabrication:Register("bandage", "bio", 1)
|
||||
ix.fabrication:Register("drink_saline", "bio", 2)
|
||||
|
||||
-- Tools --
|
||||
ix.fabrication:Register("tool_scissors", "tech", 1)
|
||||
ix.fabrication:Register("tool_spoon", "tech", 1)
|
||||
ix.fabrication:Register("tool_wrench", "tech", 1)
|
||||
ix.fabrication:Register("tool_toolkit", "tech", 4)
|
||||
ix.fabrication:Register("buildingmaterials", "advancedtech", 1)
|
||||
ix.fabrication:Register("tool_fryingpan", "tech", 1)
|
||||
ix.fabrication:Register("tool_kettle", "tech", 1)
|
||||
ix.fabrication:Register("tool_cookingpot", "tech", 1)
|
||||
ix.fabrication:Register("tool_knife", "tech", 1)
|
||||
ix.fabrication:Register("flashlight", "tech", 1)
|
||||
ix.fabrication:Register("cont_lock_t1", "tech", 2)
|
||||
ix.fabrication:Register("highquality_filter", "advancedtech", 1)
|
||||
ix.fabrication:Register("tool_coffeemachine", "tech", 4)
|
||||
ix.fabrication:Register("zippolighter", "tech", 2)
|
||||
|
||||
-- Melee Weapons --
|
||||
ix.fabrication:Register("leadpipe", "tech", 2)
|
||||
ix.fabrication:Register("clawhammer", "tech", 3)
|
||||
ix.fabrication:Register("cleaver", "tech", 3)
|
||||
ix.fabrication:Register("fireaxe", "advancedtech", 1)
|
||||
ix.fabrication:Register("crowbar", "advancedtech", 1)
|
||||
ix.fabrication:Register("fubar", "advancedtech", 2)
|
||||
ix.fabrication:Register("hatchet", "tech", 4)
|
||||
ix.fabrication:Register("kitknife", "tech", 1)
|
||||
ix.fabrication:Register("machete", "tech", 3)
|
||||
ix.fabrication:Register("pickaxe", "advancedtech", 1)
|
||||
ix.fabrication:Register("sledgehammer", "advancedtech", 1)
|
||||
ix.fabrication:Register("spade", "tech", 4)
|
||||
ix.fabrication:Register("wrench", "tech", 3)
|
||||
ix.fabrication:Register("riotshield", "advancedtech", 2)
|
||||
|
||||
-- Combine --
|
||||
ix.fabrication:Register("tool_repair", "advancedtech", 2)
|
||||
ix.fabrication:Register("rappel_gear", "advancedtech", 2)
|
||||
ix.fabrication:Register("vortigaunt_slave_collar", "advancedtech", 1)
|
||||
ix.fabrication:Register("vortigaunt_slave_hooks", "advancedtech", 1)
|
||||
ix.fabrication:Register("vortigaunt_slave_shackles", "advancedtech", 1)
|
||||
ix.fabrication:Register("combinelock", "advancedtech", 1)
|
||||
ix.fabrication:Register("cwulock", "advancedtech", 1)
|
||||
ix.fabrication:Register("cmrulock", "advancedtech", 1)
|
||||
ix.fabrication:Register("doblock", "advancedtech", 1)
|
||||
ix.fabrication:Register("moelock", "advancedtech", 1)
|
||||
|
||||
-- Electronic --
|
||||
ix.fabrication:Register("grouplock", "advancedtech", 1)
|
||||
ix.fabrication:Register("infestation_detector", "tech", 2)
|
||||
ix.fabrication:Register("floppydisk", "advancedtech", 1)
|
||||
ix.fabrication:Register("handheld_radio", "advancedtech", 1)
|
||||
ix.fabrication:Register("musicradio_cmb", "advancedtech", 2)
|
||||
|
||||
-- Gear --
|
||||
ix.fabrication:Register("smallbag", "advancedtech", 1)
|
||||
ix.fabrication:Register("largebag", "advancedtech", 2)
|
||||
ix.fabrication:Register("bullet_pouch", "advancedtech", 1)
|
||||
ix.fabrication:Register("mag_pouch", "advancedtech", 1)
|
||||
ix.fabrication:Register("medical_pouch", "advancedtech", 1)
|
||||
ix.fabrication:Register("pos_terminal", "tech", 4)
|
||||
|
||||
-- Misc --
|
||||
ix.fabrication:Register("paper", "bio", 1)
|
||||
ix.fabrication:Register("black_ink", "bio", 2)
|
||||
ix.fabrication:Register("notepad", "bio", 2)
|
||||
ix.fabrication:Register("book", "bio", 3)
|
||||
ix.fabrication:Register("lighter", "bio", 2)
|
||||
ix.fabrication:Register("suitcase", "tech", 2)
|
||||
ix.fabrication:Register("pin", "tech", 1)
|
||||
ix.fabrication:Register("makeshift_filter", "advancedtech", 1)
|
||||
107
gamemodes/darkrp/plugins/goi_factory/sh_plugin.lua
Normal file
107
gamemodes/darkrp/plugins/goi_factory/sh_plugin.lua
Normal file
@@ -0,0 +1,107 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
PLUGIN.name = "Willard Factory"
|
||||
PLUGIN.author = "Aspect™"
|
||||
PLUGIN.description = "Adds various features and machinery used in workshifts."
|
||||
|
||||
PLUGIN.chargeIndicatorColors = {
|
||||
[0] = Color(255, 0, 0),
|
||||
[1] = Color(255, 150, 0),
|
||||
[2] = Color(255, 0, 255),
|
||||
[3] = Color(150, 0, 255),
|
||||
[4] = Color(255, 255, 0),
|
||||
[5] = Color(150, 255, 0),
|
||||
[6] = Color(0, 255, 0),
|
||||
[7] = Color(0, 0, 255),
|
||||
[8] = Color(0, 100, 255),
|
||||
[9] = Color(0, 255, 150),
|
||||
[10] = Color(0, 255, 255)
|
||||
}
|
||||
|
||||
ix.command.Add("LinkShopTerminal", {
|
||||
description = "Link shop terminal to an actual shop.",
|
||||
arguments = {
|
||||
ix.type.text,
|
||||
},
|
||||
adminOnly = true,
|
||||
OnRun = function(self, client, shop)
|
||||
local tr = client:GetEyeTrace()
|
||||
local terminal = tr.Entity
|
||||
|
||||
if !IsValid(terminal) or terminal:GetClass() != "ix_shopterminal" then
|
||||
return client:NotifyLocalized("You must look on a shop terminal!")
|
||||
end
|
||||
|
||||
local successCheck = terminal:SetShop(shop)
|
||||
if successCheck then
|
||||
client:NotifyLocalized(successCheck)
|
||||
else
|
||||
client:NotifyLocalized("Success!")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
ix.command.Add("SetShopTerminalSC", {
|
||||
description = "Manage shop terminal's social credits requirement.",
|
||||
arguments = {
|
||||
ix.type.number,
|
||||
},
|
||||
adminOnly = true,
|
||||
OnRun = function(self, client, sc)
|
||||
local tr = client:GetEyeTrace()
|
||||
local terminal = tr.Entity
|
||||
|
||||
if !IsValid(terminal) or terminal:GetClass() != "ix_shopterminal" then
|
||||
return client:NotifyLocalized("You must look on a shop terminal!")
|
||||
end
|
||||
|
||||
local successCheck = terminal:SetShopSocialCreditReq(sc)
|
||||
if successCheck then
|
||||
client:NotifyLocalized(successCheck)
|
||||
else
|
||||
client:NotifyLocalized("Success!")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
ix.command.Add("SetShopTerminalCost", {
|
||||
description = "Manage shop terminal's first pay cost.",
|
||||
arguments = {
|
||||
ix.type.number,
|
||||
},
|
||||
adminOnly = true,
|
||||
OnRun = function(self, client, cost)
|
||||
local tr = client:GetEyeTrace()
|
||||
local terminal = tr.Entity
|
||||
|
||||
if !IsValid(terminal) or terminal:GetClass() != "ix_shopterminal" then
|
||||
return client:NotifyLocalized("You must look on a shop terminal!")
|
||||
end
|
||||
|
||||
local successCheck = terminal:SetShopCost(cost)
|
||||
if successCheck then
|
||||
client:NotifyLocalized(successCheck)
|
||||
else
|
||||
client:NotifyLocalized("Success!")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
ix.util.Include("sv_hooks.lua")
|
||||
ix.util.Include("sv_plugin.lua")
|
||||
ix.util.IncludeDir(PLUGIN.folder .. "/3d2d", true)
|
||||
ix.util.IncludeDir(PLUGIN.folder .. "/meta", true)
|
||||
ix.util.Include("sh_fabrication_list.lua")
|
||||
|
||||
ix.config.Add("broadcastSound", "ambience/3d-sounds/alarms/workshiftalarm.ogg", "The sound that should play when someone broadcasts via CWU terminal.", nil, {
|
||||
category = "City Fund"
|
||||
})
|
||||
31
gamemodes/darkrp/plugins/goi_factory/sv_hooks.lua
Normal file
31
gamemodes/darkrp/plugins/goi_factory/sv_hooks.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
function PLUGIN:CanPlayerTakeItem(client, item)
|
||||
if (!item.inUse) then return end
|
||||
client:Notify("You cannot take an item that is being used by a machine!")
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function PLUGIN:PostPlayerSay(client, chatType, message)
|
||||
if (chatType != "ic") then return end
|
||||
if (message == "" or message == " ") then return end
|
||||
|
||||
local terminal = client:GetEyeTraceNoCursor().Entity
|
||||
if (!terminal or client:EyePos():DistToSqr(terminal:GetPos()) > 10000) then return end
|
||||
|
||||
--if (!terminal:GetNetVar("authenticated")) then return end
|
||||
if (!terminal:GetNetVar("broadcasting")) then return end
|
||||
|
||||
--ix.chat.Send(nil, "broadcast", message, false, nil, {speakerName = "Broadcast System"})
|
||||
ix.chat.Send(client, "broadcast", message, false, nil, {speakerName = "Broadcast System"})
|
||||
end
|
||||
68
gamemodes/darkrp/plugins/goi_factory/sv_plugin.lua
Normal file
68
gamemodes/darkrp/plugins/goi_factory/sv_plugin.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
util.AddNetworkString("ixBatteryChargerUse")
|
||||
|
||||
function PLUGIN:EntityRemoved(ent)
|
||||
if (ent:GetClass() == "ix_item") then
|
||||
if (ent:GetItemID() == "id_card" and ent.attached and IsValid(ent.attached)) then
|
||||
ent.attached:OnCIDDetach()
|
||||
ent.attached:SetCID(-1)
|
||||
elseif (ent:GetItemID() == "datadisc" and ent.attached and IsValid(ent.attached)) then
|
||||
ent.attached:OnDiscDetach()
|
||||
elseif (ent:GetItemID() == "cwu_card" and ent.attached and IsValid(ent.attached)) then
|
||||
ent.attached:OnCWUCardDetach()
|
||||
ent.attached:SetCWUCard(-1)
|
||||
end
|
||||
if ent.dispenser and IsValid(ent.dispenser) then
|
||||
ent.dispenser.dispensedObject = nil
|
||||
ent.dispenser:OnDispensedItemTaken()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ix.saveEnts:RegisterEntity("ix_shopterminal", true, true, true, {
|
||||
OnSave = function(entity, data) --OnSave
|
||||
data.shop = entity:GetShop()
|
||||
data.cost = entity:GetShopCost()
|
||||
data.scReq = entity:GetShopSocialCreditReq()
|
||||
end,
|
||||
OnRestore = function(entity, data) --OnRestore
|
||||
timer.Simple( 60, function() -- For some reason, I think when the entity initializes it resets these values. So I did this timer in my branch to fix it - it's not a permanent solution but it works for now.
|
||||
entity:SetShop(data.shop)
|
||||
entity:SetShopCost(data.cost)
|
||||
entity:SetShopSocialCreditReq(data.scReq)
|
||||
end )
|
||||
end,
|
||||
})
|
||||
|
||||
ix.saveEnts:RegisterEntity("ix_cwuterminal", true, true, true, {
|
||||
OnSave = function(entity, data) --OnSave
|
||||
return {pos = data.pos, angles = data.angles, motion = false}
|
||||
end,
|
||||
})
|
||||
|
||||
ix.saveEnts:RegisterEntity("ix_discscanner", true, true, true, {
|
||||
OnSave = function(entity, data) --OnSave
|
||||
return {pos = data.pos, angles = data.angles, motion = false}
|
||||
end,
|
||||
})
|
||||
|
||||
ix.saveEnts:RegisterEntity("ix_fabricator", true, true, true, {
|
||||
OnSave = function(entity, data) --OnSave
|
||||
return {pos = data.pos, angles = data.angles, motion = false}
|
||||
end,
|
||||
})
|
||||
|
||||
ix.saveEnts:RegisterEntity("ix_batterycharger", true, true, true, {
|
||||
OnSave = function(entity, data) --OnSave
|
||||
return {pos = data.pos, angles = data.angles, motion = false}
|
||||
end,
|
||||
})
|
||||
Reference in New Issue
Block a user