update script to start & adding music

This commit is contained in:
AleaJactaEst 2022-03-31 22:26:32 +02:00
parent c65da26e3d
commit 23e1e4dbd7
96 changed files with 537 additions and 227 deletions

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -19,6 +19,8 @@ msdf_size=48
force_autohinter=false
hinting=1
subpixel_positioning=1
embolden=0.0
transform=Transform2D(1, 0, 0, 1, 0, 0)
oversampling=0.0
compress=true
opentype_feature_overrides={}

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -23,7 +23,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0

View file

@ -23,7 +23,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=7

View file

@ -23,7 +23,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=1
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=1

View file

@ -23,7 +23,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0

View file

@ -23,7 +23,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -23,7 +23,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0

View file

@ -23,7 +23,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=1
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0

View file

@ -23,7 +23,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=1
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0

View file

@ -23,7 +23,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

Binary file not shown.

View file

@ -0,0 +1,16 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
uid="uid://b72kh8gm5en7c"
path="res://.godot/imported/01_endless_moons.ogg-dfe682e261a5a94be2d2ab247731c03d.oggvorbisstr"
[deps]
source_file="res://music/default/01_endless_moons.ogg"
dest_files=["res://.godot/imported/01_endless_moons.ogg-dfe682e261a5a94be2d2ab247731c03d.oggvorbisstr"]
[params]
loop=true
loop_offset=0

Binary file not shown.

View file

@ -0,0 +1,16 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
uid="uid://c36nxetkefnsd"
path="res://.godot/imported/02_dreaming_of_leaves.ogg-24c0117becd28c52e9e34f14e526eb8e.oggvorbisstr"
[deps]
source_file="res://music/default/02_dreaming_of_leaves.ogg"
dest_files=["res://.godot/imported/02_dreaming_of_leaves.ogg-24c0117becd28c52e9e34f14e526eb8e.oggvorbisstr"]
[params]
loop=true
loop_offset=0

Binary file not shown.

View file

@ -0,0 +1,16 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
uid="uid://bbpymvduja7ow"
path="res://.godot/imported/03_mystical_fungi_cave.ogg-1cd9596450419740d49c5e18c3433f9f.oggvorbisstr"
[deps]
source_file="res://music/default/03_mystical_fungi_cave.ogg"
dest_files=["res://.godot/imported/03_mystical_fungi_cave.ogg-1cd9596450419740d49c5e18c3433f9f.oggvorbisstr"]
[params]
loop=true
loop_offset=0

Binary file not shown.

View file

@ -0,0 +1,16 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
uid="uid://jitjlhb8hywi"
path="res://.godot/imported/04_frozen_ocean_trip.ogg-c06afdbb1e561433ab886f2d54aba696.oggvorbisstr"
[deps]
source_file="res://music/default/04_frozen_ocean_trip.ogg"
dest_files=["res://.godot/imported/04_frozen_ocean_trip.ogg-c06afdbb1e561433ab886f2d54aba696.oggvorbisstr"]
[params]
loop=true
loop_offset=0

Binary file not shown.

View file

@ -0,0 +1,16 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
uid="uid://bveotqvl5jaq5"
path="res://.godot/imported/05_conscious_swamp.ogg-82d427ffa7202f79b8b058710b66d0d2.oggvorbisstr"
[deps]
source_file="res://music/default/05_conscious_swamp.ogg"
dest_files=["res://.godot/imported/05_conscious_swamp.ogg-82d427ffa7202f79b8b058710b66d0d2.oggvorbisstr"]
[params]
loop=true
loop_offset=0

Binary file not shown.

View file

@ -0,0 +1,16 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
uid="uid://c1irauo6fnb76"
path="res://.godot/imported/06_strange_reality_warp.ogg-a224b3d63c378f800ac5068b65ce059f.oggvorbisstr"
[deps]
source_file="res://music/default/06_strange_reality_warp.ogg"
dest_files=["res://.godot/imported/06_strange_reality_warp.ogg-a224b3d63c378f800ac5068b65ce059f.oggvorbisstr"]
[params]
loop=true
loop_offset=0

12
music/default/README.txt Normal file
View file

@ -0,0 +1,12 @@
* Album: Free Surreal/Dream Music Pack
Licence: CC0
Author: tricksntraps
Source: https://opengameart.org/content/free-surrealdream-music-pack
Files:
- 01_endless_moons.ogg
- 02_dreaming_of_leaves.ogg
- 03_mystical_fungi_cave.ogg
- 04_frozen_ocean_trip.ogg
- 05_conscious_swamp.ogg
- 06_strange_reality_warp.ogg

15
music/extra/README.txt Normal file
View file

@ -0,0 +1,15 @@
* Album: Main Title Screen Music
Licence: CC0
Author: Kresiek The Furry
Source: https://opengameart.org/content/main-title-screen-music
Files:
- song.ogg
* Album: Mystical RPG Maker Town Theme
Licence: CC0
Author: symphony
Source: https://opengameart.org/content/mystical-rpg-maker-town-theme
Files:
- symphony - mystical town 01.ogg

BIN
music/extra/song.ogg Normal file

Binary file not shown.

View file

@ -0,0 +1,16 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
uid="uid://b6cuffq478qen"
path="res://.godot/imported/song.ogg-532a7096cf06ac6357b15b0cc92931e0.oggvorbisstr"
[deps]
source_file="res://music/extra/song.ogg"
dest_files=["res://.godot/imported/song.ogg-532a7096cf06ac6357b15b0cc92931e0.oggvorbisstr"]
[params]
loop=true
loop_offset=0

Binary file not shown.

View file

@ -0,0 +1,16 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOGGVorbis"
uid="uid://c4e3byp4okx63"
path="res://.godot/imported/symphony - mystical town 01.ogg-4093f9d5665928804a82b2f4778e999c.oggvorbisstr"
[deps]
source_file="res://music/extra/symphony - mystical town 01.ogg"
dest_files=["res://.godot/imported/symphony - mystical town 01.ogg-4093f9d5665928804a82b2f4778e999c.oggvorbisstr"]
[params]
loop=true
loop_offset=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -1033,7 +1033,7 @@ func _process( delta ):
input_z = 1.0
move_up = true
if Input.is_action_pressed("INPUT_ACTION_UP"):
reconciliate_rotate_player_back = true
reconciliate_rotate_camera_player = true
elif Input.is_action_pressed("INPUT_ACTION_DOWN"):
player_automove = false
input_y = -1.0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -21,7 +21,6 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=5 format=3 uid="uid://cem7wppuuoabv"]
[gd_scene load_steps=6 format=3 uid="uid://cem7wppuuoabv"]
[ext_resource type="PackedScene" uid="uid://dwxrvijqyym70" path="res://player/player.tscn" id="1_btdsd"]
[ext_resource type="Script" path="res://scenes/main/main.gd" id="1_ld2xt"]
[ext_resource type="PackedScene" uid="uid://b8p2h0rmwy7qn" path="res://maps/basic_setup.tscn" id="2_jj4oa"]
[ext_resource type="PackedScene" uid="uid://cdyi1a858p7em" path="res://scenes/hud/hud.tscn" id="3_5vcj4"]
[ext_resource type="PackedScene" uid="uid://ebfrhgrluixd" path="res://scenes/music/music_manager.tscn" id="5_nlfpg"]
[node name="main_scene" type="Node3D"]
script = ExtResource( "1_ld2xt" )
@ -14,3 +15,6 @@ transform = Transform3D(0.677723, 0, -0.735317, 0, 1, 0, 0.735317, 0, 0.677723,
[node name="terrain_basic_setup" parent="." instance=ExtResource( "2_jj4oa" )]
[node name="Control" parent="." instance=ExtResource( "3_5vcj4" )]
[node name="MusicManager" parent="." instance=ExtResource( "5_nlfpg" )]
visible = false

View file

@ -0,0 +1,115 @@
extends Control
@onready var music_player:AudioStreamPlayer = $music
var official_music:Dictionary = {}
var current_area:String = "extra"
var current_music:String = ""
func _ready():
var directory:Directory = Directory.new()
var files = []
get_tree().paused = false
Common.msg_debug("Load MusicManager")
if not directory.dir_exists( "res://music/" ):
Common.msg_debug("No Music")
return
directory.open( "res://music/" )
for dir in directory.get_directories():
var dir2:Directory = Directory.new()
var fullpath: String = "res://music/" + dir
dir2.open( fullpath )
Common.msg_debug("Dir: " + str(dir))
for file in dir2.get_files():
if file == "":
break
elif not file.begins_with(".") and not dir2.current_is_dir() and (file.ends_with( ".ogg" ) or file.ends_with( ".mp3" )):
if ! official_music.has(dir):
official_music[dir] = []
official_music[dir].append(fullpath + "/" + file)
files.append(file)
Common.msg_debug("File: " + str(file))
Common.msg_debug("List: " + str(official_music))
# music_player.connect("finished", self._on_stream_finished.bind())
# music_player.connect("finished", _on_stream_finished.bind())
#music_player.finished.connect(_on_stream_finished.bind())
music_player.finished.connect(self._on_stream_finished.bind())
#music_player.loop = false
if official_music.has(current_area):
var first = official_music[current_area][0]
Common.msg_debug("Play music: " + first)
play_music(first)
func load_external_music(filepath):
var stream = null
Common.msg_debug("load_external_music")
var file = File.new()
file.open(filepath, file.READ)
var ext = filepath.split(".")[-1].to_lower()
var buffer = file.get_buffer(file.get_len())
Common.msg_debug(ext)
match ext:
"ogg":
stream = AudioStreamOGGVorbis.new()
"mp3":
stream = AudioStreamMP3.new()
#"wav":
# # We need decode message to get format (Stero/size bit/ ...)
# stream = AudioStreamSample.new()
# stream.format = AudioStreamSample.FORMAT_16_BITS
# #stream.stereo = true
_:
Common.msg_error("Impossible to identify type of file (file:" + filepath + ", ext:" + ext + ")")
return
stream.data = buffer
Common.msg_debug("load_external_music : End")
return stream
func load_music(filepath: String):
if filepath.left(5) == "res:/":
return load( filepath )
return load_external_music(filepath)
func _on_stream_finished():
Common.msg_debug("_on_stream_finished")
music_player.stop()
func play_music(filename: String):
if current_music == filename:
return
#music_player.stream = load_music( filename )
music_player.set_stream(load_music( filename ))
music_player.play()
music_player.get_stream().set_loop(false)
Common.msg_debug("Signal:" + str(music_player.get_signal_list()))
Common.msg_debug("Signal:" + str(music_player.get_stream().get_signal_list()))
Common.msg_debug("Signal connecte:" + str(music_player.finished.get_connections()))
# music_player.connect("finished", _on_stream_finished.bind())
current_music = filename
# music_play = true
# for child in $window_box/scroll_box/musics_box.get_children():
# child.set_play()
# if Config.mute:
# child.set_disabled()
# elif child.get_music() == filename or not Config.playermusic :
# child.set_play()
# else:
# child.set_unplay()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
# if ! music_player.get_stream().is_playing():
# Common.msg_debug("Not playing")
# else:
# Common.msg_debug("Playing")
pass
func _on_music_finished():
Common.msg_debug("_on_music_finished")
music_player.stop()

View file

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://ebfrhgrluixd"]
[ext_resource type="Script" path="res://scenes/music/music_manager.gd" id="1_dltpv"]
[node name="MusicManager" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( "1_dltpv" )
[node name="music" type="AudioStreamPlayer" parent="."]
[connection signal="finished" from="music" to="." method="_on_music_finished"]

View file

@ -10,6 +10,7 @@ declare WORKDIR="$(dirname $(readlink -f $0))"
declare GODOT_SRC="https://downloads.tuxfamily.org/godotengine/4.0/alpha5/Godot_v4.0-alpha5_linux.64.zip"
declare OUTZIP="$WORKDIR/$(basename $GODOT_SRC)"
declare OPTION=""
declare NEWPRG=0
function msg_debug()
{
@ -78,6 +79,7 @@ function extract()
then
msg_info "Uncompressed GODOT"
echo $fileout
NEWPRG=1
return 0
fi
fi
@ -86,7 +88,7 @@ function extract()
}
while getopts hdeo:s:fi flag
while getopts hdeo:s:fix flag
do
case "${flag}" in
h) HELP=1;;
@ -124,12 +126,18 @@ download "$GODOT_SRC" "$OUTZIP"
EXE=$(extract "$OUTZIP")
msg_info "Prg:$EXE"
if [ $NEWPRG -ne 0 ]
then
ERASEIMPORT=1
IMPORT=1
fi
if [ $ERASEIMPORT -ne 0 ]
then
rm -f $WORKDIR/.godot/imported/*
fi
if [ $IMPORT -ne 0 ]
if [[ ($IMPORT -ne 0) || (! -d $WORKDIR/.godot) ]]
then
$WORKDIR/$EXE --editor --quit
exit $?