adapt visibility dialog to new style
Also button image locations are slightly adapted
@ -18,9 +18,12 @@ Custom Timer=Individueller Timer
|
||||
Visibility=Sichtbarkeit
|
||||
mTimer Configuration=mTimer-Konfiguration
|
||||
|
||||
# Settings
|
||||
Invisible=Unsichtbar
|
||||
Visible=Sichtbar
|
||||
# Visibility
|
||||
Make invisible=Verbergen
|
||||
Make visible=Anzeigen
|
||||
The timer is currently @1.=Der Timer ist aktuell @1.
|
||||
visible=sichtbar
|
||||
invisible=verborgen
|
||||
|
||||
# Information & Warnings
|
||||
30 minutes @= 0.5, 60 minutes @= 1=30 Minuten @= 0.5, 60 Minuten @= 1
|
||||
|
@ -25,12 +25,17 @@ local esc = minetest.formspec_escape
|
||||
|
||||
|
||||
mtimer.dialog.set_visibility = function (player_name)
|
||||
local player = minetest.get_player_by_name(player_name)
|
||||
local visible = player:get_meta():get_string(m.meta.visible.key)
|
||||
local timer_status = visible == 'true' and S('visible') or S('invisible')
|
||||
|
||||
mtimer.show_formspec('mtimer:set_visibility', {
|
||||
title = S('Visibility'),
|
||||
show_to = player_name,
|
||||
formspec = {
|
||||
'button[0,0;3,0.5;visible;'..S('Visible')..']',
|
||||
'button[3.25,0;3,0.5;invisible;'..S('Invisible')..']'
|
||||
mtimer.get_icon_button('set_visible', { width = 4, label = S('Make visible') }),
|
||||
mtimer.get_icon_button('set_invisible', { width = 4, label = S('Make invisible'), container = { left = 4.25 } }),
|
||||
'label[0,1.25;'..S('The timer is currently @1.', timer_status)..']'
|
||||
}
|
||||
})
|
||||
end
|
||||
|
@ -36,9 +36,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
-- Set timer visibility
|
||||
if formname == 'mtimer:set_visibility' then
|
||||
local attr = m.meta.visible
|
||||
if fields.visible then meta:set_string(attr.key, 'true') end
|
||||
if fields.invisible then meta:set_string(attr.key, 'false') end
|
||||
if fields.set_visible then meta:set_string(attr.key, 'true') end
|
||||
if fields.set_invisible then meta:set_string(attr.key, 'false') end
|
||||
if fields.default then meta:set_string(attr.key, attr.default) end
|
||||
if not fields.quit then d.set_visibility(name) end
|
||||
end
|
||||
|
||||
|
||||
|
BIN
textures/buttons/actions/mtimer_set_invisible.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
textures/buttons/actions/mtimer_set_visible.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
0
textures/buttons/mtimer_reset_everything.png → textures/buttons/dialog/mtimer_reset_everything.png
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.1 KiB |