forked from HaodongMo/ArcCW
spawnmenu icon
This commit is contained in:
parent
b5db9a539a
commit
b555464d49
@ -764,4 +764,25 @@ hook.Add("PopulateToolMenu", "ArcCW_Options", function()
|
||||
for menu, data in pairs(ArcCW.ClientMenus) do
|
||||
spawnmenu.AddToolMenuOption("Options", "ArcCW", menu, data.text, "", "", data.func)
|
||||
end
|
||||
end)
|
||||
|
||||
-- As of 2023-11-12, this feature is only available on dev branch.
|
||||
-- Won't break anything on release branch though.
|
||||
list.Set("ContentCategoryIcons", "ArcCW - Ammo", "arccw/icon_16.png")
|
||||
list.Set("ContentCategoryIcons", "ArcCW - Attachments", "arccw/icon_16.png")
|
||||
|
||||
-- Give all categories with ArcCW weapons our icon unless one is already set
|
||||
local first_populate = true
|
||||
hook.Add("PopulateWeapons", "ArcCW_ContentCategoryIcons", function()
|
||||
if !first_populate then return end
|
||||
for i, wep in pairs(weapons.GetList()) do
|
||||
local weap = weapons.Get(wep.ClassName)
|
||||
if weap and weap.ArcCW then
|
||||
local cat = weap.Category
|
||||
if cat and !list.HasEntry("ContentCategoryIcons", cat) then
|
||||
list.Set("ContentCategoryIcons", cat, "arccw/icon_16.png")
|
||||
end
|
||||
end
|
||||
end
|
||||
first_populate = false
|
||||
end)
|
@ -44,6 +44,10 @@ function ArcCW.LoadAttachmentType(att, name)
|
||||
[att.ShortName] = 1
|
||||
}
|
||||
|
||||
if att.EntityCategory and !list.HasEntry("ContentCategoryIcons", att.EntityCategory) then
|
||||
list.Set("ContentCategoryIcons", att.EntityCategory, "arccw/icon_16.png")
|
||||
end
|
||||
|
||||
scripted_ents.Register( attent, "acwatt_" .. name )
|
||||
end
|
||||
|
||||
|
BIN
materials/arccw/icon_16.png
Normal file
BIN
materials/arccw/icon_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Loading…
Reference in New Issue
Block a user