update ambience and unified inventory
This commit is contained in:
parent
773e67ab4c
commit
6beee41992
@ -200,17 +200,17 @@ minetest.register_globalstep(function(dtime)
|
|||||||
|
|
||||||
ok = true -- everything starts off ok
|
ok = true -- everything starts off ok
|
||||||
|
|
||||||
-- stop current sound if another set active or gain changed
|
-- are we playing something already?
|
||||||
if playing[player_name]
|
if playing[player_name]
|
||||||
and playing[player_name].handler then
|
and playing[player_name].handler then
|
||||||
|
|
||||||
|
-- stop current sound if another set active or gain changed
|
||||||
if playing[player_name].set ~= set_name
|
if playing[player_name].set ~= set_name
|
||||||
or (playing[player_name].set == set_name
|
or playing[player_name].gain ~= MORE_GAIN then
|
||||||
and playing[player_name].gain ~= MORE_GAIN) then
|
|
||||||
|
|
||||||
--print ("-- change stop", set_name, playing[player_name].old_handler)
|
--print ("-- change stop", set_name, playing[player_name].handler)
|
||||||
|
|
||||||
minetest.sound_stop(playing[player_name].old_handler)
|
minetest.sound_stop(playing[player_name].handler)
|
||||||
|
|
||||||
playing[player_name].set = nil
|
playing[player_name].set = nil
|
||||||
playing[player_name].handler = nil
|
playing[player_name].handler = nil
|
||||||
@ -220,11 +220,9 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- set random chance and reset seed
|
-- set random chance
|
||||||
chance = random(1, 1000)
|
chance = random(1, 1000)
|
||||||
|
|
||||||
math.randomseed(tod + chance)
|
|
||||||
|
|
||||||
-- if chance is lower than set frequency then select set
|
-- if chance is lower than set frequency then select set
|
||||||
if ok and set_name and chance < sound_sets[set_name].frequency then
|
if ok and set_name and chance < sound_sets[set_name].frequency then
|
||||||
|
|
||||||
@ -249,8 +247,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
|
|
||||||
-- set what player is currently listening to
|
-- set what player is currently listening to
|
||||||
playing[player_name] = {
|
playing[player_name] = {
|
||||||
set = set_name, gain = MORE_GAIN,
|
set = set_name, gain = MORE_GAIN, handler = handler
|
||||||
handler = handler, old_handler = handler
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- set timer to stop sound
|
-- set timer to stop sound
|
||||||
@ -261,17 +258,15 @@ minetest.register_globalstep(function(dtime)
|
|||||||
-- make sure we are stopping same sound we started
|
-- make sure we are stopping same sound we started
|
||||||
if playing[player_name]
|
if playing[player_name]
|
||||||
and playing[player_name].handler
|
and playing[player_name].handler
|
||||||
and playing[player_name].old_handler == handler then
|
and playing[player_name].handler == handler then
|
||||||
|
|
||||||
--print("-- timed stop", set_name, handler)
|
--print("-- timed stop", set_name, handler)
|
||||||
|
|
||||||
--minetest.sound_stop(playing[player_name].handler)
|
|
||||||
minetest.sound_stop(handler)
|
minetest.sound_stop(handler)
|
||||||
|
|
||||||
-- reset player variables and backup handler
|
-- reset player variables and backup handler
|
||||||
playing[player_name] = {
|
playing[player_name] = {
|
||||||
set = nil, gain = nil,
|
set = nil, gain = nil, handler = nil
|
||||||
handler = nil, old_handler = nil
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
@ -501,12 +501,12 @@ sed -i 's/"listcolors\[#00000000;#00000000\]"/""/' $workdir"/mods/unified_invent
|
|||||||
|
|
||||||
sed -i "/formspec\[n\] = fsdata.formspec/ {
|
sed -i "/formspec\[n\] = fsdata.formspec/ {
|
||||||
a \\\tformspec[n+1]=\"style_type[image_button;bgcolor=\"..dreambuilder_theme.btn_color..\"]\"
|
a \\\tformspec[n+1]=\"style_type[image_button;bgcolor=\"..dreambuilder_theme.btn_color..\"]\"
|
||||||
a \\\tformspec[n+2]=
|
a \\\tformspec[n+2]=${LISTCOLORS_HIDE_SLOTS%..}
|
||||||
a \\\t\t$LISTCOLORS_HIDE_SLOTS
|
a \\\tn = n + 3
|
||||||
a \\\t\t\t\"\"
|
|
||||||
a \\\tn = n + 2
|
|
||||||
}" $workdir"/mods/unified_inventory/internal.lua"
|
}" $workdir"/mods/unified_inventory/internal.lua"
|
||||||
|
|
||||||
|
sed -i '0,/n = n+1/s///' $workdir"/mods/unified_inventory/internal.lua"
|
||||||
|
|
||||||
sed -i '/pagedef.formspec_prepend/ {
|
sed -i '/pagedef.formspec_prepend/ {
|
||||||
a \\t\t"no_prepend[]"..default.gui_bg,
|
a \\t\t"no_prepend[]"..default.gui_bg,
|
||||||
d
|
d
|
||||||
|
@ -49,6 +49,8 @@ local ui = unified_inventory
|
|||||||
ui.style_full = {
|
ui.style_full = {
|
||||||
formspec_x = 1,
|
formspec_x = 1,
|
||||||
formspec_y = 1,
|
formspec_y = 1,
|
||||||
|
formw = 17.75,
|
||||||
|
formh = 12.25,
|
||||||
pagecols = 8,
|
pagecols = 8,
|
||||||
pagerows = 10,
|
pagerows = 10,
|
||||||
page_x = 10.75,
|
page_x = 10.75,
|
||||||
@ -80,6 +82,8 @@ ui.style_full = {
|
|||||||
ui.style_lite = {
|
ui.style_lite = {
|
||||||
formspec_x = 0.6,
|
formspec_x = 0.6,
|
||||||
formspec_y = 0.6,
|
formspec_y = 0.6,
|
||||||
|
formw = 14,
|
||||||
|
formh = 9.75,
|
||||||
pagecols = 4,
|
pagecols = 4,
|
||||||
pagerows = 6,
|
pagerows = 6,
|
||||||
page_x = 10.5,
|
page_x = 10.5,
|
||||||
|
@ -40,29 +40,24 @@ function ui.get_formspec(player, page)
|
|||||||
if not pagedef then
|
if not pagedef then
|
||||||
return "" -- Invalid page name
|
return "" -- Invalid page name
|
||||||
end
|
end
|
||||||
|
|
||||||
local formspec = {
|
local formspec = {
|
||||||
"formspec_version[4]size[17.75,12.25]",
|
"formspec_version[4]",
|
||||||
|
"size["..ui_peruser.formw..","..ui_peruser.formh.."]",
|
||||||
"no_prepend[]"..default.gui_bg,
|
"no_prepend[]"..default.gui_bg,
|
||||||
ui.standard_background -- Background
|
ui.standard_background
|
||||||
}
|
}
|
||||||
local n = 4
|
|
||||||
|
|
||||||
if draw_lite_mode then
|
local n = 5
|
||||||
formspec[1] = "formspec_version[4]size[14,9.75]"
|
|
||||||
formspec[3] = ui.standard_background
|
|
||||||
end
|
|
||||||
|
|
||||||
local perplayer_formspec = ui.get_per_player_formspec(player_name)
|
local perplayer_formspec = ui.get_per_player_formspec(player_name)
|
||||||
local fsdata = pagedef.get_formspec(player, perplayer_formspec)
|
local fsdata = pagedef.get_formspec(player, perplayer_formspec)
|
||||||
|
|
||||||
formspec[n] = fsdata.formspec
|
formspec[n] = fsdata.formspec
|
||||||
formspec[n+1]="style_type[image_button;bgcolor="..dreambuilder_theme.btn_color.."]"
|
formspec[n+1]="style_type[image_button;bgcolor="..dreambuilder_theme.btn_color.."]"
|
||||||
formspec[n+2]=
|
formspec[n+2]="listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000]"
|
||||||
"listcolors[#00000000;"..dreambuilder_theme.listcolor_slot_bg_hover..";#00000000]"..
|
n = n + 3
|
||||||
""
|
|
||||||
n = n + 2
|
|
||||||
n = n+1
|
|
||||||
|
|
||||||
local button_row = 0
|
local button_row = 0
|
||||||
local button_col = 0
|
local button_col = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user