Allow main menu music to be disabled.

This commit is contained in:
luk3yx 2019-03-12 13:40:16 +13:00
parent ac62ffacc2
commit 0cee3e3c3a
8 changed files with 52 additions and 14 deletions

View File

@ -334,3 +334,17 @@ function menu_worldmt_legacy(selected)
end
end
end
-- Start/stop the main menu music
local music_playing = false
function menu_music()
local music_enabled = core.settings:get_bool("main_menu_music")
if music_playing then
if not music_enabled then
core.sound_stop(music_playing)
music_playing = false
end
elseif music_enabled then
music_playing = core.sound_play("main_menu", true)
end
end

View File

@ -745,6 +745,7 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
if fields["btn_back"] then
this:delete()
menu_music()
return true
end

View File

@ -96,4 +96,3 @@ file:close()
file = assert(io.open("src/settings_translation_file.cpp", "w"))
file:write(create_translation_file())
file:close()

View File

@ -153,7 +153,7 @@ local function init_globals()
ui.update()
core.sound_play("main_menu", true)
menu_music()
end
init_globals()

View File

@ -102,7 +102,6 @@ always_fly_fast (Always fly and fast) bool true
repeat_rightclick_time (Rightclick repetition interval) float 0.25
# Automatically jump up single-node obstacles.
# type: bool
autojump (Automatic jumping) bool false
# Prevent digging and placing from repeating when holding the mouse buttons.
@ -708,6 +707,9 @@ enable_sound (Sound) bool true
sound_volume (Volume) float 0.7 0.0 1.0
# Play main_menu.ogg while the main menu is open.
main_menu_music (Main menu music) bool true
[*Advanced]
# Timeout for client to remove unused map data from memory.

View File

@ -847,6 +847,10 @@
# type: float min: 0 max: 1
# sound_volume = 0.7
# Play main_menu.ogg while the main menu is open.
# type: bool
# main_menu_music = true
## Advanced
# Timeout for client to remove unused map data from memory.

View File

@ -230,6 +230,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("main_menu_path", "");
settings->setDefault("main_menu_mod_mgr", "1");
settings->setDefault("main_menu_game_mgr", "0");
settings->setDefault("main_menu_music", "true");
settings->setDefault("serverlist_file", "favoriteservers.txt");
#if USE_FREETYPE

View File

@ -9,8 +9,10 @@ fake_function() {
gettext("If enabled, you can place blocks at the position (feet + eye level) where you stand.\nThis is helpful when working with nodeboxes in small areas.");
gettext("Flying");
gettext("Player is able to fly without being affected by gravity.\nThis requires the \"fly\" privilege on the server.");
gettext("Pitch move mode");
gettext("If enabled, makes move directions relative to the player's pitch when flying or swimming.");
gettext("Fast movement");
gettext("Fast movement (via use key).\nThis requires the \"fast\" privilege on the server.");
gettext("Fast movement (via the \"special\" key).\nThis requires the \"fast\" privilege on the server.");
gettext("Noclip");
gettext("If enabled together with fly mode, player is able to fly through solid nodes.\nThis requires the \"noclip\" privilege on the server.");
gettext("Cinematic mode");
@ -28,14 +30,17 @@ fake_function() {
gettext("Double tap jump for fly");
gettext("Double-tapping the jump key toggles fly mode.");
gettext("Always fly and fast");
gettext("Automatic jumping");
gettext("If disabled, \"special\" key is used to fly fast if both fly and fast mode are enabled.");
gettext("If disabled \"use\" key is used to fly fast if both fly and fast mode are enabled.");
gettext("Rightclick repetition interval");
gettext("The time in seconds it takes between repeated right clicks when holding the right mouse button.");
gettext("Automatic jumping");
gettext("Automatically jump up single-node obstacles.");
gettext("Safe digging and placing");
gettext("Prevent digging and placing from repeating when holding the mouse buttons.\nEnable this when you dig or place too often by accident.");
gettext("Random input");
gettext("Enable random user input (only used for testing).");
gettext("Continuous forward");
gettext("Continuous forward movement, toggled by autoforward key.");
gettext("Continuous forward movement (only used for testing).");
gettext("Enable Joysticks");
gettext("Enable Joysticks");
gettext("Joystick ID");
@ -68,12 +73,12 @@ fake_function() {
gettext("Key for opening the chat window to type commands.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Command key");
gettext("Key for opening the chat window to type local commands.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Console key");
gettext("Key for opening the chat console.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Range select key");
gettext("Key for toggling unlimited view range.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Fly key");
gettext("Key for toggling flying.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Pitch move key");
gettext("Key for toggling pitch move mode.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Fast key");
gettext("Key for toggling fast mode.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Noclip key");
@ -88,8 +93,8 @@ fake_function() {
gettext("Key for increasing the volume.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Dec. volume key");
gettext("Key for decreasing the volume.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Autoforward key");
gettext("Key for toggling autoforward.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Autorun key");
gettext("Key for toggling autorun.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Cinematic mode key");
gettext("Key for toggling cinematic mode.\nSee http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3");
gettext("Minimap key");
@ -141,6 +146,8 @@ fake_function() {
gettext("URL to the server list displayed in the Multiplayer Tab.");
gettext("Serverlist file");
gettext("File in client/serverlist/ that contains your favorite servers displayed in the Multiplayer Tab.");
gettext("Maximum size of the out chat queue");
gettext("Maximum size of the out chat queue. 0 to disable queueing and -1 to make the queue size unlimited");
gettext("Graphics");
gettext("In-Game");
gettext("Basic");
@ -224,12 +231,18 @@ fake_function() {
gettext("If FPS would go higher than this, limit it by sleeping\nto not waste CPU power for no benefit.");
gettext("FPS in pause menu");
gettext("Maximum FPS when game is paused.");
gettext("Pause on lost window focus");
gettext("Open the pause menu when the window's focus is lost. Does not pause if a formspec is open.");
gettext("Viewing range");
gettext("View distance in nodes.");
gettext("Near plane");
gettext("Camera near plane distance in nodes, between 0 and 0.5\nMost users will not need to change this.\nIncreasing can reduce artifacting on weaker GPUs.\n0.1 = Default, 0.25 = Good value for weaker tablets.");
gettext("Screen width");
gettext("Width component of the initial window size.");
gettext("Screen height");
gettext("Height component of the initial window size.");
gettext("Autosave Screen Size");
gettext("Save window size automatically when modified.");
gettext("Full screen");
gettext("Fullscreen mode.");
gettext("Full screen BPP");
@ -250,8 +263,6 @@ fake_function() {
gettext("Height on which clouds are appearing.");
gettext("Cloud radius");
gettext("Radius of cloud area stated in number of 64 node cloud squares.\nValues larger than 26 will start to produce sharp cutoffs at cloud area corners.");
gettext("Enable view bobbing");
gettext("Enables view bobbing when walking.");
gettext("View bobbing factor");
gettext("Enable view bobbing and amount of view bobbing.\nFor example: 0 for no view bobbing; 1.0 for normal; 2.0 for double.");
gettext("Fall bobbing factor");
@ -343,6 +354,8 @@ fake_function() {
gettext("Sound");
gettext("Sound");
gettext("Volume");
gettext("Main menu music");
gettext("Play main_menu.ogg while the main menu is open.");
gettext("Advanced");
gettext("Mapblock unload timeout");
gettext("Timeout for client to remove unused map data from memory.");
@ -453,7 +466,6 @@ fake_function() {
gettext("Fast mode speed");
gettext("Climbing speed");
gettext("Jumping speed");
gettext("Descending speed");
gettext("Liquid fluidity");
gettext("Liquid fluidity smoothing");
gettext("Liquid sink");
@ -771,4 +783,9 @@ fake_function() {
gettext("Main menu mod manager");
gettext("Engine profiling data print interval");
gettext("Print the engine's profiling data in regular intervals (in seconds). 0 = disable. Useful for developers.");
gettext("Content Store");
gettext("ContentDB URL");
gettext("The URL for the content repository");
gettext("ContentDB Flag Blacklist");
gettext("Comma-separated list of flags to hide in the content repository.\n\"nonfree\" can be used to hide packages which do not qualify as 'free software',\nas defined by the Free Software Foundation.\nYou can also specify content ratings.\nThese flags are independent from Minetest versions,\nso see a full list at https://content.minetest.net/help/content_flags/");
}