From 65db88d24e65972b34da824743ba7dc6d307def0 Mon Sep 17 00:00:00 2001 From: kilbith Date: Mon, 18 Apr 2016 18:20:04 +0200 Subject: Mainmenu: Unify favorite servers with main serverlist --- builtin/mainmenu/common.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'builtin/mainmenu/common.lua') diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index 62ab2b578..203b1382b 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -85,7 +85,7 @@ function order_favorite_list(list) end -------------------------------------------------------------------------------- -function render_favorite(spec,render_details) +function render_favorite(spec, is_favorite) local text = "" if spec.name ~= nil then @@ -105,13 +105,15 @@ function render_favorite(spec,render_details) end end - if not render_details then - return text - end - local details = "" local grey_out = not is_server_protocol_compat(spec.proto_min, spec.proto_max) + if is_favorite then + details = "1," + else + details = "0," + end + if spec.clients ~= nil and spec.clients_max ~= nil then local clients_color = '' local clients_percent = 100 * spec.clients / spec.clients_max @@ -253,15 +255,13 @@ function asyncOnlineFavourites() end, nil, function(result) - if core.setting_getbool("public_serverlist") then - local favs = order_favorite_list(result) - if favs[1] then - menudata.public_known = favs - menudata.favorites = menudata.public_known - menudata.favorites_is_public = true - end - core.event_handler("Refresh") + local favs = order_favorite_list(result) + if favs[1] then + menudata.public_known = favs + menudata.favorites = menudata.public_known + menudata.favorites_is_public = true end + core.event_handler("Refresh") end ) end -- cgit v1.2.3