Mainmenu: improve the Multiplayer tab
This commit is contained in:
parent
9b08c73f70
commit
d7e19ba0d8
@ -59,16 +59,17 @@ end
|
||||
--------------------------------------------------------------------------------
|
||||
function order_favorite_list(list)
|
||||
local res = {}
|
||||
--orders the favorite list after support
|
||||
-- orders the multicraft list before support
|
||||
for i = 1, #list do
|
||||
local fav = list[i]
|
||||
if is_server_protocol_compat(fav.proto_min, fav.proto_max) then
|
||||
if fav.server_id ~= nil then
|
||||
res[#res + 1] = fav
|
||||
end
|
||||
end
|
||||
for i = 1, #list do
|
||||
local fav = list[i]
|
||||
if not is_server_protocol_compat(fav.proto_min, fav.proto_max) then
|
||||
if is_server_protocol_compat(fav.proto_min, fav.proto_max) and
|
||||
fav.server_id == nil then
|
||||
res[#res + 1] = fav
|
||||
end
|
||||
end
|
||||
@ -122,7 +123,7 @@ function render_serverlist_row(spec, is_favorite, is_approved)
|
||||
-- (relatively to clients_max)
|
||||
local clients_color
|
||||
if grey_out then clients_color = '#aaaaaa'
|
||||
elseif spec.clients == 0 then clients_color = '' -- 0 players: default/white
|
||||
elseif spec.clients == 0 then clients_color = '' -- 0 players: default/white
|
||||
elseif clients_percent <= 60 then clients_color = '#a1e587' -- 0-60%: green
|
||||
elseif clients_percent <= 90 then clients_color = '#ffdc97' -- 60-90%: yellow
|
||||
elseif clients_percent == 100 then clients_color = '#dd5b5b' -- full server: red (darker)
|
||||
@ -139,16 +140,12 @@ function render_serverlist_row(spec, is_favorite, is_approved)
|
||||
details = details .. ',?,/,?,'
|
||||
end
|
||||
|
||||
if spec.damage then
|
||||
details = details .. "4,"
|
||||
else
|
||||
if spec.creative then
|
||||
details = details .. "5,"
|
||||
end
|
||||
|
||||
if spec.pvp then
|
||||
elseif spec.pvp then
|
||||
details = details .. "6,"
|
||||
else
|
||||
details = details .. "0,"
|
||||
else -- damage
|
||||
details = details .. "4,"
|
||||
end
|
||||
|
||||
return details .. (grey_out and '#aaaaaa,' or ',') .. text
|
||||
|
@ -47,7 +47,7 @@ local function get_formspec(_, _, tabdata)
|
||||
"label[10.15,-0.3;" .. fgettext("Port") .. ":" .. "]" ..
|
||||
"field[7.4,0.6;3.2,0.5;te_address;;" ..
|
||||
core.formspec_escape(core.settings:get("address")) .. "]" ..
|
||||
"field[10.45,0.6;1.9,0.5;te_port;;" ..
|
||||
"field[10.45,0.6;1.95,0.5;te_port;;" ..
|
||||
core.formspec_escape(core.settings:get("remote_port")) .. "]" ..
|
||||
|
||||
-- Name
|
||||
@ -67,7 +67,7 @@ local function get_formspec(_, _, tabdata)
|
||||
|
||||
local pwd = password_save and core.formspec_escape(core.settings:get("password")) or password_tmp
|
||||
-- Password
|
||||
retval = retval .. "pwdfield[10.45,1.81;1.91,0.39;te_pwd;;" .. pwd .. "]"
|
||||
retval = retval .. "pwdfield[10.45,1.8;1.95,0.39;te_pwd;;" .. pwd .. "]"
|
||||
|
||||
if tabdata.fav_selected and fav_selected then
|
||||
if gamedata.fav then
|
||||
@ -84,17 +84,16 @@ local function get_formspec(_, _, tabdata)
|
||||
retval = retval ..
|
||||
"tableoptions[background=#27233F;border=false]" ..
|
||||
"tablecolumns[" ..
|
||||
image_column(fgettext("Favorite"), "favorite") .. ",align=center;" ..
|
||||
image_column(fgettext("Lag, ms")) .. ",padding=0.25;" ..
|
||||
image_column(fgettext("Favorite")) .. ",align=center;" ..
|
||||
image_column(fgettext("Lag")) .. ",padding=0.25;" ..
|
||||
"color,span=3;" ..
|
||||
"text,align=right;" .. -- clients
|
||||
"text,align=center,padding=0.25;" .. -- "/"
|
||||
"text,align=right,padding=0.25;" .. -- clients_max
|
||||
image_column(fgettext("Server mode"), "damage") .. ",padding=0.25;" ..
|
||||
image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" ..
|
||||
"text,align=right;" .. -- clients
|
||||
"text,align=center,padding=0.25;" .. -- "/"
|
||||
"text,align=right,padding=0.25;" .. -- clients_max
|
||||
image_column(fgettext("Server mode")) .. ",padding=0.5;" ..
|
||||
"color,span=1;" ..
|
||||
"text,padding=0.25]" ..
|
||||
"table[-0.09,0.7;7,4.9;favourites;"
|
||||
"text,padding=0.5]" ..
|
||||
"table[-0.09,0.7;6.99,4.93;favourites;"
|
||||
|
||||
if menudata.search_result then
|
||||
for i = 1, #menudata.search_result do
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 176 B After Width: | Height: | Size: 262 B |
Loading…
x
Reference in New Issue
Block a user