diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-22 14:18:52 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-22 14:18:52 -0400 |
| commit | e014b7940d59c791c4a6e96ec27aa3232d3a39a1 (patch) | |
| tree | 515ff14cf73b236d2159ea2703502abce0f3781f /gamemode/itemsystem/loaditems.lua | |
| parent | eea3fcb40b4a52e5985859bf6bb77d3384d4d0f7 (diff) | |
| download | gmstranded-e014b7940d59c791c4a6e96ec27aa3232d3a39a1.tar.gz gmstranded-e014b7940d59c791c4a6e96ec27aa3232d3a39a1.tar.bz2 gmstranded-e014b7940d59c791c4a6e96ec27aa3232d3a39a1.zip | |
Cleaned up the comments in the itemsystem
Diffstat (limited to 'gamemode/itemsystem/loaditems.lua')
| -rw-r--r-- | gamemode/itemsystem/loaditems.lua | 15 |
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) |
