summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/loaditems.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/loaditems.lua')
-rw-r--r--gamemode/itemsystem/loaditems.lua15
1 files changed, 13 insertions, 2 deletions
diff --git a/gamemode/itemsystem/loaditems.lua b/gamemode/itemsystem/loaditems.lua
index 225e56d..8afd9b9 100644
--- a/gamemode/itemsystem/loaditems.lua
+++ b/gamemode/itemsystem/loaditems.lua
@@ -1,16 +1,27 @@
//Loads Loads all the items in the gamemode, these should go into gamemode/itemsystem/itmes folder.
//Also adds a console command gms_printrestable, that prints all the (base) resource tables and their values.
//Keep in mind that if an item has UniqueData set to true, it's instance may be different than that shown in gms_printrestable
+--[[
+Provides:
+ GMS.Resources
+ A table of resources, keyed by name. You probably shouldn't modify this directly.
+ GMS.RegisterResource(table_resource)
+ Adds the table to GMS.Resources, keep in mind that items are indexed by name, so 2 items may not share the same name. The table must also have a .Name field.
+ GMS.GetResourceByName(string_name)
+ Returns the resource table associated with the name.
+ gms_printrestable
+ A console command that prints out the entire resource table, useful for developers!
+]]
GMS.Resources = {}
function GMS.RegisterResource( tbl )
assert(tbl != nil,"Attempted to register a nil entity! This might be a bug!")
assert(tbl.Name != nil,"Attempted to register an item with no name:")
- if(tbl.UniqueData) then
+ if (tbl.UniqueData) then
tbl.UniqueDataID = -1
end
- GMS.Resources[tbl.Name] = tbl
+ GMS.Resources[tbl.Name] = tbl
end
function GMS.GetResourceByName(name)