Display output bugfix
This commit is contained in:
parent
833bf95f9c
commit
063ee294e6
@ -35,10 +35,7 @@ local function generate_string(sortedList)
|
||||
default.gui_slots..
|
||||
"item_image[0,0;1,1;hyperloop:booking]"..
|
||||
"label[4,0; "..I("Select your destination").."]"}
|
||||
tRes[2] = "label[1,0.6;"..I("Destination").."]label[5,0.6;"..
|
||||
I("Distance").."]label[7,0.6;"..I("Local Info").."]"
|
||||
|
||||
tRes[3] = "tablecolumns[text,width=30;text,width=11,align=right;text]"
|
||||
tRes[2] = "tablecolumns[text,width=20;text,width=6,align=right;text]"
|
||||
|
||||
local stations = {}
|
||||
for idx,tDest in ipairs(sortedList) do
|
||||
@ -52,12 +49,12 @@ local function generate_string(sortedList)
|
||||
end
|
||||
|
||||
if #stations>0 then
|
||||
tRes[#tRes+1] = "table[0,1;11.5,7;button;"..table.concat(stations, ",").."]"
|
||||
tRes[#tRes+1] = "table[0,1;11.8,7.2;button;"..table.concat(stations, ",").."]"
|
||||
else
|
||||
tRes[#tRes+1] = "button_exit[4,4;3,1;button;Update]"
|
||||
end
|
||||
|
||||
return table.concat(tRes )
|
||||
return table.concat(tRes)
|
||||
end
|
||||
|
||||
local function store_station_list(pos, sortedList)
|
||||
|
3
seat.lua
3
seat.lua
@ -101,6 +101,7 @@ end
|
||||
|
||||
local function display_timer(pos, elapsed)
|
||||
-- update display with trip data
|
||||
print("display_timer")
|
||||
local tStation = hyperloop.get_base_station(pos)
|
||||
if tStation then
|
||||
local meta = M(pos)
|
||||
@ -130,6 +131,7 @@ end
|
||||
-- place the player, close the door, activate display
|
||||
local function on_start_travel(pos, node, clicker)
|
||||
-- arrival data
|
||||
local meta = M(pos)
|
||||
local tDeparture, departure_pos = hyperloop.get_base_station(pos)
|
||||
local arrival_pos = hyperloop.get_arrival(departure_pos)
|
||||
if arrival_pos == nil then
|
||||
@ -173,7 +175,6 @@ local function on_start_travel(pos, node, clicker)
|
||||
hyperloop.block(departure_pos, arrival_pos, atime+10)
|
||||
|
||||
-- store some data for on_timer()
|
||||
local meta = M(pos)
|
||||
meta:set_int("arrival_time", atime)
|
||||
meta:set_string("lcd_text", text)
|
||||
minetest.get_node_timer(pos):start(1.0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user