aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_object.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index 6d4ce54fc..6c6415a09 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -38,6 +38,7 @@ struct EnumString es_HudElementType[] =
{HUD_ELEM_TEXT, "text"},
{HUD_ELEM_STATBAR, "statbar"},
{HUD_ELEM_INVENTORY, "inventory"},
+ {HUD_ELEM_WAYPOINT, "waypoint"},
{0, NULL},
};
@@ -53,6 +54,7 @@ struct EnumString es_HudElementStat[] =
{HUD_STAT_DIR, "direction"},
{HUD_STAT_ALIGN, "alignment"},
{HUD_STAT_OFFSET, "offset"},
+ {HUD_STAT_WORLD_POS, "world_pos"},
{0, NULL},
};
@@ -862,6 +864,10 @@ int ObjectRef::l_hud_add(lua_State *L)
elem->offset = lua_istable(L, -1) ? read_v2f(L, -1) : v2f();
lua_pop(L, 1);
+ lua_getfield(L, 2, "world_pos");
+ elem->world_pos = lua_istable(L, -1) ? read_v3f(L, -1) : v3f();
+ lua_pop(L, 1);
+
u32 id = getServer(L)->hudAdd(player, elem);
if (id == (u32)-1) {
delete elem;
@@ -953,6 +959,10 @@ int ObjectRef::l_hud_change(lua_State *L)
e->offset = read_v2f(L, 4);
value = &e->offset;
break;
+ case HUD_STAT_WORLD_POS:
+ e->world_pos = read_v3f(L, 4);
+ value = &e->world_pos;
+ break;
}
getServer(L)->hudChange(player, id, stat, value);
@@ -1003,6 +1013,9 @@ int ObjectRef::l_hud_get(lua_State *L)
lua_pushnumber(L, e->dir);
lua_setfield(L, -2, "dir");
+ push_v3f(L, e->world_pos);
+ lua_setfield(L, -2, "world_pos");
+
return 1;
}
-13 * Add eased 3d point-value noise functionskwolekr2014-11-12 * Add mgv5. New noise code, uses biome API. Eased 3d noise for terrain, caves, ...paramat2014-11-08 * Change license of noise implementation to Simplified BSDkwolekr2014-10-27 * Add support for eased 3d noisekwolekr2014-10-27 * Add minetest.set_noiseparam_defaults() Lua APIkwolekr2014-02-15 * Huge overhaul of the entire MapgenParams systemkwolekr2014-02-03 * Remove no virtual dtor warnings, make MapgenParams contain actual NoiseParamskwolekr2013-05-19 * Add Mapgen V7, reorganize biomeskwolekr2013-04-07 * initial mapgen indev version with farscale feature and huge cavesproller2013-03-16 * Re-add dungeons in new dungeongen.cppkwolekr2013-03-10 * Update Copyright YearsSfan52013-02-24 * Change Minetest-c55 to MinetestPilzAdam2013-02-24 * Fix MapgenV6::getGroundLevelAtPoint()kwolekr2013-01-21 * Finish and clean up mapgen configurationkwolekr2013-01-21 * Cleaned & enhanced noise object managementkwolekr2013-01-21 * Add initial Lua biomedef support, fixed biome selectionkwolekr2013-01-21 * The new mapgen, noise functions, et al.kwolekr2013-01-21 * Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05 * updated noise stuffPerttu Ahola2011-06-26 * mapgen stuffPerttu Ahola2011-06-25 * New map generator added (and SQLite, messed up the commits at that time...) (...Perttu Ahola2011-06-25 * tested out and commented out some new stuff for the terrain generator, to be ...Perttu Ahola2011-04-26 * A third try on terrain generation. No trees yet.Perttu Ahola2011-02-28 * 3d noise stuffPerttu Ahola2011-02-26 * mapgen tweakingPerttu Ahola2011-02-06 *