-
Notifications
You must be signed in to change notification settings - Fork 11
Custom Callbacks
Taz edited this page Mar 2, 2020
·
2 revisions
There a few custom callbacks you can make use of in your mod.
MinimapAPI:AddDisplayFlagsCallback(mod, function)- Runs everytime the display flags of a room are needed
- The function takes: self (the mod table), room (minimap api roomdata) and display flags (the actual display flags)
- Return a number to override the display flags to that or return nil to do nothing. Returning a non-nil value will stop other callbacks from running.
-- This example forces all treasure rooms to be visible at all times.
MinimapAPI:AddDisplayFlagsCallback(myMod, function(self, room, dflags)
if room.Descriptor and room.Descriptor.Data.Type == RoomType.ROOM_TREASURE then
return dflags | 5
end
end)MinimapAPI:AddPlayerPositionCallback(mod, function)- A callback that runs everytime the player's position is modified by the API.
- The function takes: self (the mod table), room (minimap api roomdata) and player map grid position (Vector)
- Return a position to set the position to that or return nil to do nothing. Returning a non-nil value will stop other callbacks from running.