forked from your-land-mirror/yl_speak_up
made changelog better readable when asking for save/back/discard
This commit is contained in:
parent
a780a70d97
commit
726a6cbcf2
@ -1972,13 +1972,7 @@ yl_speak_up.save_changes_and_switch_to_other_dialog = function(player, fields, t
|
|||||||
-- reverse the order of the changes in the log so that newest are topmost
|
-- reverse the order of the changes in the log so that newest are topmost
|
||||||
local text = ""
|
local text = ""
|
||||||
for i,t in ipairs(yl_speak_up.npc_was_changed[ n_id ]) do
|
for i,t in ipairs(yl_speak_up.npc_was_changed[ n_id ]) do
|
||||||
-- some entries may be more than one line long
|
text = minetest.formspec_escape(t).."\n"..text
|
||||||
local tmp = ""
|
|
||||||
local parts = string.split(t, "\n", false)
|
|
||||||
for i, part in ipairs(parts) do
|
|
||||||
tmp = tmp..minetest.formspec_escape(part)..","
|
|
||||||
end
|
|
||||||
text = tmp..text
|
|
||||||
end
|
end
|
||||||
-- build a formspec showing the changes to this dialog and ask for save
|
-- build a formspec showing the changes to this dialog and ask for save
|
||||||
local formspec =
|
local formspec =
|
||||||
@ -1989,7 +1983,8 @@ yl_speak_up.save_changes_and_switch_to_other_dialog = function(player, fields, t
|
|||||||
" and "..target_name..".]"..
|
" and "..target_name..".]"..
|
||||||
"label[0.2,0.65;These changes have been applied to dialog "..
|
"label[0.2,0.65;These changes have been applied to dialog "..
|
||||||
minetest.formspec_escape(d_id)..":]"..
|
minetest.formspec_escape(d_id)..":]"..
|
||||||
"textlist[0.2,1;13.5,4;list_of_changes;"..text.."]"..
|
"hypertext[0.2,1;13.5,4;list_of_changes;<normal>"..
|
||||||
|
minetest.formspec_escape(text) .. "\n</normal>".."]"..
|
||||||
"button[1.2,5.2;3,0.9;discard_dialog_changes;Discard changes]"..
|
"button[1.2,5.2;3,0.9;discard_dialog_changes;Discard changes]"..
|
||||||
"button[5.7,5.2;3,0.9;back_to_dialog_changes;Back]"..
|
"button[5.7,5.2;3,0.9;back_to_dialog_changes;Back]"..
|
||||||
"button[10.2,5.2;3,0.9;save_dialog_changes;Save changes]"..
|
"button[10.2,5.2;3,0.9;save_dialog_changes;Save changes]"..
|
||||||
|
Loading…
Reference in New Issue
Block a user