Skip to content
Snippets Groups Projects

Expose map thumbnail and minimap to lua

Open Lighto97 requested to merge Lighto97/RingRacers:map-thumbnail-and-minimap into master
1 unresolved thread
1 file
+ 18
0
Compare changes
  • Side-by-side
  • Inline
+ 18
0
@@ -2572,6 +2572,24 @@ static int mapheaderinfo_get(lua_State *L)
lua_pushfixed(L, header->mobj_scale);
else if (fastcmp(field, "gravity"))
lua_pushfixed(L, header->gravity);
else if (fastcmp(field, "thumbnail"))
{
patch_t *tnpatch = header->thumbnailPic;
if (!tnpatch)
tnpatch = W_CachePatchName("BLANKLVL", PU_PATCH);
LUA_PushUserdata(L, tnpatch, META_PATCH);
}
else if (fastcmp(field, "minimap"))
{
patch_t *mmpatch = header->minimapPic;
if (!mmpatch)
mmpatch = W_CachePatchName("BLANKLVL", PU_PATCH);
LUA_PushUserdata(L, mmpatch, META_PATCH);
}
else {
// Read custom vars now
// (note: don't include the "LUA." in your lua scripts!)
Loading