Compare commits

...

10 Commits

Author SHA1 Message Date
notdraimdev 810d5c40de jif support 2024-10-27 14:46:18 +01:00
notdraimdev 81c30245c4 s 2024-10-27 14:36:02 +01:00
notdraimdev e8403a2caf ssssss 2024-10-27 14:24:21 +01:00
notdraimdev 7947422027 y 2024-10-27 14:15:02 +01:00
notdraimdev f14a8170d6 dlete songs 2024-10-27 14:14:21 +01:00
Bucket Of Chicken 35810868fb Update issue templates 2024-10-27 13:12:53 +01:00
notdraimdev c418b417ec Better song selection 2024-10-27 12:59:09 +01:00
notdraimdev 99d4b8dfcc THE sigma??? 2024-10-12 00:29:45 +02:00
notdraimdev e77c7da068 jaja 2024-10-10 14:29:37 +02:00
notdraimdev ed376a728b Human error failsave for updating 2024-10-09 21:29:25 +02:00
31 changed files with 538 additions and 75 deletions
+31
View File
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
+20 -21
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=67 format=3 uid="uid://b2sygl55s6fng"]
[gd_scene load_steps=69 format=3 uid="uid://b2sygl55s6fng"]
[ext_resource type="Script" path="res://main.gd" id="1_ubs1p"]
[ext_resource type="Texture2D" uid="uid://b8on1case224h" path="res://LoopPressed.png" id="2_iolk5"]
@@ -30,6 +30,8 @@
[ext_resource type="Script" path="res://Spinning.gd" id="14_rhw4k"]
[ext_resource type="Script" path="res://yt_tab_button.gd" id="16_2t15p"]
[ext_resource type="Script" path="res://help_button.gd" id="17_4b8oh"]
[ext_resource type="Script" path="res://songs_menu.gd" id="27_f8wx0"]
[ext_resource type="PackedScene" uid="uid://bel6i6wdbexw4" path="res://search_results.tscn" id="27_g8wmp"]
[ext_resource type="Texture2D" uid="uid://bmbxyma4ra46p" path="res://Download.png" id="29_v44vi"]
[ext_resource type="Script" path="res://update_checker.gd" id="30_byc5i"]
[ext_resource type="Script" path="res://patch_notes_button.gd" id="31_hjsj1"]
@@ -764,7 +766,7 @@ alignment = 1
caret_blink = true
script = ExtResource("12_mr42x")
[node name="SongsMenu" type="MenuButton" parent="."]
[node name="SongsMenu" type="Button" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
@@ -774,15 +776,18 @@ offset_right = -328.0
offset_bottom = 80.0
grow_horizontal = 2
text = "Select Songs"
flat = false
script = ExtResource("27_f8wx0")
[node name="SearchResults" type="PopupMenu" parent="."]
handle_input_locally = false
position = Vector2i(265, 80)
size = Vector2i(623, 300)
wrap_controls = false
max_size = Vector2i(625, 300)
allow_search = false
[node name="SearchResults" parent="." instance=ExtResource("27_g8wmp")]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 264.5
offset_top = 84.225
offset_right = -264.5
offset_bottom = -263.775
[node name="VolumeButton" type="Button" parent="."]
texture_filter = 1
@@ -832,14 +837,6 @@ offset_right = 179.0
offset_bottom = -11.0
grow_vertical = 0
[node name="DiscordMenuHolder" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_left = 1042.0
offset_top = 174.0
offset_right = 1082.0
offset_bottom = 214.0
[node name="Version" type="Label" parent="."]
layout_mode = 1
anchors_preset = 3
@@ -851,7 +848,7 @@ offset_left = -64.0
offset_top = -23.0
grow_horizontal = 0
grow_vertical = 0
text = "v1.4.6"
text = "v1.5.0"
horizontal_alignment = 2
[node name="SettingsButton" type="Button" parent="."]
@@ -930,7 +927,6 @@ dialog_autowrap = true
cancel_button_text = "Download Song"
[node name="UpdateChecker" type="Control" parent="."]
visible = false
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
@@ -1121,6 +1117,10 @@ grow_vertical = 2
label_settings = SubResource("LabelSettings_ivhc6")
horizontal_alignment = 1
[node name="deleteConfirm" type="ConfirmationDialog" parent="."]
initial_position = 2
dialog_text = "Are you sure you want to delete"
[connection signal="toggled" from="SelectPlaylist" to="SelectPlaylist" method="_on_toggled"]
[connection signal="pressed" from="PlaylistPanelHolder/PlaylistsPanel/PlaylistsContainer/VBoxContainer/HBoxContainer/CreatePlaylist" to="PlaylistPanelHolder/PlaylistsPanel" method="_on_create_playlist_pressed"]
[connection signal="toggled" from="PlaylistPanelHolder/PlaylistsPanel/PlaylistsContainer/VBoxContainer/HBoxContainer/PlayAll" to="PlaylistPanelHolder/PlaylistsPanel" method="_on_play_all_toggled"]
@@ -1132,7 +1132,6 @@ horizontal_alignment = 1
[connection signal="pressed" from="CreatePlaylistsMenu/CloseButton" to="CreatePlaylistsMenu" method="_on_close_button_pressed"]
[connection signal="toggled" from="SearchToggle" to="SearchToggle" method="_on_toggled"]
[connection signal="text_submitted" from="SearchBar" to="SearchBar" method="_on_text_submitted"]
[connection signal="index_pressed" from="SearchResults" to="SearchBar" method="_on_search_results_index_pressed"]
[connection signal="toggled" from="VolumeButton" to="VolumeButton" method="_on_toggled"]
[connection signal="toggled" from="SettingsButton" to="SettingsButton" method="_on_toggled"]
[connection signal="request_completed" from="UpdateChecker/HTTPRequest" to="UpdateChecker" method="_on_http_request_completed"]
+1 -1
View File
@@ -148,7 +148,7 @@ transient = false
ok_button_text = "Open"
file_mode = 0
access = 2
filters = PackedStringArray("*.png", "*.jpg", "*.jpeg", "*")
filters = PackedStringArray("*.png", "*.jpg ", "*.jpeg", "*.gif", "*")
show_hidden_files = true
use_native_dialog = true
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cm5ps3a716wr0"
path="res://.godot/imported/XSmall.png-2fa29ed3d6c0476862944f7e0885c6ed.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://XSmall.png"
dest_files=["res://.godot/imported/XSmall.png-2fa29ed3d6c0476862944f7e0885c6ed.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 B0TLANNER Games
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+139
View File
@@ -0,0 +1,139 @@
# Godot GIF
<br>
<p align="center">
<img src="./docs-images/logo.gif" alt="Logo" width="128" height="128" />
</p>
<p align="center">
<a href="https://github.com/BOTLANNER/godot-gif/actions/workflows/build_releases.yml"><img alt="GitHub Build" src="https://github.com/BOTLANNER/godot-gif/actions/workflows/build_releases.yml/badge.svg" height="20"/></a>
<a href="https://github.com/BOTLANNER/godot-gif/blob/develop/LICENSE.txt"><img alt="MIT License" src="https://img.shields.io/github/license/BOTLANNER/godot-gif" height="20"/></a>
</p>
## Description
GDExtension for Godot 4+ to load GIF files as [AnimatedTexture](https://docs.godotengine.org/en/stable/classes/class_animatedtexture.html) and/or [SpriteFrames](https://docs.godotengine.org/en/stable/classes/class_spriteframes.html).
NOTE: ~~**AnimatedTexture**~~ has been marked as deprecated according to development docs and could be removed in a future version of Godot.
## Usage
### Editor
Gif files can be imported at edit time as one of the supported types via Import options.
<details open>
<summary>Editor Imports Options</summary>
![Editor Imports Options](./docs-images/EditorImportSettings.gif)
</details>
See the [Editor Imports](./demo/editor_imports_example.tscn) example scene.
<details open>
<summary>Editor Imports Example</summary>
![Editor Imports](./docs-images/EditorImports.gif)
</details>
<hr/>
### Runtime
Gif files can be loaded at runtime as one of the supported types via the `GifManager` singleton.
`GifManager` exposes the following methods for loading gifs either from file or from bytes directly:
![GifManager Methods](./docs-images/methods.png)
e.g. to load from file
```py
get_node("AnimFromRuntimeFile").texture = GifManager.animated_texture_from_file("res://examples/file/optic.gif")
get_node("AnimatedSprite2RuntimeFile").sprite_frames = GifManager.sprite_frames_from_file("res://examples/file/optic.gif")
```
See the [Runtime Imports](./demo/main.tscn) example scene.
<details open>
<summary>Runtime Imports Example</summary>
![Runtime Imports](./docs-images/RuntimeImports.gif)
</details>
## Installation
Download the `gdextension` artifact from the [latest successful build](https://github.com/BOTLANNER/godot-gif/actions/workflows/build_releases.yml). (It should be right at the bottom of the **Summary**)
![image](https://github.com/BOTLANNER/godot-gif/assets/16349308/f28867c6-f669-45f2-9309-dbb17cec2031)
Extract the contents to your Godot project directory.
You should have an `addons` directory at the root with the following structure:
```bash
└───addons
└───godotgif
│ godotgif.gdextension
│ LICENSE.txt
│ README.md
└───bin
│ godotgif.windows.template_debug.x86_32.dll
│ godotgif.windows.template_debug.x86_64.dll
│ godotgif.windows.template_release.x86_32.dll
│ godotgif.windows.template_release.x86_64.dll
│ libgodotgif.android.template_debug.arm64.so
│ libgodotgif.android.template_release.arm64.so
│ libgodotgif.linux.template_debug.x86_32.so
│ libgodotgif.linux.template_debug.x86_64.so
│ libgodotgif.linux.template_release.x86_32.so
│ libgodotgif.linux.template_release.x86_64.so
├───godotgif.macos.template_debug.framework
│ libgodotgif.macos.template_debug
└───godotgif.macos.template_release.framework
libgodotgif.macos.template_release
```
Open your project. Any exisitng gifs should auto-import. New gifs in the project directory will automatically import as `SpriteFrames`. To convert them into `AnimatedTexture`, update the [import settings](#editor).
The `GifManager` class should also now be available for access within GDScript.
## Contributing
### Setup
Ensure **SCons** is setup. Refer to [Introduction to the buildsystem](https://docs.godotengine.org/en/stable/contributing/development/compiling/introduction_to_the_buildsystem.html)
* If using a different version of Godot, be sure to dump the bindings e.g.
```sh
godot --dump-extension-api extension_api.json
```
* Compile with
```sh
scons platform=<platform> custom_api_file=extension_api.json
```
### Debugging
This repository is configured for use with [VSCode](https://code.visualstudio.com/)
[Launch configurations](./.vscode/launch.json) have been setup for both debugging in editor and in runtime provided certain **VSCode** extensions are present and environment variables are defined.
The following environment variables are required:
1. `GODOT_PATH` - The directory in which Godot is installed
1. `GODOT_EXECUTABLE` - The executable name of the Godot installation
### More Details
Refer to [GDExtension C++ example](https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html)
## License
Unless otherwise specified, the extension is released under the
[MIT license](LICENSE.txt).
See the full list of third-party libraries with their licenses used by this
extension at [src/thirdparty/README.md](src/thirdparty/README.md).
This implementation heavily borrowed inspiration from the [gif module](https://github.com/goostengine/goost/tree/gd3/modules/gif) for [Goost](https://github.com/goostengine/goost) that is currently only based on Godot 3
+23
View File
@@ -0,0 +1,23 @@
[configuration]
entry_symbol = "godot_gif_library_init"
compatibility_minimum = "4.1"
[libraries]
macos.debug = "bin/godotgif.macos.template_debug.framework/libgodotgif.macos.template_debug"
macos.release = "bin/godotgif.macos.template_release.framework/libgodotgif.macos.template_release"
windows.debug.x86_32 = "bin/godotgif.windows.template_debug.x86_32.dll"
windows.release.x86_32 = "bin/godotgif.windows.template_release.x86_32.dll"
windows.debug.x86_64 = "bin/godotgif.windows.template_debug.x86_64.dll"
windows.release.x86_64 = "bin/godotgif.windows.template_release.x86_64.dll"
linux.debug.x86_64 = "bin/libgodotgif.linux.template_debug.x86_64.so"
linux.release.x86_64 = "bin/libgodotgif.linux.template_release.x86_64.so"
linux.debug.arm64 = "bin/libgodotgif.linux.template_debug.arm64.so"
linux.release.arm64 = "bin/libgodotgif.linux.template_release.arm64.so"
linux.debug.rv64 = "bin/libgodotgif.linux.template_debug.rv64.so"
linux.release.rv64 = "bin/libgodotgif.linux.template_release.rv64.so"
android.debug.x86_64 = "bin/libgodotgif.android.template_debug.x86_64.so"
android.release.x86_64 = "bin/libgodotgif.android.template_release.x86_64.so"
android.debug.arm64 = "bin/libgodotgif.android.template_debug.arm64.so"
android.release.arm64 = "bin/libgodotgif.android.template_release.arm64.so"
+1 -2
View File
@@ -5,8 +5,7 @@ var HzDec = {0:"32 Hz",
2:"320 Hz",
3:"1000 Hz",
4:"3200 Hz",
5:"3200 Hz",
6:"10000 Hz"}
5:"10000 Hz"}
var gainValueLabels:Array = []
var gainValueSlider:Array = []
+46 -8
View File
@@ -18,7 +18,7 @@ extends Control
@onready var yt_link: LineEdit = $"YoutubeMenuHolder/Youtube menu/YTLink"
@onready var yt_download: Button = $"YoutubeMenuHolder/Youtube menu/YTDownload"
@onready var loading_img: Sprite2D = $"YoutubeMenuHolder/Youtube menu/LoadingIMG"
@onready var songs_menu: MenuButton = $SongsMenu
@onready var songs_menu: Button = $SongsMenu
@onready var version: Label = $Version
@onready var paused_indicator: TextureRect = $PausedIndicator
@onready var settings_menu_child: Settings = $SettingsHolder/SettingsPopup/SettingsMenuChild
@@ -28,6 +28,9 @@ extends Control
@onready var play_all: Button = $PlaylistPanelHolder/PlaylistsPanel/PlaylistsContainer/VBoxContainer/HBoxContainer/PlayAll
@onready var album_name: Label = $Album
@onready var playlist_or_song: ConfirmationDialog = $PlaylistOrSong
@onready var search_results: SearchResults = $SearchResults
@onready var delete_confirm: ConfirmationDialog = $deleteConfirm
@onready var search_bar: LineEdit = $SearchBar
@@ -63,6 +66,9 @@ var PlayAllLists:bool
@export var LoopPressed:Texture2D
@export var LoopNotPressed:Texture2D
signal ContinueDelete
var deleteSong:bool
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
get_tree().root.min_size = Vector2(850,492)
@@ -75,7 +81,8 @@ func _ready() -> void:
volume_slider.value_changed.connect(SetVolume)
skip.pressed.connect(Skip)
go_back.pressed.connect(GoBack)
songs_menu.get_popup().index_pressed.connect(SetSong)
search_results.index_pressed.connect(SetSong)
search_results.song_deleted.connect(deletesong)
var Strin:String
for Arg in OS.get_cmdline_args():
if Arg.to_lower().ends_with(".mp3") or Arg.to_lower().ends_with(".wav"):
@@ -190,12 +197,43 @@ func _ready() -> void:
# Always refresh after changing the values!
DiscordRPC.refresh()
func deletesong(idx:int):
var currentDir:String= CurrentDir
currentDir += "/" + textSongs[idx]
delete_confirm.show()
delete_confirm.dialog_text = "are you sure you want to delete \n" + textSongs[idx] +"?"
delete_confirm.confirmed.connect(deleteConfirmed)
delete_confirm.canceled.connect(deleteCancelled)
await ContinueDelete
delete_confirm.canceled.disconnect(deleteCancelled)
delete_confirm.confirmed.disconnect(deleteConfirmed)
if deleteSong:
print("deleted + " + currentDir)
deleteSong = false
var dir = DirAccess.remove_absolute(currentDir)
print("error code " +str(dir) + " (zero is good)")
if dir == 0:
textSongs.remove_at(idx)
if search_bar.visible:
search_bar.updateResults()
else:
songs_menu._pressed()
Playlists[CurrentPlaylist].erase(textSongs[idx])
func deleteCancelled():
deleteSong = false
ContinueDelete.emit()
func deleteConfirmed():
deleteSong = true
ContinueDelete.emit()
func SongDragStopped(Changed:bool):
if Changed:
music_player.play(current_progress.value * CurrentSongLenth / current_progress.max_value)
if Paused:
pausePlay()
UpdateProgressSlider = true
DiscordRPC.start_timestamp = int(Time.get_unix_time_from_system() - (current_progress.value * CurrentSongLenth / current_progress.max_value))
DiscordRPC.refresh()
@@ -357,11 +395,11 @@ func GetSongs(dir:String):
wav_disclaimer.show()
SeenWAVDisclaimer = true
#print(songs)
songs_menu.get_popup().clear(true)
search_results.clear()
textSongs = songs
for song in textSongs:
var nam = song.replace(".mp3", "")
songs_menu.get_popup().add_item(nam)
var nam = song
search_results.add_item(nam)
func Randomize():
if textSongs.size() != 0:
@@ -380,10 +418,10 @@ func Randomize():
Randomized = true
songs_menu.get_popup().clear(true)
search_results.clear()
for song in textSongs:
var nam = song.replace(".mp3", "")
songs_menu.get_popup().add_item(nam)
var nam = song
search_results.add_item(nam)
#print(textSongs)
func PlaylistSelected(Playlist:String,PlaylistLocation:String):
+7 -11
View File
@@ -1,5 +1,5 @@
extends LineEdit
@onready var search_results: PopupMenu = $"../SearchResults"
@onready var search_results: SearchResults = $"../SearchResults"
var values:Dictionary = {}
var ErrorMargin:float = 0.9
@@ -8,8 +8,7 @@ var currentTime:float
var TextChanged:bool
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
search_results.popup_window = false
search_results.unfocusable = true
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
@@ -17,9 +16,12 @@ func _process(delta: float) -> void:
currentTime -= delta
if TextChanged:
if currentTime < 0:
updateResults()
func updateResults():
release_focus()
TextChanged = false
search_results.clear(true)
search_results.clear()
values.clear()
currentTime = updatetime
var _i:int = 0
@@ -41,7 +43,7 @@ func _process(delta: float) -> void:
margin = float(amountOfFrags) / fragments.size()
if margin > ErrorMargin:
search_results.add_item(song.replace(".mp3","") )
search_results.add_item(song)
values[_i] = _s
_i += 1
_s += 1
@@ -51,12 +53,6 @@ func _on_search_results_index_pressed(index: int) -> void:
owner.SetSong(values[index])
func _input(event):
if (event is InputEventMouseButton) and event.pressed:
var evLocal = make_input_local(event)
if !Rect2(Vector2(0,0),Vector2(search_results.size.y+ size.y,size.x)).has_point(evLocal.position):
search_results.hide()
func _on_text_submitted(new_text: String) -> void:
TextChanged = true
if !search_results.visible:
+25
View File
@@ -0,0 +1,25 @@
extends Control
var SongName:String
var CurrentlyPlaying:bool
var idx:int
@onready var songname: Button = $HBoxContainer/Songname
signal PlayPressed
signal DeletePressed
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
songname.text = SongName
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_songname_pressed() -> void:
PlayPressed.emit(idx)
func _on_delete_pressed() -> void:
DeletePressed.emit(idx)
+46
View File
@@ -0,0 +1,46 @@
[gd_scene load_steps=3 format=3 uid="uid://ctqcbjrmxaqsk"]
[ext_resource type="Texture2D" uid="uid://cm5ps3a716wr0" path="res://XSmall.png" id="1_6wgd5"]
[ext_resource type="Script" path="res://search_item.gd" id="1_j4126"]
[node name="SearchItem" type="Control"]
custom_minimum_size = Vector2(0, 30)
layout_mode = 3
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 4
script = ExtResource("1_j4126")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
custom_minimum_size = Vector2(700, 0)
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -19.0
offset_right = 50.0
offset_bottom = 19.0
grow_vertical = 2
[node name="delete" type="Button" parent="HBoxContainer"]
modulate = Color(0.553478, 0.101429, 4.81308e-08, 1)
layout_mode = 2
tooltip_text = "delete song from hard-drive"
focus_mode = 0
icon = ExtResource("1_6wgd5")
flat = true
[node name="Songname" type="Button" parent="HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 0
flat = true
alignment = 0
[connection signal="pressed" from="HBoxContainer/delete" to="." method="_on_delete_pressed"]
[connection signal="pressed" from="HBoxContainer/Songname" to="." method="_on_songname_pressed"]
+48
View File
@@ -0,0 +1,48 @@
class_name SearchResults
extends Control
signal index_pressed
signal song_deleted
const SEARCH_ITEM = preload("res://search_item.tscn")
@onready var item_container: VBoxContainer = $Control/ItemContainer
var SongsAmount:int
@onready var parent:MainScene = owner
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func add_item(text:String):
var child = SEARCH_ITEM.instantiate()
child.SongName = text.replace(".mp3", "")
child.idx = parent.textSongs.find(text)
SongsAmount+=1
child.PlayPressed.connect(songSelected)
child.DeletePressed.connect(deletePressed)
item_container.add_child(child)
func clear():
SongsAmount = 0
for child in item_container.get_children():
child.queue_free()
func songSelected(idx:int):
index_pressed.emit(idx)
func _input(event):
if (event is InputEventMouseButton) and event.pressed:
var evLocal = make_input_local(event)
if !Rect2(Vector2(0,0),Vector2(size.x,size.y)).has_point(evLocal.position):
hide()
func deletePressed(idx:int):
song_deleted.emit(idx)
+42
View File
@@ -0,0 +1,42 @@
[gd_scene load_steps=2 format=3 uid="uid://bel6i6wdbexw4"]
[ext_resource type="Script" path="res://search_results.gd" id="1_mcn1o"]
[node name="SearchResults" type="Control"]
layout_mode = 3
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -311.5
offset_right = 311.5
offset_bottom = 300.0
grow_horizontal = 2
script = ExtResource("1_mcn1o")
[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
color = Color(0.14902, 0.14902, 0.14902, 1)
[node name="Control" type="ScrollContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
follow_focus = true
horizontal_scroll_mode = 0
[node name="ItemContainer" type="VBoxContainer" parent="Control"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
+1 -1
View File
@@ -1,7 +1,7 @@
extends Button
@onready var search_bar: LineEdit = $"../SearchBar"
@onready var songs_menu: MenuButton = $"../SongsMenu"
@onready var songs_menu: Button = $"../SongsMenu"
@export var PressedIcon:Texture2D
@export var NotPressedIcon:Texture2D
+3
View File
@@ -170,7 +170,10 @@ func _on_select_bg_dialog_file_selected(path: String) -> void:
Parent.CurrentCustomBackroundImageDirectory = path
backround_dir_label.text = path
#print(path)
if !path.ends_with(".gif"):
Parent.user_bg.texture = ImageTexture.create_from_image(Image.load_from_file(CurrentBGImagePath))
else:
Parent.user_bg.texture = GifManager.animated_texture_from_file(path)
Parent.SaveEverything()
func _on_reset_bg_pressed() -> void:
+20
View File
@@ -0,0 +1,20 @@
extends Button
@onready var search_results: SearchResults = $"../SearchResults"
@onready var parent:MainScene = owner
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _pressed() -> void:
if search_results.SongsAmount != parent.textSongs.size():
search_results.clear()
for song in parent.textSongs:
var nam = song
search_results.add_item(nam)
search_results.show()
+3 -4
View File
@@ -21,7 +21,7 @@ var updateLink:String
const UPDATE_THROTTLE = 600
func _ready() -> void:
hide()
if CheckForUpdates:
check_for_updates()
@@ -73,8 +73,7 @@ func _on_link_button_pressed() -> void:
elif OS.get_name() == "Linux":
DownloadLink = "https://github.com/notdraimdev/Simplaudio/releases/latest/download/Linux.zip"
if DownloadLink.is_empty() != true:
var error = download_request.request(
DownloadLink
var error = download_request.request(DownloadLink
)
if error != OK:
print("! DOWNLOAD ERROR: " + str(error))
@@ -99,7 +98,7 @@ func _on_download_request_completed(result: int, response_code: int, headers: Pa
unzipper.open(GetLocalPath()+"download.zip")
var files:PackedStringArray = unzipper.get_files()
for file in files:
var actualfile = file.replace("MusicPlayerExports/","")
var actualfile = file.replace("Linux/","").replace("Windows/","").replace("Android/","")
print("FILE: " + actualfile)
var FileAcess:FileAccess = FileAccess.open(GetLocalPath() + actualfile,FileAccess.WRITE_READ)