mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
renamed base to group (might break old stuff, if it does you'll have to rename it in the txt outfit files)
made it so the gizmo doesn't show up in group and player removed unused properties for group and player fixed material for player improved order of properties git-svn-id: http://gmodcapsadmin.googlecode.com/svn/trunk/addons/pac3@27 047d434e-d786-fb00-e516-99c5e643cd71
This commit is contained in:
parent
dc381f6337
commit
dd133b2f9c
@ -82,6 +82,7 @@ do -- meta
|
||||
local PART = {}
|
||||
|
||||
PART.ClassName = "base"
|
||||
PART.Internal = true
|
||||
|
||||
function PART:__tostring()
|
||||
return string.format("%s[%s][%i]", self.Type, self.ClassName, self.Id)
|
||||
|
16
lua/pac3/core/client/parts/group.lua
Normal file
16
lua/pac3/core/client/parts/group.lua
Normal file
@ -0,0 +1,16 @@
|
||||
local PART = {}
|
||||
|
||||
PART.ClassName = "group"
|
||||
PART.HideGizmo = true
|
||||
|
||||
function PART:Initialize()
|
||||
self.StorableVars = {}
|
||||
|
||||
pac.StartStorableVars()
|
||||
pac.GetSet(self, "Name", "")
|
||||
pac.GetSet(self, "Description", "")
|
||||
pac.GetSet(self, "Hide", false)
|
||||
pac.EndStorableVars()
|
||||
end
|
||||
|
||||
pac.RegisterPart(PART)
|
@ -1,19 +1,25 @@
|
||||
local PART = {}
|
||||
|
||||
PART.ClassName = "player"
|
||||
|
||||
pac.StartStorableVars()
|
||||
pac.GetSet(PART, "Material", "")
|
||||
pac.GetSet(PART, "Color", Vector(255, 255, 255))
|
||||
pac.GetSet(PART, "Alpha", 1)
|
||||
pac.GetSet(PART, "Scale", Vector(1,1,1))
|
||||
pac.GetSet(PART, "Size", 1)
|
||||
pac.GetSet(PART, "Model", "")
|
||||
pac.GetSet(PART, "DrawWeapon", true)
|
||||
pac.EndStorableVars()
|
||||
PART.ClassName = "player"
|
||||
PART.HideGizmo = true
|
||||
|
||||
function PART:Initialize()
|
||||
self.ClipPlanes = {}
|
||||
|
||||
self.StorableVars = {}
|
||||
|
||||
pac.StartStorableVars()
|
||||
pac.GetSet(self, "Name", "")
|
||||
pac.GetSet(self, "Description", "")
|
||||
pac.GetSet(self, "Hide", false)
|
||||
pac.GetSet(self, "Material", "")
|
||||
pac.GetSet(self, "Color", Vector(255, 255, 255))
|
||||
pac.GetSet(self, "Alpha", 1)
|
||||
pac.GetSet(self, "Scale", Vector(1,1,1))
|
||||
pac.GetSet(self, "Size", 1)
|
||||
pac.GetSet(self, "Model", "")
|
||||
pac.GetSet(self, "DrawWeapon", true)
|
||||
pac.EndStorableVars()
|
||||
end
|
||||
|
||||
function PART:AddClipPlane(part)
|
||||
@ -52,9 +58,10 @@ function PART:SetScale(var)
|
||||
self.Scale = var
|
||||
end
|
||||
|
||||
function PART:OnAttach()
|
||||
function PART:OnAttach(owner)
|
||||
self:SetSize(self:GetSize())
|
||||
self:SetScale(self:GetScale())
|
||||
owner:SetModel(self:GetModel())
|
||||
end
|
||||
|
||||
PART.Colorf = Vector(1,1,1)
|
||||
@ -65,6 +72,26 @@ function PART:SetColor(var)
|
||||
self.Color = var
|
||||
self.Colorf = Vector(var.r, var.g, var.b) / 255
|
||||
end
|
||||
|
||||
function PART:GetModel()
|
||||
local owner = self:GetOwner()
|
||||
|
||||
if owner:IsValid() and (not self.Model or self.Model == "") then
|
||||
return owner:GetModel()
|
||||
end
|
||||
|
||||
return self.Model
|
||||
end
|
||||
|
||||
function PART:SetModel(path)
|
||||
local owner = self:GetOwner()
|
||||
|
||||
if owner:IsValid() then
|
||||
owner:SetModel(path)
|
||||
end
|
||||
|
||||
self.Model = path
|
||||
end
|
||||
|
||||
function PART:PrePlayerDraw(owner, pos, ang)
|
||||
render.SetColorModulation(self.Colorf.r, self.Colorf.g, self.Colorf.b)
|
||||
@ -98,7 +125,7 @@ function PART:PrePlayerDraw(owner, pos, ang)
|
||||
|
||||
owner:SetMaterial("models/effects/vol_light001")
|
||||
else
|
||||
owner:SetMaterial(self.player_material)
|
||||
owner:SetMaterial(self.Material)
|
||||
end
|
||||
|
||||
if wep:IsWeapon() then
|
||||
@ -111,7 +138,7 @@ function PART:PrePlayerDraw(owner, pos, ang)
|
||||
wep.RenderOverride = function() end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PART:PostPlayerDraw(owner, pos, ang)
|
||||
|
@ -1,7 +1,6 @@
|
||||
if net then
|
||||
pace.PartIcons =
|
||||
{
|
||||
part = "icon16/status_online.png",
|
||||
text = "icon16/text_align_center.png",
|
||||
bone = "widgets/bone_small.png",
|
||||
clip = "icon16/cut.png",
|
||||
@ -12,14 +11,13 @@ if net then
|
||||
model = "icon16/shape_square.png",
|
||||
animation = "icon16/eye.png",
|
||||
player = "icon16/user.png",
|
||||
base = "icon16/world.png",
|
||||
group = "icon16/world.png",
|
||||
trail = "icon16/arrow_undo.png",
|
||||
sunbeams = "icon16/sun.png",
|
||||
}
|
||||
else
|
||||
pace.PartIcons =
|
||||
{
|
||||
part = "gui/silkicons/user",
|
||||
text = "gui/silkicons/page",
|
||||
bone = "gui/silkicons/anchor",
|
||||
light = "gui/silkicons/star",
|
||||
@ -30,15 +28,19 @@ pace.PropertyOrder =
|
||||
{
|
||||
"Name",
|
||||
"Description",
|
||||
"Hide",
|
||||
"ParentName",
|
||||
"WeaponClass",
|
||||
"HideWeaponClass",
|
||||
"Bone",
|
||||
"Position",
|
||||
"Angles",
|
||||
"AngleVelocity",
|
||||
"ModifyAngles",
|
||||
"Parent",
|
||||
"Size",
|
||||
"Scale",
|
||||
"Color",
|
||||
"Alpha",
|
||||
"Min",
|
||||
"Max",
|
||||
"Loop",
|
||||
|
@ -152,10 +152,12 @@ function pace.OnOpenMenu()
|
||||
end
|
||||
|
||||
local function add_parts(menu)
|
||||
for class_name in pairs(pac.GetRegisteredParts()) do
|
||||
menu:AddOption(class_name, function()
|
||||
pace.Call("CreatePart", class_name)
|
||||
end)--:SetImage(pace.PartIcons[class_name])
|
||||
for class_name, tbl in pairs(pac.GetRegisteredParts()) do
|
||||
if not tbl.Internal then
|
||||
menu:AddOption(class_name, function()
|
||||
pace.Call("CreatePart", class_name)
|
||||
end)--:SetImage(pace.PartIcons[class_name])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -21,7 +21,12 @@ do -- pace
|
||||
mctrl.target = pac.NULL
|
||||
|
||||
function mctrl.SetTarget(part)
|
||||
mctrl.target = part or pac.NULL
|
||||
part = part or pac.NULL
|
||||
if part:IsValid() and part.HideGizmo then
|
||||
mctrl.target = pac.NULL
|
||||
else
|
||||
mctrl.target = part
|
||||
end
|
||||
end
|
||||
|
||||
function mctrl.GetTarget()
|
||||
|
Loading…
Reference in New Issue
Block a user