Small cleaning
This commit is contained in:
parent
edf0867e6c
commit
748cc9a7a1
13
src/gui.lua
13
src/gui.lua
|
@ -234,14 +234,14 @@ local function get_isometric_view(fs, pos, X, Y, t, cubes, depth, high)
|
|||
local width = 8
|
||||
local base_height = 4
|
||||
local base_depth = depth == -1
|
||||
local max_depth = -10
|
||||
local max_depth = -7
|
||||
local height = base_depth and (base_height - 1) or depth
|
||||
|
||||
local pos1 = vec_new(pos.x - width, pos.y + depth, pos.z - width)
|
||||
local pos2 = vec_new(pos.x + width, pos.y + height, pos.z + width)
|
||||
|
||||
local vm = VoxelManip(pos1, pos2)
|
||||
local emin, emax = vm:read_from_map(pos1, pos2)
|
||||
local emin, emax = vm:get_emerged_area()
|
||||
local area = VoxelArea:new{MinEdge = emin, MaxEdge = emax}
|
||||
local data = vm:get_data()
|
||||
|
||||
|
@ -276,8 +276,9 @@ local function get_isometric_view(fs, pos, X, Y, t, cubes, depth, high)
|
|||
if cubes < maxc and depth > max_depth then
|
||||
-- if there's not enough map to preview, go deeper
|
||||
depth -= 1
|
||||
get_isometric_view(fs, pos, X, Y, t, cubes, depth, high)
|
||||
else
|
||||
return get_isometric_view(fs, pos, X, Y, t, cubes, depth, high)
|
||||
end
|
||||
|
||||
local shift = -0.3 - high
|
||||
|
||||
for i = max_depth, 0 do
|
||||
|
@ -294,7 +295,6 @@ local function get_isometric_view(fs, pos, X, Y, t, cubes, depth, high)
|
|||
|
||||
shift += (base_depth and 0.45 or 0.95)
|
||||
fs("image", 2.7, Y + shift, 0.3, 0.3, PNG.flag)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_waypoint_fs(fs, data, player, yextra, ctn_len)
|
||||
|
@ -1093,8 +1093,7 @@ local function get_model_fs(fs, data, def, model_alias)
|
|||
hex = "0" .. hex
|
||||
end
|
||||
|
||||
_name = fmt("%s^[multiply:%s", v.name,
|
||||
fmt("#%s%s", sub(hex, 3), sub(hex, 1, 2)))
|
||||
_name = fmt("%s^[multiply:%s", v.name, fmt("#%s%s", sub(hex, 3), sub(hex, 1, 2)))
|
||||
else
|
||||
_name = fmt("%s^[multiply:%s", v.name, v.color)
|
||||
end
|
||||
|
|
Ŝarĝante…
Reference in New Issue