From a11cda64757fb7be75cbe4fbf6598085f9e9ed8f Mon Sep 17 00:00:00 2001 From: Dirk Sohler Date: Sat, 15 May 2021 17:29:58 +0200 Subject: [PATCH] adapt timer format to new style --- system/formspecs/formspec_creation.lua | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/system/formspecs/formspec_creation.lua b/system/formspecs/formspec_creation.lua index 1e86b0b..b07c100 100644 --- a/system/formspecs/formspec_creation.lua +++ b/system/formspecs/formspec_creation.lua @@ -221,25 +221,24 @@ end mtimer.dialog.timer_format = function (player_name) - local timer_data = mtimer.get_timer_data(player_name) + local td = mtimer.get_timer_data(player_name) mtimer.show_formspec('mtimer:timer_format', { title = S('Timer Format'), show_to = player_name, height = 6, - width = 8.5, + width = 11, formspec = { - 'textarea[0,0;6,2.5;format;;'..esc(timer_data.format)..']', - 'container[0,2.9]', - 'label[2.5,0;'..S('Variable')..']', - 'label[4,0;'..S('Current Value')..']', - 'box[0,0.25;+contentWidth,0.02;#ffffff]', - 'label[0,0.5;'..S('Real-World Date')..'] label[2.5,0.5;{rd}] label[4,0.5;'..esc(timer_data.real_world_date)..']', - 'label[0,0.9;'..S('In-Game Time')..'] label[2.5,0.9;{it}] label[4,0.9;'..esc(timer_data.ingame_time)..']', - 'label[0,1.3;'..S('Session Start Time')..'] label[2.5,1.3;{st}] label[4,1.3;'..esc(timer_data.session_start_time)..']', - 'label[0,1.7;'..S('Session Duration')..'] label[2.5,1.7;{sd}] label[4,1.7;'..esc(timer_data.session_duration)..']', - 'label[0,2.1;'..S('Host Time')..'] label[2.5,2.1;{ht}] label[4,2.1;'..esc(timer_data.host_time)..']', - 'label[0,2.5;'..S('Custom Timer')..'] label[2.5,2.5;{ct}] label[4,2.5;'..esc(S('As configured'))..']', + 'textarea[0,0;6,2.5;format;;'..esc(td.format)..']', + 'container[0,3.4]', + line(0, '', S('Variable'), S('Current Value')), + line(1, '-'), + line(2, S('Real-World Date'), '{rd}', esc(td.real_world_date)), + line(3, S('In-Game Time'), '{it}', esc(td.ingame_time)), + line(4, S('Session Start Time'),'{st}', esc(td.session_start_time)), + line(5, S('Session Duration'), '{sd}', esc(td.session_duration)), + line(6, S('Host Time'), '{ht}', esc(td.host_time)), + line(7, S('Custom Timer'), '{ct}', esc(td.custom_timer)), 'container_end[]', 'container[6.25,0]', mtimer.get_icon_button('apply', { label = S('Apply') }),