Stickers can be put on atts now

This commit is contained in:
Haodong Mo 2023-01-14 12:15:46 +10:00
parent f79f404506
commit 69896b7577
11 changed files with 40 additions and 1 deletions

View File

@ -207,6 +207,7 @@ ATT.Attachments = {
Pos = Vector(0, 0, 0),
Ang = Angle(0, 0, 0),
KeepBaseIrons = false,
StickerModel = "" -- applies to the current model if one exists
}
}

View File

@ -208,3 +208,32 @@ if CLIENT then
end
ARC9.LoadAttachment(ATT, "charm_gs_clock")
ATT = {}
ATT.PrintName = "Sticker Panel"
ATT.CompactName = "STICKER"
ATT.Icon = Material("entities/arc9_att_charm_gs_sticker.png", "mips smooth")
ATT.Free = true
ATT.Description = [[Allows a sticker to be applied to the screen.]]
ATT.MenuCategory = "ARC9 - Charms"
ATT.Model = "models/items/arc9/att_screenbase.mdl"
ATT.BoxModel = "models/items/arc9/att_cardboard_box.mdl"
ATT.Category = {"charm", "gunscreen"}
ATT.Attachments = {
{
PrintName = "STICKER",
StickerModel = "models/items/arc9/sticker_screenbase.mdl",
Category = "stickers",
Pos = Vector(0, 0, 0),
Ang = Angle(0, 0, 0),
Icon_Offset = Vector(-2, 0, 0)
}
}
ARC9.LoadAttachment(ATT, "charm_gs_sticker")

View File

@ -492,7 +492,15 @@ function SWEP:SetupModel(wm, lod, cm)
stickermodel.slottbl = slottbl
stickermodel:AddEffects(EF_BONEMERGE)
stickermodel:SetParent(basemodel)
local stickerparent = basemodel
if slottbl.ParentTable then
if wm then
stickerparent = slottbl.ParentTable.WModel or basemodel
else
stickerparent = slottbl.ParentTable.VModel or basemodel
end
end
stickermodel:SetParent(stickerparent)
stickermodel:SetMaterial(atttbl.StickerMaterial)

View File

@ -137,6 +137,7 @@ function SWEP:BuildSubAttachmentTree(tbl, parenttbl)
subatts[i].ToggleNum = tbl.SubAttachments[i].ToggleNum or 1
subatts[i].CorrectiveAng = parenttbl.CorrectiveAng
subatts[i].LaserCorrectionAngle = parenttbl.LaserCorrectionAngle
subatts[i].ParentTable = parenttbl
if parenttbl.DuplicateModels then
subatts[i].DuplicateModels = table.Copy(parenttbl.DuplicateModels)

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.