diff options
author | kilbith <jeanpatrick.guerrero@gmail.com> | 2016-04-18 18:20:04 +0200 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2016-04-20 21:31:40 +1000 |
commit | 65db88d24e65972b34da824743ba7dc6d307def0 (patch) | |
tree | c6e56e0fcdd80a411e867e3daf936b6e18ab6f8d /builtin/mainmenu/common.lua | |
parent | fed5dd3b5d153bc38939298f37650062d11a7082 (diff) | |
download | hax-minetest-server-65db88d24e65972b34da824743ba7dc6d307def0.tar.gz hax-minetest-server-65db88d24e65972b34da824743ba7dc6d307def0.zip |
Mainmenu: Unify favorite servers with main serverlist
Diffstat (limited to '')
-rw-r--r-- | builtin/mainmenu/common.lua | 26 |
1 files changed, 13 insertions, 13 deletions
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 |