diff --git a/fs_npc_list.lua b/fs_npc_list.lua index e8c0bdb..e99ec7d 100644 --- a/fs_npc_list.lua +++ b/fs_npc_list.lua @@ -49,7 +49,7 @@ yl_speak_up.update_npc_data = function(self, dialog, force_store) trades = old.trades end local created_at = 0 - if(is_known) then + if(is_known and yl_speak_up.npc_list[self.yl_speak_up.id].created_at) then created_at = yl_speak_up.npc_list[self.yl_speak_up.id].created_at else created_at = os.time() @@ -332,7 +332,10 @@ yl_speak_up.get_fs_show_npc_list = function(pname, selected_row) table.concat(prop_list, ',')..';;]' end end --- TODO is_generic + local first_seen_at = '- unknown -' + if(data.created_at and data.created_at ~= "") then + first_seen_at = minetest.formspec_escape(os.date("%m/%d/%y", data.created_at)) + end -- TODO edit, visit button info_current_row = 'container[0.1,11.2]'.. @@ -341,9 +344,9 @@ yl_speak_up.get_fs_show_npc_list = function(pname, selected_row) 'label[0.1,0.5;Typ:]'.. 'label[3.0,0.5;'.. minetest.formspec_escape(tostring(data.typ or '- ? -'))..']'.. - 'label[10.1,0.5;First seen at:]'.. - 'label[13.1,0.5;'.. - minetest.formspec_escape(tostring(data.created_at or '- ? -'))..']'.. + 'label[11.1,0.5;First seen at:]'.. + 'label[13.4,0.5;'.. + first_seen_at..']'.. 'label[0.1,1.0;Can be edited by:]'.. 'label[3.0,1.0;'.. minetest.formspec_escape(table.concat(edit_list, ', '))..']'..