1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

Add compatible, consistent coordinate system to FormSpecs. (#8524)

This commit is contained in:
v-rob
2019-06-27 05:40:49 -07:00
committed by rubenwardy
parent 91d244c522
commit 5e7004e7af
3 changed files with 542 additions and 154 deletions

View File

@@ -99,12 +99,14 @@ class GUIFormSpecMenu : public GUIModalMenu
ListDrawSpec(const InventoryLocation &a_inventoryloc,
const std::string &a_listname,
v2s32 a_pos, v2s32 a_geom, s32 a_start_item_i):
v2s32 a_pos, v2s32 a_geom, s32 a_start_item_i,
bool a_real_coordinates):
inventoryloc(a_inventoryloc),
listname(a_listname),
pos(a_pos),
geom(a_geom),
start_item_i(a_start_item_i)
start_item_i(a_start_item_i),
real_coordinates(a_real_coordinates)
{
}
@@ -113,6 +115,7 @@ class GUIFormSpecMenu : public GUIModalMenu
v2s32 pos;
v2s32 geom;
s32 start_item_i;
bool real_coordinates;
};
struct ListRingSpec
@@ -394,6 +397,9 @@ protected:
std::string getNameByID(s32 id);
v2s32 getElementBasePos(bool absolute,
const std::vector<std::string> *v_pos);
v2s32 getRealCoordinateBasePos(bool absolute,
const std::vector<std::string> &v_pos);
v2s32 getRealCoordinateGeometry(const std::vector<std::string> &v_geom);
v2s32 padding;
v2f32 spacing;
@@ -463,6 +469,7 @@ private:
typedef struct {
bool explicit_size;
bool real_coordinates;
v2f invsize;
v2s32 size;
v2f32 offset;