diff --git a/menu/header.png b/menu/header.png index 3152cc7..23b419a 100644 Binary files a/menu/header.png and b/menu/header.png differ diff --git a/menu/icon.png b/menu/icon.png index 6e72af2..777c7b1 100644 Binary files a/menu/icon.png and b/menu/icon.png differ diff --git a/menu/icons.png b/menu/icons.png new file mode 100644 index 0000000..777c7b1 Binary files /dev/null and b/menu/icons.png differ diff --git a/mods/Menu/hud/init.lua b/mods/Menu/hud/init.lua index 90144b2..5a02eea 100644 --- a/mods/Menu/hud/init.lua +++ b/mods/Menu/hud/init.lua @@ -1,14 +1,23 @@ hud = {} +GameOS = 0 local path = minetest.get_modpath("hud") -if PLATFORM == "Android" then +if PLATFORM == "IOS" or PLATFORM == "Android" then + GameOS = "Mobile" +else + GameOS = "PC" +end + +if GameOS == "Mobile" then + +elseif GameOS == "PC" then + + dofile(path .. "/api.lua") + dofile(path .. "/builtin.lua") + dofile(path .. "/legacy.lua") + dofile(path .. "/itemwheel.lua") else - -dofile(path .. "/api.lua") -dofile(path .. "/builtin.lua") -dofile(path .. "/legacy.lua") -dofile(path .. "/itemwheel.lua") end \ No newline at end of file diff --git a/mods/Other/music/depends.txt b/mods/Other/music/depends.txt new file mode 100644 index 0000000..fdf44a0 --- /dev/null +++ b/mods/Other/music/depends.txt @@ -0,0 +1 @@ +vote? diff --git a/mods/Other/music/init.lua b/mods/Other/music/init.lua new file mode 100644 index 0000000..c78f6de --- /dev/null +++ b/mods/Other/music/init.lua @@ -0,0 +1,106 @@ + +music={} + + +music.pause_between_songs=minetest.settings:get("music.pause_between_songs") or 10 + +--end config + +music.modpath=minetest.get_modpath("music") +if not music.modpath then + error("music mod folder has to be named 'music'!") +end +--{name, length, gain~1} +music.songs = {} +local sfile, sfileerr=io.open(music.modpath..DIR_DELIM.."songs.txt") +if not sfile then error("Error opening songs.txt: "..sfileerr) end +for line in sfile:lines() do + if line~="" and line[1]~="#" then + local name, timeMinsStr, timeSecsStr, gainStr, title = string.match(line, "^(%S+)%s+(%d+):([%d%.]+)%s+([%d%.]+)%s*(.*)$") + local timeMins, timeSecs, gain = tonumber(timeMinsStr), tonumber(timeSecsStr), tonumber(gainStr) + if title=="" then title = name end + if name and timeMins and timeSecs and gain then + music.songs[#music.songs+1]={name=name, length=timeMins*60+timeSecs, lengthhr=timeMinsStr..":"..timeSecsStr, gain=gain, title=title} + else + minetest.log("warning", "[music] Misformatted song entry in songs.txt: "..line) + end + end +end +sfile:close() + +if #music.songs==0 then + print("[music]no songs registered, not doing anything") + return +end + +music.storage = minetest.get_mod_storage() + +music.handles={} + +music.playing=false +music.id_playing=nil +music.song_time_left=nil +music.time_next=10 --sekunden +music.id_last_played=nil + +minetest.register_globalstep(function(dtime) + if music.playing then + if music.song_time_left<=0 then + music.stop_song() + music.time_next=music.pause_between_songs + else + music.song_time_left=music.song_time_left-dtime + end + elseif music.time_next then + if music.time_next<=0 then + music.next_song() + else + music.time_next=music.time_next-dtime + end + end +end) +music.play_song=function(id) + if music.playing then + music.stop_song() + end + local song=music.songs[id] + if not song then return end + for _,player in ipairs(minetest.get_connected_players()) do + local pname=player:get_player_name() + local pvolume=tonumber(music.storage:get_string("vol_"..pname)) + if not pvolume then pvolume=1 end + if pvolume>0 then + local handle = minetest.sound_play(song.name, {to_player=pname, gain=song.gain*pvolume}) + if handle then + music.handles[pname]=handle + end + end + end + music.playing=id + --adding 2 seconds as security + music.song_time_left = song.length + 2 +end +music.stop_song=function() + for pname, handle in pairs(music.handles) do + minetest.sound_stop(handle) + end + music.id_last_played=music.playing + music.playing=nil + music.handles={} + music.time_next=nil +end + +music.next_song=function() + local next + repeat + next=math.random(1,#music.songs) + until #music.songs==1 or next~=music.id_last_played + music.play_song(next) +end + +music.song_human_readable=function(id) + if not tonumber(id) then return "" end + local song=music.songs[id] + if not song then return "" end + return id..": "..song.title.." ["..song.lengthhr.."]" +end \ No newline at end of file diff --git a/mods/Other/music/mod.conf b/mods/Other/music/mod.conf new file mode 100644 index 0000000..f4c3a02 --- /dev/null +++ b/mods/Other/music/mod.conf @@ -0,0 +1 @@ +name = music diff --git a/mods/Other/music/readme.txt b/mods/Other/music/readme.txt new file mode 100644 index 0000000..023a549 --- /dev/null +++ b/mods/Other/music/readme.txt @@ -0,0 +1,44 @@ + +### music Mod for Minetest +(c) 2017 orwell96 +This mod is licensed under the LGPL 2.1 license. + +Adds an easy but powerful background music backend. + +## Usage: + +For all players: +/mvolume +Set your individual music volume or disable background music (/mvolume 0). Saved across server restarts. +/music_list: list available music + +With music privilege: +/music_play : play a song +/music_stop: stop the current song. Unless /music_play or /music_next are invoked, no more music is played +/music_next [time]: Play the next song after [time] seconds, immediately if omitted. + +## Votes: +This mod integrates with the [vote] mod by rubenwardy (https://github.com/minetest-mods/vote) +/vote_music_next - vote to start next song +/vote_music_play - Vote to play certain sing + +## Music credits: + +StrangelyBeautifulShort 3:01 0.7 +AvalonShort 2:58 1.4 +EtherealShort 3:04 0.7 +FarawayShort 3:05 0.7 +-> Music from [ambience] mod +-> Author is Amethystium . + +eastern_feeling 3:51 1.0 +-> created by Jordach. It can be found in the BFD subgame. License is GPLv3 (license of BFD). + +bensound_deepblue 4:48 1.0 +bensound_ofeliasdream 4:59 1.0 +bensound_slowmotion 3:26 1.0 +-> (c) bensound (AFAIK public domain) + +rainymemory 2:10 1.0 +anonnp4014 2:30 1.6 +-> (c) Deemo collection (game music collection) diff --git a/mods/Other/music/settingtypes.txt b/mods/Other/music/settingtypes.txt new file mode 100644 index 0000000..72b8008 --- /dev/null +++ b/mods/Other/music/settingtypes.txt @@ -0,0 +1,3 @@ +# How many seconds MPD waits before starting the next song +music_pause_between_songs (Pause between songs) int 30 0 3600 + diff --git a/mods/Other/music/songs.txt b/mods/Other/music/songs.txt new file mode 100644 index 0000000..ac9d70a --- /dev/null +++ b/mods/Other/music/songs.txt @@ -0,0 +1,2 @@ +#File Name Time Gain Title +rainymemory 2:10 1.0 Rainy Memory diff --git a/mods/Other/music/sounds/rainymemory.ogg b/mods/Other/music/sounds/rainymemory.ogg new file mode 100644 index 0000000..bf5de80 Binary files /dev/null and b/mods/Other/music/sounds/rainymemory.ogg differ