mirror of
https://github.com/minetest/minetest.git
synced 2025-01-03 11:57:30 +01:00
Add server url button to main menu (#15536)
Co-authored-by: Zughy <63455151+Zughy@users.noreply.github.com>
This commit is contained in:
parent
a6293b9861
commit
7bf0b1fc7e
@ -63,6 +63,7 @@ Zughy:
|
||||
textures/base/pack/settings_btn.png
|
||||
textures/base/pack/settings_info.png
|
||||
textures/base/pack/settings_reset.png
|
||||
textures/base/pack/server_url.png
|
||||
textures/base/pack/server_view_clients.png
|
||||
|
||||
appgurueu:
|
||||
|
@ -179,6 +179,13 @@ local function get_formspec(tabview, name, tabdata)
|
||||
"server_view_clients.png") .. ";btn_view_clients;]"
|
||||
end
|
||||
|
||||
if selected_server.url then
|
||||
retval = retval .. "tooltip[btn_server_url;" .. fgettext("Open server website") .. "]"
|
||||
retval = retval .. "style[btn_server_url;padding=6]"
|
||||
retval = retval .. "image_button[" .. (can_view_clients_list and "4" or "4.5") .. ",1.3;0.5,0.5;" ..
|
||||
core.formspec_escape(defaulttexturedir .. "server_url.png") .. ";btn_server_url;]"
|
||||
end
|
||||
|
||||
if is_selected_fav() then
|
||||
retval = retval .. "tooltip[btn_delete_favorite;" .. fgettext("Remove favorite") .. "]"
|
||||
retval = retval .. "style[btn_delete_favorite;padding=6]"
|
||||
@ -367,6 +374,11 @@ local function main_button_handler(tabview, fields, name, tabdata)
|
||||
return true
|
||||
end
|
||||
|
||||
if fields.btn_server_url then
|
||||
core.open_url_dialog(find_selected_server().url)
|
||||
return true
|
||||
end
|
||||
|
||||
if fields.btn_view_clients then
|
||||
local dlg = create_clientslist_dialog(find_selected_server())
|
||||
dlg:set_parent(tabview)
|
||||
|
BIN
textures/base/pack/server_url.png
Normal file
BIN
textures/base/pack/server_url.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 356 B |
Loading…
Reference in New Issue
Block a user