Browse Source

Main-menu music feature.

This  Final Minetest commit adds  "luk3yx's" version of the  main-
menu music feature.

It's a  merge of  the following commits from  "luk3yx's"  Minetest
0.4.X fork:

Commit: ecde4b07b0
From:   luk3yx
Date:   Sat, 16 Feb 2019 13:09:44 +1300
Notes:  Update license information

Commit: e48469f7d3
From:   luk3yx
Date:   Sun, 17 Feb 2019 20:34:27 +1300
Notes:  Add the main menu sound

Commit: 0cee3e3c3a
From:   luk3yx <luk3yx@users.noreply.github.com>
Date:   Tue, 12 Mar 2019 13:40:16 +1300
Notes:  Allow main menu music to be disabled
master
OldCoder 2 months ago
parent
commit
26ab284739

+ 4
- 0
LICENSE.txt View File

@@ -16,6 +16,10 @@ Authors of media files
Everything not listed in here:
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>

Edgy1:
sounds/main_menu.ogg
(originally created by [darkrose](https://gitlab.com/voxelands/voxelands/commit/58d9b384f307dd0e5441da1e6fa3ef080e01a5d1) for Voxelands and licensed under CC BY-SA 3.0 unported, bird sounds from [thearxx08 on Freesound](https://freesound.org/people/thearxx08/sounds/272417/))

BlockMen, modified by davidgumberg and kilbith:
textures/base/pack/gui_formbg.png


+ 14
- 0
builtin/mainmenu/common.lua View File

@@ -346,3 +346,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

+ 1
- 0
builtin/mainmenu/dlg_settings_advanced.lua View File

@@ -991,6 +991,7 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)

if fields["btn_back"] then
this:delete()
menu_music()
return true
end


+ 1
- 1
builtin/mainmenu/init.lua View File

@@ -161,7 +161,7 @@ local function init_globals()

ui.update()

core.sound_play("main_menu", true)
menu_music()
end

init_globals()

+ 3
- 0
builtin/settingtypes.txt View File

@@ -824,6 +824,9 @@ screenshot_format (Screenshot format) enum png png,jpg,bmp,pcx,ppm,tga
# Use 0 for default quality.
screenshot_quality (Screenshot quality) int 0 0 100

# Play main_menu.ogg while the main menu is open.
main_menu_music (Main menu music) bool true

[*Advanced]

# Adjust dpi configuration to your screen (non X11/Android only) e.g. for 4k screens.

+ 4
- 0
minetest.conf.example View File

@@ -963,6 +963,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.

BIN
sounds/main_menu.ogg View File


+ 1
- 0
src/defaultsettings.cpp View File

@@ -263,6 +263,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("main_menu_mod_mgr", "1");
settings->setDefault("main_menu_game_mgr", "0");
settings->setDefault("enable_pwmgr", "true");
settings->setDefault("main_menu_music", "true");
settings->setDefault("serverlist_file", "favoriteservers.txt");

#if USE_FREETYPE

+ 2
- 0
src/settings_translation_file.cpp View File

@@ -345,6 +345,8 @@ fake_function() {
gettext("Sound");
gettext("Sound");
gettext("Volume");
gettext("Main menu music");
gettext("Play music while the main menu is open.");
gettext("Advanced");
gettext("Mapblock unload timeout");
gettext("Timeout for client to remove unused map data from memory.");

Loading…
Cancel
Save