- if gamedata ~= nil and gamedata.errormessage ~= nil then
- formspec = "size[12,3.2]" ..
- "textarea[1,1;10,2;;ERROR: " ..
- core.formspec_escape(gamedata.errormessage) ..
- ";]"..
- "button[4.5,2.5;3,0.5;btn_error_confirm;" .. fgettext("Ok") .. "]"
+ if gamedata ~= nil and gamedata.reconnect_requested then
+ formspec = wordwrap_quickhack(gamedata.errormessage or "")
+ formspec = "size[12,5]" ..
+ "label[0.5,0;" .. fgettext("The server has requested a reconnect:") ..
+ "]textlist[0.2,0.8;11.5,3.5;;" .. formspec ..
+ "]button[6,4.6;3,0.5;btn_reconnect_no;" .. fgettext("Main menu") .. "]" ..
+ "button[3,4.6;3,0.5;btn_reconnect_yes;" .. fgettext("Reconnect") .. "]"
+ elseif gamedata ~= nil and gamedata.errormessage ~= nil then
+ formspec = wordwrap_quickhack(gamedata.errormessage)
+ local error_title
+ if string.find(gamedata.errormessage, "ModError") then
+ error_title = fgettext("An error occured in a Lua script, such as a mod:")
+ else
+ error_title = fgettext("An error occured:")
+ end
+ formspec = "size[12,5]" ..
+ "label[0.5,0;" .. error_title ..
+ "]textlist[0.2,0.8;11.5,3.5;;" .. formspec ..
+ "]button[4.5,4.6;3,0.5;btn_error_confirm;" .. fgettext("Ok") .. "]"