summaryrefslogtreecommitdiff
path: root/data/artery/global/sh_shipyard.txt
diff options
context:
space:
mode:
authorApickx <apickx@cogarr.com>2025-02-12 16:41:17 -0600
committerApickx <apickx@cogarr.com>2025-02-12 16:41:17 -0600
commit94cc3813c462df5f7bfd875d5a817b0da42006e6 (patch)
treede80af0fe1300e822c6b553d15dbf2136f31f1b9 /data/artery/global/sh_shipyard.txt
parentd22897e044a422e125f46e52c3467473a3656378 (diff)
downloadartery_stranded-94cc3813c462df5f7bfd875d5a817b0da42006e6.tar.gz
artery_stranded-94cc3813c462df5f7bfd875d5a817b0da42006e6.tar.bz2
artery_stranded-94cc3813c462df5f7bfd875d5a817b0da42006e6.zip
Final commitHEADmaster
Diffstat (limited to 'data/artery/global/sh_shipyard.txt')
-rw-r--r--data/artery/global/sh_shipyard.txt126
1 files changed, 63 insertions, 63 deletions
diff --git a/data/artery/global/sh_shipyard.txt b/data/artery/global/sh_shipyard.txt
index b29c63c..b2f9395 100644
--- a/data/artery/global/sh_shipyard.txt
+++ b/data/artery/global/sh_shipyard.txt
@@ -1,63 +1,63 @@
---[[
- A hunting ground zone will occasionally spawn a monster near a player that will go attack the player
-]]
-zones.RegisterClass("artery_shipyard",Color(238,238,255))
-
---Use this to set default properties. Only called on server.
-hook.Add("OnZoneCreated","artery_outpost",function(zone,class,zoneID)
- if class == "artery_shipyard" then
- zone.datatbl = {}
- zone.datatbl.control = ents.Create("art_shipyardcontrol")
- zone.datatbl.control:SetPos(Entity(1):GetPos())
- zone.datatbl.control:Spawn()
- zone.datatbl.control.Zone = zoneID
- end
-end)
-
--- Use this hook to let a player change a zone after making it or with the edit tool.
--- class is zone.class, zone is the zone's full table, DPanel is a panel to parent your things to, zoneID is the zone's ID, DFrame is the whole frame.
--- Return your preferred width and height for the panel and the frame will size to it.
-hook.Add("ShowZoneOptions","artery_shipyard",function(zone,class,DPanel,zoneID,DFrame)
- if class == "artery_shipyard" then
- local w,h = 500, 400
-
- local scroll = vgui.Create( "DScrollPanel",DPanel)
- scroll:Dock(FILL)
-
- function synctbl()
- net.Start("artery_shipyard_settbl")
- net.WriteFloat(zoneID)
- net.WriteTable(zone.datatbl)
- net.SendToServer()
- end
-
- print("Displaying table, my table is")
- PrintTable(zone.datatbl)
-
- local shipinstr = vgui.Create("DLabel",DPanel)
- shipinstr:Dock(TOP)
- shipinstr:SetText("Find the control entity, and palce it somewhere reasonable.")
- shipinstr:SetDark(true)
- shipinstr:SizeToContents()
-
- return w, h -- Specify the width and height for the DPanel container. The frame will resize accordingly.
-
- end
-end)
-
-if SERVER then
- util.AddNetworkString("artery_shipyard_settbl")
- net.Receive("artery_shipyard_settbl",function(len,ply)
- print("Server change received!")
- local id, new = net.ReadFloat(), net.ReadTable()
- print("New table is:")
- PrintTable(new)
- if not ply:IsAdmin() then return end
- local zone = zones.List[id]
- zone.datatbl = new
- if new.Name then
- zone.Name = new.Name
- end
- zones.Sync()
- end)
-end
+--[[
+ A hunting ground zone will occasionally spawn a monster near a player that will go attack the player
+]]
+zones.RegisterClass("artery_shipyard",Color(238,238,255))
+
+--Use this to set default properties. Only called on server.
+hook.Add("OnZoneCreated","artery_outpost",function(zone,class,zoneID)
+ if class == "artery_shipyard" then
+ zone.datatbl = {}
+ zone.datatbl.control = ents.Create("art_shipyardcontrol")
+ zone.datatbl.control:SetPos(Entity(1):GetPos())
+ zone.datatbl.control:Spawn()
+ zone.datatbl.control.Zone = zoneID
+ end
+end)
+
+-- Use this hook to let a player change a zone after making it or with the edit tool.
+-- class is zone.class, zone is the zone's full table, DPanel is a panel to parent your things to, zoneID is the zone's ID, DFrame is the whole frame.
+-- Return your preferred width and height for the panel and the frame will size to it.
+hook.Add("ShowZoneOptions","artery_shipyard",function(zone,class,DPanel,zoneID,DFrame)
+ if class == "artery_shipyard" then
+ local w,h = 500, 400
+
+ local scroll = vgui.Create( "DScrollPanel",DPanel)
+ scroll:Dock(FILL)
+
+ function synctbl()
+ net.Start("artery_shipyard_settbl")
+ net.WriteFloat(zoneID)
+ net.WriteTable(zone.datatbl)
+ net.SendToServer()
+ end
+
+ print("Displaying table, my table is")
+ PrintTable(zone.datatbl)
+
+ local shipinstr = vgui.Create("DLabel",DPanel)
+ shipinstr:Dock(TOP)
+ shipinstr:SetText("Find the control entity, and palce it somewhere reasonable.")
+ shipinstr:SetDark(true)
+ shipinstr:SizeToContents()
+
+ return w, h -- Specify the width and height for the DPanel container. The frame will resize accordingly.
+
+ end
+end)
+
+if SERVER then
+ util.AddNetworkString("artery_shipyard_settbl")
+ net.Receive("artery_shipyard_settbl",function(len,ply)
+ print("Server change received!")
+ local id, new = net.ReadFloat(), net.ReadTable()
+ print("New table is:")
+ PrintTable(new)
+ if not ply:IsAdmin() then return end
+ local zone = zones.List[id]
+ zone.datatbl = new
+ if new.Name then
+ zone.Name = new.Name
+ end
+ zones.Sync()
+ end)
+end