Added hooks to the room system

This commit is contained in:
Kayne Ruse
2015-02-17 23:37:11 +11:00
parent a538cf73d5
commit a106134dd1
4 changed files with 105 additions and 1 deletions
+8
View File
@@ -11,6 +11,14 @@ local function dumpTable(t)
end
end
--test the room hooks
roomSystem.RoomManager.SetOnCreate(function(room, index)
print("", "Creating room: ", roomSystem.Room.GetName(room), index)
end)
roomSystem.RoomManager.SetOnUnload(function(room, index)
print("", "Unloading room: ", roomSystem.Room.GetName(room), index)
end)
--NOTE: room 0 is the first that the client asks for, therefore it must exist
local overworld, uid = roomSystem.RoomManager.CreateRoom("overworld", "overworld.bmp")
roomSystem.Room.Initialize(overworld, mapSaver.Load, mapSaver.Save, mapMaker.DebugIsland, mapSaver.Save)