7 Commits

Author SHA1 Message Date
Sansan 6989b53dda Merge pull request 'Fixed workflow' (#35) from 1.8.0 into main
Build / build (push) Successful in 1m5s
Publish / build (push) Successful in 1m13s
Reviewed-on: #35
2026-05-16 17:50:05 +02:00
Sansan 899e99864f #9 #32 #33 : New winner screen, new setting for hide beginning and fixed bug
Build / build (push) Successful in 1m25s
2026-05-16 17:46:09 +02:00
Sansan 84608c95c2 Fixed workflow
Publish / build (push) Successful in 1m13s
2026-05-15 11:03:20 +02:00
Sansan acd8d65b95 #29 Small fixes
Build / build (push) Successful in 1m6s
Publish / build (push) Failing after 1m16s
2026-05-15 10:52:26 +02:00
Sansan d957c02373 #14 #15 #29 #31 : Added qr, added more settings, added keymap, changed about page.
Build / build (push) Successful in 1m5s
2026-05-14 12:24:50 +02:00
Sansan 0316df2f95 #14,#15,#29,#31: Added qr, added more settings, added keymap, changed about page.
Build / build (push) Successful in 1m10s
2026-05-14 12:18:42 +02:00
Sansan b4ba96cf63 #20 #24 Winnersong can be stopped. Inspirationlist speed can be changed. Some other small fixes
Build / build (push) Successful in 1m36s
2025-12-27 14:05:56 +01:00
40 changed files with 26151 additions and 322 deletions
+6 -8
View File
@@ -9,11 +9,9 @@ on:
branches: [main, develop]
env:
GODOT_VERSION: 4.5
GODOT_VERSION: 4.6
PROJECT_PATH: .
#GAME_VERSION: 0.0.8
#GAME_VERSION: ${{gitea.ref_name}}
EXPORT_NAME: test-project
EXPORT_NAME: MusicPlayer
jobs:
build:
@@ -54,8 +52,8 @@ jobs:
cd $PROJECT_PATH
./godot --headless --verbose --export-release "Linux" "build/$EXPORT_NAME.x86_64"
- name: MacOS Build
run: |
cd $PROJECT_PATH
./godot --headless --verbose --export-release "macOS" "build/$EXPORT_NAME.zip"
# - name: MacOS Build
# run: |
# cd $PROJECT_PATH
# ./godot --headless --verbose --export-release "macOS" "build/$EXPORT_NAME.zip"
+13 -13
View File
@@ -10,7 +10,7 @@ on:
- '*.*'
env:
GODOT_VERSION: 4.5
GODOT_VERSION: 4.6
PROJECT_PATH: .
PROJECT_NAME: MusicPlayer
GAME_VERSION: ${{gitea.ref_name}}
@@ -55,31 +55,31 @@ jobs:
cd $PROJECT_PATH
./godot --headless --verbose --export-release "Linux" "build/$EXPORT_NAME.x86_64"
- name: MacOS Build
run: |
cd $PROJECT_PATH
./godot --headless --verbose --export-release "macOS" "build/$EXPORT_NAME.zip"
# - name: MacOS Build
# run: |
# cd $PROJECT_PATH
# ./godot --headless --verbose --export-release "macOS" "build/$EXPORT_NAME.zip"
- name: Upload Artifact Windows
run: |
#ls -la build
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
--upload-file "build/$EXPORT_NAME.exe" \
https://gitea.sanplex.tech/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$EXPORT_NAME.exe
https://gitea.sanplex.xyz/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$EXPORT_NAME.exe
- name: Upload Artifact Linux
run: |
ls -la build
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
--upload-file "build/$EXPORT_NAME.x86_64" \
https://gitea.sanplex.tech/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$EXPORT_NAME.x86_64
https://gitea.sanplex.xyz/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$EXPORT_NAME.x86_64
- name: Upload Artifact MacOS
run: |
ls -la build
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
--upload-file "build/$EXPORT_NAME.zip" \
https://gitea.sanplex.tech/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$EXPORT_NAME.zip
# - name: Upload Artifact MacOS
# run: |
# ls -la build
# curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
# --upload-file "build/$EXPORT_NAME.zip" \
# https://gitea.sanplex.xyz/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$EXPORT_NAME.zip
- name: Create release
uses: akkuman/gitea-release-action@v1
+70
View File
@@ -0,0 +1,70 @@
extends Control
@onready
var about_panel: Panel = %AboutPanel
@onready
var version_label: Label = %VersionLabel
@onready
var whats_new_label: Label = %WhatsNewLabel
# Changelog as Dictionary with version as key and description as value
const WHATS_NEW: Dictionary = {
"1.8.5": "#9: New winner screen with positions of all players
#32: New setting for how long to hide the beginning
#33: Fixed bug with hiding beginning when song restarts",
"1.8.0": "#14: Updated About page
#15: Create new keymap page
#20: The winner song can now be stopped
#24: The speed of the inspiration list can now be changed
#29: New settings to hide time left and things like that
#31: Added a QR page",
"1.7.0": "#22: Now block add player if player name is empty
#23: Add a log for when points are given to players
#25: Fixed some graphical stuff
#26: Changed so the same character can be on a song multiple times
#27: Turning off statistics after win",
"1.6.1": "#17: Removed Debug text in release
#18: Fixed bug with new character select screen",
"1.6.0": "#1: Fixed bug with inspiration list not reloading after sync
#2: New dialog for sync
#4: Now downloads characters from the server
#5: New character select screen
#6: Now show progress during sync
#7: Blocking all requests to the server during sync
#8: Added functionality to cache more than one song",
"1.5.0": "Made big changes to players and the song list and how the local song list works",
"0.9.0-Beta": "Fixed settings and updated the player view",
"0.8.0-Beta": "Fixed reset buttons and some other small things",
"0.7.8-Beta": "Added shortcuts. Added dialog for winner. Started cleaning code.",
"0.7.5-Beta": "Added settings menu, most things don't do anything yet",
"0.7-Beta": "Can now hop between songs"
}
func _input(event: InputEvent) -> void:
if self.visible == true:
if event is InputEventMouseButton && event.is_pressed():
var evLocal: InputEvent = make_input_local(event)
if !Rect2(Vector2(0, 0), about_panel.size).has_point(evLocal.position):
self.visible = false
func show_window() -> void:
visible = true
version_label.text = Settings.version
# Build changelog text with version headers
var changelog_text: String = ""
for version: String in WHATS_NEW.keys():
changelog_text += "\n" + version + "\n"
changelog_text += WHATS_NEW[version] + "\n"
whats_new_label.text = changelog_text
func hide_window() -> void:
visible = false
+1
View File
@@ -0,0 +1 @@
uid://b7bh0of7olbcb
+63
View File
@@ -0,0 +1,63 @@
[gd_scene format=3 uid="uid://cp54idaudb8dp"]
[ext_resource type="Script" uid="uid://b7bh0of7olbcb" path="res://AboutWindow.gd" id="1_about_script"]
[node name="AboutControl" type="Control" unique_id=1626010355]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_about_script")
[node name="AboutPanel" type="Panel" parent="." unique_id=1907299275]
unique_name_in_owner = true
layout_mode = 0
offset_right = 600.0
offset_bottom = 640.0
[node name="TitleLabel" type="Label" parent="AboutPanel" unique_id=200295721]
texture_filter = 1
layout_mode = 0
offset_right = 600.0
offset_bottom = 50.0
text = "About"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ScrollContainer" type="ScrollContainer" parent="AboutPanel" unique_id=417677913]
layout_mode = 0
offset_left = 10.0
offset_top = 50.0
offset_right = 590.0
offset_bottom = 630.0
[node name="ContentVBox" type="VBoxContainer" parent="AboutPanel/ScrollContainer" unique_id=1746337912]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VersionLabel" type="Label" parent="AboutPanel/ScrollContainer/ContentVBox" unique_id=352884126]
unique_name_in_owner = true
texture_filter = 1
layout_mode = 2
size_flags_horizontal = 3
horizontal_alignment = 1
[node name="DescriptionLabel" type="Label" parent="AboutPanel/ScrollContainer/ContentVBox" unique_id=543094263]
texture_filter = 1
custom_minimum_size = Vector2(560, 0)
layout_mode = 2
size_flags_horizontal = 3
text = "Try your video game music knowledge with this VGM randomizer, invite your friends and see who is the best."
horizontal_alignment = 1
autowrap_mode = 2
[node name="WhatsNewLabel" type="Label" parent="AboutPanel/ScrollContainer/ContentVBox" unique_id=1363040291]
unique_name_in_owner = true
texture_filter = 1
custom_minimum_size = Vector2(560, 0)
layout_mode = 2
size_flags_horizontal = 3
autowrap_mode = 2
+2 -4
View File
@@ -4,8 +4,6 @@ var SCROLL: float = 0
var delay: float = 0.02 #seconds
var wait: float = 0
var SPEED: int = 1
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
wait = delay
@@ -18,13 +16,13 @@ func _process(delta: float) -> void:
#SCROLL DOWN
if SCROLL == 1:
if (scroll_vertical + get_v_scroll_bar().page) < get_v_scroll_bar().max_value:
scroll_vertical += SPEED
scroll_vertical += Settings.inspiration_list_speed
else:
scroll_back_up()
#SCROLL UP
elif SCROLL == -1:
if scroll_vertical != 0:
scroll_vertical -= SPEED
scroll_vertical -= Settings.inspiration_list_speed
else:
scroll_to_bottom()
+43 -45
View File
@@ -61,6 +61,18 @@ var settings_button: Button = $SettingsButton
@onready
var settings_window: Control = $SettingsWindow
@onready
var shortcuts_window: Control = %ShortcutsWindow
@onready
var qr_window: Control = %QRWindow
@onready
var winner_window: Control = %WinnerWindow
@onready
var qr_button: Button = $QRButton
@onready
var statistics_button: Button = $StatisticsButton
@@ -70,11 +82,14 @@ var statistic_popup: PopupPanel = $StatisticsPopupPanel
@onready
var statistic_label: Label = $StatisticsPopupPanel/StatisticsLabel
@onready
var shortcuts_button: Button = $ShortcutsButton
@onready
var about_button: Button = $AboutButton
@onready
var about_popup: PopupPanel = $AboutPopupPanel
var about_window: Control = %AboutWindow
@onready
var show_answer_button: Button = $ShowAnswerButton
@@ -103,27 +118,6 @@ var search_button: Button = $SearchButton
@onready
var search_view: Control= $Search
@onready
var version_label: Label = $AboutPopupPanel/VBoxContainer/VersionLabel
@onready
var whats_new_label: Label = $AboutPopupPanel/VBoxContainer/HBoxContainer/NewLabel
@onready
var shortcut_label: Label = $AboutPopupPanel/VBoxContainer/HBoxContainer/ShortcutsLabel
@onready
var coming_label: Label = $AboutPopupPanel/VBoxContainer/HBoxContainer/CommingLabel
@onready
var winner_popup: PopupPanel = $WinnerPopupPanel
@onready
var winner_label: Label = %WinnerLabel
@onready
var winner_picture: TextureRect = %WinnerPicture
@onready
var auto_repeat_song_button: CheckButton = $RepeatSongCheckButton
@@ -131,7 +125,7 @@ var auto_repeat_song_button: CheckButton = $RepeatSongCheckButton
var music_player_container: PanelContainer = $MusicPlayer
@onready
var log: Control = %Log
var log_window: Control = %Log
@onready
var debug_label: Label = $DebugLabel
@@ -151,9 +145,8 @@ func _ready() -> void:
print("is_debug")
debug_label.visible = true
Settings.is_debug = true
Settings.default_path = "http://localhost:8080"
Settings.selected_server = 3
Settings.winning_score = 5
settings_window.set_winning_score(5)
settings_window.set_selected_server(4)
if is_mac:
print("is_mac")
next_button.pressed.connect(play_next_song)
@@ -162,8 +155,10 @@ func _ready() -> void:
sync_button.pressed.connect(sync_games)
sound_test_button.pressed.connect(music_player_container.get_sound_test_song)
statistics_button.pressed.connect(get_statistics)
shortcuts_button.pressed.connect(show_shortcuts)
about_button.pressed.connect(show_about)
settings_button.pressed.connect(show_settings)
qr_button.pressed.connect(show_qr)
reset_playlist_button.pressed.connect(reset_playlist)
reset_points_button.pressed.connect(reset_points)
@@ -213,8 +208,10 @@ func _input(event: InputEvent) -> void:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
if Settings.fullscreen == false:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
if event.alt_pressed && event.keycode == KEY_K:
shortcuts_window.visible = !shortcuts_window.visible
if event.alt_pressed && event.keycode == KEY_L:
log.visible = !log.visible
log_window.visible = !log_window.visible
func server_updated() -> void:
print("server_updated")
@@ -357,16 +354,20 @@ func reset_points() -> void:
func show_about() -> void:
print("show_about")
about_popup.visible = true
version_label.text = Settings.version
whats_new_label.text = Settings.whats_new
shortcut_label.text = Settings.shortcuts
coming_label.text = Settings.whats_left
about_window.show_window()
func show_shortcuts() -> void:
print("show_shortcuts")
shortcuts_window.visible = true
func show_settings() -> void:
print("show_settings")
settings_window.visible = true
func show_qr() -> void:
print("show_qr")
qr_window.show_window()
func get_statistics() -> void:
print("get_statistics")
statistic_popup.visible = true
@@ -390,6 +391,7 @@ func _on_sync_finished() -> void:
sound_test_button.disabled = false
reset_playlist_button.disabled = false
show_answer_button.disabled = false
reset_points()
func get_suggestion_list() -> void:
print("get_suggestion_list")
@@ -418,7 +420,7 @@ func add_players() -> void:
func add_player() -> void:
print("add_player")
if new_player_name_field.text != "":
if new_player_name_field.text != "" && Settings.player_array.size() < Settings.MAX_NUMBER_OF_PLAYERS:
var new_player_object: PlayerObject = PlayerObject.new(new_player_name_field.text, Settings.player_array.size())
new_player_name_field.text = ""
Settings.player_array.append(new_player_object)
@@ -440,7 +442,7 @@ func load_players() -> void:
var new_player: Player = player.instantiate()
new_player.id = counter
new_player.connect("change_character_clicked", _on_player_change_character_clicked.bind(new_player))
new_player.connect("change_character_clicked", _on_player_change_character_clicked.bind(new_player, player_object.player_name))
new_player.connect("player_removed", _on_player_removed.bind(counter))
player_container.add_child(new_player)
@@ -448,7 +450,7 @@ func load_players() -> void:
func _on_point_given(player_given_point: int) -> void:
print("_on_point_given")
log.add_log_row(Settings.player_array[player_given_point].player_name + " got a point")
log_window.add_log_row(Settings.player_array[player_given_point].player_name + " got a point")
if Playlist.currently_playing_song >= 0:
Playlist.add_point(player_given_point)
update_song_list()
@@ -458,7 +460,7 @@ func _on_make_point_given_sound() -> void:
func _on_point_taken(player_taken_point: int) -> void:
print("_on_point_taken")
log.add_log_row(Settings.player_array[player_taken_point].player_name + " lost a point")
log_window.add_log_row(Settings.player_array[player_taken_point].player_name + " lost a point")
music_player_container.play_sound_effect(preload("res://sounds/itemequip.wav"))
if Playlist.currently_playing_song >= 0:
Playlist.remove_point(player_taken_point)
@@ -466,13 +468,8 @@ func _on_point_taken(player_taken_point: int) -> void:
func _on_player_won(winning_player_id: int) -> void:
print("_on_player_won")
winner_popup.visible = true
winner_label.text = Settings.player_array[winning_player_id].player_name + " won!!"
winner_picture.custom_minimum_size = Vector2(692, 300)
winner_picture.expand_mode = TextureRect.EXPAND_FIT_WIDTH_PROPORTIONAL
winner_picture.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
winner_picture.texture = Settings.player_array[winning_player_id].character
music_player_container.play_sound(preload("res://sounds/winning.mp3"))
winner_window.show_winner(winning_player_id)
music_player_container.play_song(preload("res://sounds/winning.mp3"))
Settings.add_to_stats = false
func _on_player_removed(player_to_remove: int) -> void:
@@ -482,10 +479,11 @@ func _on_player_removed(player_to_remove: int) -> void:
Playlist.remove_player_from_list(player_to_remove)
update_song_list()
func _on_player_change_character_clicked(new_player: Node) -> void:
func _on_player_change_character_clicked(new_player: Player, player_name: String) -> void:
print("_on_player_change_character_clicked")
current_player = new_player
new_character_select.show_grid()
print("Change character for: " + player_name)
new_character_select.show_grid(player_name)
func _on_character_selected(file_name: String) -> void:
print("_on_character_selected")
+113 -155
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=29 format=3 uid="uid://xwq863o6uvsu"]
[gd_scene format=3 uid="uid://xwq863o6uvsu"]
[ext_resource type="Script" uid="uid://b8f4g15cas2j2" path="res://MainWindow.gd" id="1_eu0t5"]
[ext_resource type="PackedScene" uid="uid://b16on0oscg1bv" path="res://CharacterSelect.tscn" id="2_76kf4"]
@@ -11,9 +11,12 @@
[ext_resource type="Theme" uid="uid://rxexo3ur85as" path="res://LightGrayTheme.tres" id="7_wxbv6"]
[ext_resource type="PackedScene" uid="uid://bxydgil1yifps" path="res://SearchWindow.tscn" id="9_5ijvr"]
[ext_resource type="PackedScene" uid="uid://dpdem7pdxweb5" path="res://SyncWindow.tscn" id="10_yxw0b"]
[ext_resource type="Texture2D" uid="uid://r4as0nmtoa7p" path="res://noCharacter.png" id="11_1qef0"]
[ext_resource type="PackedScene" uid="uid://dldpeo5y3l5hq" path="res://SettingsWindow.tscn" id="11_k62u5"]
[ext_resource type="PackedScene" uid="uid://bd1by80q1v27e" path="res://shortcutsWindow.tscn" id="13_8eebo"]
[ext_resource type="PackedScene" uid="uid://bijh5h5yrivm3" path="res://Log.tscn" id="14_26rwn"]
[ext_resource type="PackedScene" uid="uid://btupbowehiyyu" path="res://QRWindow.tscn" id="15_qr_window"]
[ext_resource type="PackedScene" uid="uid://cp54idaudb8dp" path="res://AboutWindow.tscn" id="16_about_window"]
[ext_resource type="PackedScene" uid="uid://cxlsmxnrp0agh" path="res://WinnerWindow.tscn" id="17_winner_window"]
[sub_resource type="LabelSettings" id="LabelSettings_ychxr"]
font_size = 25
@@ -65,20 +68,17 @@ keycode = 83
[sub_resource type="Shortcut" id="Shortcut_fbju4"]
events = [SubResource("InputEventKey_ujjlu")]
[sub_resource type="LabelSettings" id="LabelSettings_hr75l"]
font_size = 35
[node name="Control" type="Control"]
[node name="Control" type="Control" unique_id=407149696]
layout_mode = 3
anchors_preset = 0
script = ExtResource("1_eu0t5")
[node name="TopPanelContainer" type="PanelContainer" parent="."]
[node name="TopPanelContainer" type="PanelContainer" parent="." unique_id=663404711]
layout_mode = 0
offset_right = 1920.0
offset_bottom = 56.0
[node name="Title" type="Label" parent="."]
[node name="Title" type="Label" parent="." unique_id=1187907861]
texture_filter = 1
layout_mode = 0
offset_left = 64.0
@@ -89,7 +89,7 @@ size_flags_horizontal = 0
text = "Music Player Randomizer"
label_settings = SubResource("LabelSettings_ychxr")
[node name="Open" type="Button" parent="."]
[node name="Open" type="Button" parent="." unique_id=165052329]
visible = false
layout_mode = 0
offset_left = 1296.0
@@ -98,7 +98,7 @@ offset_right = 1346.0
offset_bottom = 97.0
text = "Open"
[node name="FileDialog" type="FileDialog" parent="."]
[node name="FileDialog" type="FileDialog" parent="." unique_id=485771559]
title = "Open a Directory"
initial_position = 2
size = Vector2i(616, 400)
@@ -107,7 +107,7 @@ file_mode = 2
access = 2
show_hidden_files = true
[node name="MusicListPanel" type="PanelContainer" parent="."]
[node name="MusicListPanel" type="PanelContainer" parent="." unique_id=2011292375]
layout_mode = 0
offset_left = 64.0
offset_top = 384.0
@@ -115,19 +115,19 @@ offset_right = 1152.0
offset_bottom = 896.0
theme = ExtResource("7_wxbv6")
[node name="ScrollContainer" type="ScrollContainer" parent="MusicListPanel"]
[node name="ScrollContainer" type="ScrollContainer" parent="MusicListPanel" unique_id=707750459]
layout_mode = 2
follow_focus = true
script = ExtResource("7_dj026")
[node name="MusicList" type="VBoxContainer" parent="MusicListPanel/ScrollContainer"]
[node name="MusicList" type="VBoxContainer" parent="MusicListPanel/ScrollContainer" unique_id=373398568]
texture_filter = 1
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/separation = 10
[node name="ScrollContainer" type="ScrollContainer" parent="."]
[node name="ScrollContainer" type="ScrollContainer" parent="." unique_id=498283761]
texture_filter = 1
layout_mode = 0
offset_left = 1216.0
@@ -138,20 +138,20 @@ horizontal_scroll_mode = 0
vertical_scroll_mode = 3
script = ExtResource("2_gxtxm")
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer" unique_id=1215162949]
texture_filter = 1
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="."]
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=42468498]
layout_mode = 0
offset_left = 64.0
offset_top = 64.0
offset_right = 1152.0
offset_bottom = 384.0
[node name="GameLabel" type="Label" parent="VBoxContainer"]
[node name="GameLabel" type="Label" parent="VBoxContainer" unique_id=173147793]
texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
@@ -159,7 +159,7 @@ label_settings = SubResource("LabelSettings_qspbu")
horizontal_alignment = 1
autowrap_mode = 2
[node name="SongLabel" type="Label" parent="VBoxContainer"]
[node name="SongLabel" type="Label" parent="VBoxContainer" unique_id=1687490027]
texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
@@ -167,7 +167,7 @@ label_settings = SubResource("LabelSettings_3m52w")
horizontal_alignment = 1
autowrap_mode = 2
[node name="CharacterSelect" parent="." instance=ExtResource("2_76kf4")]
[node name="CharacterSelect" parent="." unique_id=2079506802 instance=ExtResource("2_76kf4")]
visible = false
top_level = true
layout_mode = 0
@@ -176,7 +176,7 @@ offset_top = 264.0
offset_right = 776.0
offset_bottom = 424.0
[node name="MusicPlayer" parent="." instance=ExtResource("5_emn36")]
[node name="MusicPlayer" parent="." unique_id=1990459832 instance=ExtResource("5_emn36")]
layout_mode = 0
anchors_preset = 0
anchor_left = 0.0
@@ -190,21 +190,21 @@ offset_bottom = 1024.0
grow_horizontal = 1
grow_vertical = 1
[node name="Players" type="PanelContainer" parent="."]
[node name="Players" type="PanelContainer" parent="." unique_id=1708375945]
layout_mode = 0
offset_left = 1216.0
offset_top = 576.0
offset_right = 1857.0
offset_bottom = 977.0
[node name="VBoxContainer" type="VBoxContainer" parent="Players"]
[node name="VBoxContainer" type="VBoxContainer" parent="Players" unique_id=270084211]
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="Players/VBoxContainer"]
[node name="HBoxContainer" type="HBoxContainer" parent="Players/VBoxContainer" unique_id=513047023]
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
[node name="Label" type="Label" parent="Players/VBoxContainer/HBoxContainer"]
[node name="Label" type="Label" parent="Players/VBoxContainer/HBoxContainer" unique_id=1331357386]
texture_filter = 1
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
@@ -214,7 +214,7 @@ text = "Players"
horizontal_alignment = 1
vertical_alignment = 1
[node name="AddPlayersButton" type="TextureButton" parent="Players/VBoxContainer/HBoxContainer"]
[node name="AddPlayersButton" type="TextureButton" parent="Players/VBoxContainer/HBoxContainer" unique_id=634410148]
texture_filter = 1
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
@@ -224,36 +224,36 @@ action_mode = 0
shortcut = SubResource("Shortcut_jafqj")
texture_normal = ExtResource("5_31tjv")
[node name="AddPlayerContainer" type="HBoxContainer" parent="Players/VBoxContainer"]
[node name="AddPlayerContainer" type="HBoxContainer" parent="Players/VBoxContainer" unique_id=1371948739]
visible = false
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
[node name="Panel" type="Panel" parent="Players/VBoxContainer/AddPlayerContainer"]
[node name="Panel" type="Panel" parent="Players/VBoxContainer/AddPlayerContainer" unique_id=1569854056]
layout_mode = 2
size_flags_horizontal = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_qk7sj")
[node name="PlayerNameField" type="TextEdit" parent="Players/VBoxContainer/AddPlayerContainer"]
[node name="PlayerNameField" type="TextEdit" parent="Players/VBoxContainer/AddPlayerContainer" unique_id=332535327]
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
size_flags_horizontal = 3
placeholder_text = "Player name"
script = ExtResource("7_qsdfy")
[node name="AddPlayerButton" type="Button" parent="Players/VBoxContainer/AddPlayerContainer"]
[node name="AddPlayerButton" type="Button" parent="Players/VBoxContainer/AddPlayerContainer" unique_id=245001313]
texture_filter = 1
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
text = "Add"
[node name="Panel2" type="Panel" parent="Players/VBoxContainer/AddPlayerContainer"]
[node name="Panel2" type="Panel" parent="Players/VBoxContainer/AddPlayerContainer" unique_id=60215448]
custom_minimum_size = Vector2(2.08165e-12, 40)
layout_mode = 2
size_flags_horizontal = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_k1ygi")
[node name="ResetPlaylistButton" type="Button" parent="."]
[node name="ResetPlaylistButton" type="Button" parent="." unique_id=1754155620]
texture_filter = 1
layout_mode = 0
offset_left = 1359.0
@@ -264,7 +264,7 @@ focus_mode = 0
action_mode = 0
text = "Reset playlist"
[node name="ResetPointsButton" type="Button" parent="."]
[node name="ResetPointsButton" type="Button" parent="." unique_id=942880776]
texture_filter = 1
layout_mode = 0
offset_left = 1487.0
@@ -275,7 +275,7 @@ focus_mode = 0
action_mode = 0
text = "Reset points"
[node name="SyncButton" type="Button" parent="."]
[node name="SyncButton" type="Button" parent="." unique_id=1228313556]
texture_filter = 1
layout_mode = 0
offset_left = 1615.0
@@ -286,7 +286,7 @@ focus_mode = 0
action_mode = 0
text = "Sync games"
[node name="SoundTestButton" type="Button" parent="."]
[node name="SoundTestButton" type="Button" parent="." unique_id=1332971879]
texture_filter = 1
layout_mode = 0
offset_left = 1743.0
@@ -297,7 +297,7 @@ focus_mode = 0
action_mode = 0
text = "Sound test"
[node name="ShowAnswerButton" type="Button" parent="."]
[node name="ShowAnswerButton" type="Button" parent="." unique_id=415388039]
texture_filter = 1
layout_mode = 0
offset_left = 65.0
@@ -309,7 +309,7 @@ action_mode = 0
shortcut = SubResource("Shortcut_a7fvb")
text = "Show answer"
[node name="NextButton" type="Button" parent="."]
[node name="NextButton" type="Button" parent="." unique_id=1744703488]
texture_filter = 1
layout_mode = 0
offset_left = 193.0
@@ -322,52 +322,74 @@ action_mode = 0
shortcut = SubResource("Shortcut_d6fml")
text = "Randomize new track"
[node name="SearchButton" type="Button" parent="."]
[node name="SearchButton" type="Button" parent="." unique_id=1782453581]
texture_filter = 1
layout_mode = 0
offset_left = 1488.0
offset_left = 1354.0
offset_top = 8.0
offset_right = 1558.0
offset_right = 1424.0
offset_bottom = 48.0
focus_mode = 0
action_mode = 0
shortcut = SubResource("Shortcut_fbju4")
text = "Search"
[node name="SettingsButton" type="Button" parent="."]
[node name="SettingsButton" type="Button" parent="." unique_id=1193400323]
texture_filter = 1
layout_mode = 0
offset_left = 1584.0
offset_left = 1442.0
offset_top = 8.0
offset_right = 1654.0
offset_right = 1512.0
offset_bottom = 48.0
focus_mode = 0
action_mode = 0
text = "Settings"
[node name="StatisticsButton" type="Button" parent="."]
[node name="StatisticsButton" type="Button" parent="." unique_id=2045021269]
texture_filter = 1
layout_mode = 0
offset_left = 1680.0
offset_left = 1530.0
offset_top = 8.0
offset_right = 1758.0
offset_right = 1600.0
offset_bottom = 48.0
focus_mode = 0
action_mode = 0
text = "Statistics"
[node name="AboutButton" type="Button" parent="."]
[node name="ShortcutsButton" type="Button" parent="." unique_id=2066498226]
texture_filter = 1
layout_mode = 0
offset_left = 1784.0
offset_left = 1626.0
offset_top = 8.0
offset_right = 1854.0
offset_right = 1696.0
offset_bottom = 48.0
focus_mode = 0
action_mode = 0
text = "Shortcuts"
[node name="AboutButton" type="Button" parent="." unique_id=1057035253]
texture_filter = 1
layout_mode = 0
offset_left = 1722.0
offset_top = 8.0
offset_right = 1792.0
offset_bottom = 48.0
focus_mode = 0
action_mode = 0
text = "About"
[node name="Search" parent="." instance=ExtResource("9_5ijvr")]
[node name="QRButton" type="Button" parent="." unique_id=2021908559]
texture_filter = 1
layout_mode = 0
offset_left = 1802.0
offset_top = 8.0
offset_right = 1872.0
offset_bottom = 48.0
focus_mode = 0
action_mode = 0
text = "QR"
[node name="Search" parent="." unique_id=1661250375 instance=ExtResource("9_5ijvr")]
visible = false
layout_mode = 1
offset_left = 56.0
@@ -375,7 +397,7 @@ offset_top = 96.0
offset_right = 56.0
offset_bottom = 96.0
[node name="SyncWindow" parent="." instance=ExtResource("10_yxw0b")]
[node name="SyncWindow" parent="." unique_id=182499699 instance=ExtResource("10_yxw0b")]
unique_name_in_owner = true
visible = false
layout_mode = 1
@@ -384,7 +406,7 @@ offset_top = 153.0
offset_right = 401.0
offset_bottom = 153.0
[node name="SettingsWindow" parent="." instance=ExtResource("11_k62u5")]
[node name="SettingsWindow" parent="." unique_id=1323246978 instance=ExtResource("11_k62u5")]
visible = false
layout_mode = 1
offset_left = 720.0
@@ -392,7 +414,16 @@ offset_top = 153.0
offset_right = 720.0
offset_bottom = 153.0
[node name="NewCharacterSelect" parent="." instance=ExtResource("6_dhrvg")]
[node name="QRWindow" parent="." unique_id=589733821 instance=ExtResource("15_qr_window")]
unique_name_in_owner = true
visible = false
layout_mode = 1
offset_left = 720.0
offset_top = 153.0
offset_right = 720.0
offset_bottom = 153.0
[node name="NewCharacterSelect" parent="." unique_id=1679856322 instance=ExtResource("6_dhrvg")]
unique_name_in_owner = true
visible = false
layout_mode = 1
@@ -401,12 +432,21 @@ offset_top = 165.0
offset_right = 1572.0
offset_bottom = 805.0
[node name="StatisticsPopupPanel" type="PopupPanel" parent="."]
[node name="ShortcutsWindow" parent="." unique_id=1513416242 instance=ExtResource("13_8eebo")]
unique_name_in_owner = true
visible = false
layout_mode = 1
offset_left = 562.0
offset_top = 160.0
offset_right = 1262.0
offset_bottom = 860.0
[node name="StatisticsPopupPanel" type="PopupPanel" parent="." unique_id=298311407]
oversampling_override = 1.0
initial_position = 2
size = Vector2i(450, 100)
[node name="Label" type="Label" parent="StatisticsPopupPanel"]
[node name="Label" type="Label" parent="StatisticsPopupPanel" unique_id=548316493]
texture_filter = 1
offset_left = 4.0
offset_top = 4.0
@@ -415,7 +455,7 @@ offset_bottom = 96.0
text = "Statistics"
horizontal_alignment = 1
[node name="StatisticsLabel" type="Label" parent="StatisticsPopupPanel"]
[node name="StatisticsLabel" type="Label" parent="StatisticsPopupPanel" unique_id=58226477]
texture_filter = 1
offset_left = 4.0
offset_top = 4.0
@@ -425,118 +465,36 @@ text = "Total amount of games in the playlist: 9000"
horizontal_alignment = 1
vertical_alignment = 1
[node name="AboutPopupPanel" type="PopupPanel" parent="."]
oversampling_override = 1.0
initial_position = 2
size = Vector2i(848, 710)
[node name="VBoxContainer" type="VBoxContainer" parent="AboutPopupPanel"]
offset_left = 4.0
offset_top = 4.0
offset_right = 844.0
offset_bottom = 706.0
[node name="Label" type="Label" parent="AboutPopupPanel/VBoxContainer"]
texture_filter = 1
layout_mode = 2
text = "Music Player Randomizer"
horizontal_alignment = 1
[node name="VersionLabel" type="Label" parent="AboutPopupPanel/VBoxContainer"]
texture_filter = 1
layout_mode = 2
horizontal_alignment = 1
[node name="AboutLabel" type="Label" parent="AboutPopupPanel/VBoxContainer"]
texture_filter = 1
layout_mode = 2
text = "Try your video game music knowledge with this VGM randomizer, invite your friends and see who is the best."
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="AboutPopupPanel/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
[node name="NewLabel" type="Label" parent="AboutPopupPanel/VBoxContainer/HBoxContainer"]
texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 0
text = "0.7-Beta: Can now hop between songs"
autowrap_mode = 2
[node name="ShortcutsLabel" type="Label" parent="AboutPopupPanel/VBoxContainer/HBoxContainer"]
texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
[node name="CommingLabel" type="Label" parent="AboutPopupPanel/VBoxContainer/HBoxContainer"]
texture_filter = 1
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 0
text = "Fix reset buttons
Fix settings
Fix winner
Fix graphics in lists
Fix layout
Fix for local play
Change some buttons to icons
Add shortcuts"
autowrap_mode = 2
[node name="WinnerPopupPanel" type="PopupPanel" parent="."]
oversampling_override = 1.0
initial_position = 2
size = Vector2i(700, 350)
[node name="Panel" type="Panel" parent="WinnerPopupPanel"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 4.0
offset_top = 4.0
offset_right = 696.0
offset_bottom = 346.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="WinnerPopupPanel/Panel"]
layout_mode = 0
offset_right = 692.0
offset_bottom = 342.0
alignment = 1
[node name="WinnerPicture" type="TextureRect" parent="WinnerPopupPanel/Panel/VBoxContainer"]
[node name="AboutWindow" parent="." unique_id=141261008 instance=ExtResource("16_about_window")]
unique_name_in_owner = true
custom_minimum_size = Vector2(692, 300)
layout_mode = 2
texture = ExtResource("11_1qef0")
expand_mode = 3
stretch_mode = 5
visible = false
layout_mode = 1
offset_left = 720.0
offset_top = 153.0
offset_right = 720.0
offset_bottom = 153.0
[node name="WinnerLabel" type="Label" parent="WinnerPopupPanel/Panel/VBoxContainer"]
[node name="WinnerWindow" parent="." unique_id=999999999 instance=ExtResource("17_winner_window")]
unique_name_in_owner = true
texture_filter = 1
layout_mode = 2
text = "Sansan won!!"
label_settings = SubResource("LabelSettings_hr75l")
horizontal_alignment = 1
vertical_alignment = 2
visible = false
layout_mode = 1
offset_left = 720.0
offset_top = 153.0
offset_right = 720.0
offset_bottom = 153.0
[node name="RepeatSongCheckButton" type="CheckButton" parent="."]
[node name="RepeatSongCheckButton" type="CheckButton" parent="." unique_id=776835053]
layout_mode = 0
offset_left = 64.0
offset_top = 1032.0
offset_right = 208.0
offset_bottom = 1063.0
focus_mode = 0
button_pressed = true
action_mode = 0
text = "Auto repeat"
[node name="DebugLabel" type="Label" parent="."]
[node name="DebugLabel" type="Label" parent="." unique_id=1959221257]
visible = false
layout_mode = 0
offset_left = 974.0
@@ -549,7 +507,7 @@ horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 2
[node name="Log" parent="." instance=ExtResource("14_26rwn")]
[node name="Log" parent="." unique_id=1289881388 instance=ExtResource("14_26rwn")]
unique_name_in_owner = true
visible = false
layout_mode = 1
+30 -7
View File
@@ -55,6 +55,7 @@ func _ready() -> void:
func _process(_delta: float) -> void:
if audio_player.has_stream_playback() && !is_changing && !audio_player.stream_paused:
if (!Settings.hide_beginning || audio_player.get_playback_position() > Settings.hide_for_seconds):
progress_slider.value = audio_player.get_playback_position()
if stream != null:
music_time_label.text = format_text(progress_slider.value, stream.get_length())
@@ -67,6 +68,13 @@ func format_time(time: float) -> String:
return mins + ":" + sec
func format_text(part: float, total: float) -> String:
if (Settings.hide_beginning && part <= Settings.hide_for_seconds) && Settings.hide_length:
return "??:?? / ??:??"
elif Settings.hide_length:
return format_time(part) + " / ??:??"
elif Settings.hide_beginning && part < Settings.hide_for_seconds:
return "??:?? / " + format_time(total)
else:
return format_time(part) + " / " + format_time(total)
func play_or_pause() -> void:
@@ -79,6 +87,9 @@ func play_or_pause() -> void:
audio_player.seek(playback_position)
print("continue")
progress_slider.max_value = round(stream.get_length())
if Settings.hide_ticks:
progress_slider.tick_count = 0
else:
progress_slider.tick_count = round(stream.get_length() / 60)
else:
pause()
@@ -148,20 +159,23 @@ func play_sound(sound_name: AudioStream) -> void:
song_finished = true
play_button.texture_normal = play_icon
progress_slider.value = 0
if stream != null:
music_time_label.text = format_text(progress_slider.value, stream.get_length())
#if stream != null:
# music_time_label.text = format_text(progress_slider.value, stream.get_length())
func play_song(body: PackedByteArray) -> void:
var sound: AudioStream = AudioStreamMP3.new()
sound.data = body
audio_player.stream = sound
func play_song(song: AudioStream) -> void:
audio_player.stream = song
audio_player.play()
sound_player.stop()
song_finished = false
play_button.texture_normal = pause_icon
stream = audio_player.stream
progress_slider.value = 0
progress_slider.max_value = round(stream.get_length())
if Settings.hide_ticks:
progress_slider.tick_count = 0
else:
progress_slider.tick_count = round(stream.get_length() / 60)
music_time_label.text = format_text(progress_slider.value, stream.get_length())
func play_song_object(song_object_no: int) -> void:
print("play_song_object")
@@ -174,8 +188,13 @@ func play_song_object(song_object_no: int) -> void:
song_finished = false
play_button.texture_normal = pause_icon
stream = audio_player.stream
progress_slider.value = 0
progress_slider.max_value = round(stream.get_length())
if Settings.hide_ticks:
progress_slider.tick_count = 0
else:
progress_slider.tick_count = round(stream.get_length() / 60)
music_time_label.text = format_text(progress_slider.value, stream.get_length())
Playlist.set_currently_playing_song(song_object_no)
Playlist.unset_is_playing()
if !Settings.hide_next_track:
@@ -186,7 +205,11 @@ func play_song_object(song_object_no: int) -> void:
update_song_list.emit()
func get_sound_test_song() -> void:
Settings.make_request2("/music/soundTest", play_song, true)
var test_sound: Callable = func test_sound(body: PackedByteArray) -> void:
var sound: AudioStream = AudioStreamMP3.new()
sound.data = body
play_song(sound)
Settings.make_request2("/music/soundTest", test_sound, true)
##### LOCAL
var local_path: String = '/Users/sebastian/ResilioSync/Sorterat_test/Metal Gear Solid 4 - Guns of the Patriots/2-16 Metal Gear Saga.mp3'
+41
View File
@@ -0,0 +1,41 @@
extends Control
@onready
var qr_panel: Panel = $QRPanel
@onready
var qr_code_rect: QRCodeRect = $QRPanel/QRCodeRect
@onready
var url_label: Label = $QRPanel/URLLabel
func _ready() -> void:
qr_code_rect.light_module_color = Color.WHITE
qr_code_rect.dark_module_color = Color.BLACK
qr_code_rect.quiet_zone_size = 4
# Generate QR code for the search URL
var url: String = Settings.default_path + "/search"
qr_code_rect.data = url
url_label.text = qr_code_rect.data
print("QR code generated for: ", url)
func show_window() -> void:
visible = true
# Regenerate QR code in case settings changed
var url: String = Settings.default_path + "/search"
qr_code_rect.data = url
url_label.text = qr_code_rect.data
func _input(event: InputEvent) -> void:
if self.visible == true:
if event is InputEventMouseButton && event.is_pressed():
var evLocal: InputEvent = make_input_local(event)
if !Rect2(Vector2(0, 0), qr_panel.size).has_point(evLocal.position):
self.visible = false
func hide_window() -> void:
visible = false
+1
View File
@@ -0,0 +1 @@
uid://bsa6xg5xos6h7
+52
View File
@@ -0,0 +1,52 @@
[gd_scene format=3 uid="uid://btupbowehiyyu"]
[ext_resource type="Script" uid="uid://bsa6xg5xos6h7" path="res://QRWindow.gd" id="1_qr_script"]
[ext_resource type="Script" uid="uid://dynulhnyq5hpq" path="res://addons/kenyoni/qr_code/qr_code_rect.gd" id="2_jpsxt"]
[node name="QRControl" type="Control" unique_id=1996957585]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_qr_script")
[node name="QRPanel" type="Panel" parent="." unique_id=1021365843]
unique_name_in_owner = true
layout_mode = 0
offset_right = 450.0
offset_bottom = 520.0
[node name="QRCodeRect" type="TextureRect" parent="QRPanel" unique_id=1054378438]
layout_mode = 0
offset_left = 20.0
offset_top = 20.0
offset_right = 430.0
offset_bottom = 430.0
script = ExtResource("2_jpsxt")
auto_update = true
mode = 4
error_correction = 3
use_eci = true
eci_value = 26
data = ""
auto_version = true
auto_mask_pattern = true
light_module_color = Color(1, 1, 1, 1)
dark_module_color = Color(0, 0, 0, 1)
auto_module_size = false
module_size = 8
quiet_zone_size = 4
metadata/_custom_type_script = "uid://dynulhnyq5hpq"
[node name="URLLabel" type="Label" parent="QRPanel" unique_id=230761497]
unique_name_in_owner = true
layout_mode = 0
offset_left = 20.0
offset_top = 450.0
offset_right = 430.0
offset_bottom = 490.0
text = "URL"
horizontal_alignment = 1
vertical_alignment = 1
+10 -50
View File
@@ -1,74 +1,34 @@
extends Node
var default_path: String = "https://music.sanplex.tech"
const MAX_NUMBER_OF_PLAYERS: int = 7
var default_path: String = "https://music.sanplex.xyz"
var selected_server: int = 0
#var default_path: String = "https://tmusic.sanplex.tech"
#var selected_server: int = 1
var is_local: bool = false
var is_debug: bool = false
var stop_after_current: bool = true
var auto_repeat_song: bool = false
var auto_repeat_song: bool = true
var hide_next_track: bool = true
var add_to_stats: bool = true
var use_low_played_mode: bool = false
var winning_score: int = 20
var fullscreen: bool = false
var play_local: bool = false
var inspiration_list_speed: int = 1
var hide_for_seconds: float = 5.0
var hide_beginning: bool = false
var hide_length: bool = false
var hide_ticks: bool = false
var player_array: Array[PlayerObject]
var edit_players: bool = false
var currently_syncing: bool = false
var character_select_open: bool = false
var version: String = "1.7.0"
var whats_new: String = "Changelog:
1.7.0:
#22: Now block add player if player name is empty
#23: Add a log for when points are given to players
#25: Fixed some graphical stuff
#26: Changed so the same character can be on a song multiple times
#27: Turning off statistics after win
1.6.1:
#17: Removed Debug text in release
#18: Fixed bug with new character select screen
1.6.0:
#1: Fixed bug with inspiration list not reloading after sync
#2: New dialog for sync
#4: Now downloads characters from the server
#5: New character select screen
#6: Now show progress during sync
#7: Blocking all requests to the server during sync
#8: Added functionality to cache more than one song
1.5.0: Made big changes to players and the song list and how the local song list works
0.9.0-Beta: Fixed settings and updated the player view
0.8.0-Beta: Fixed reset buttons and some other small things
0.7.8-Beta: Added shortcuts. Added dialog for winner. Started cleaning code.
0.7.5-Beta: Added settings menu, most things don't do anything yet
0.7-Beta: Can now hop between songs"
var whats_left: String = "Things left to do:
Fix layout
Fix for local play"
var shortcuts: String = "Shortcuts:
Alt + S = Search
Alt + A = Add Players
Alt + Z = Reset
Alt + X = Play/Pause
Alt + C = Next Song
Alt + V = Show Answer
Alt + Enter = Fullscreen
Alt + UP = Volume up
Alt + DOWN = Volume down
Alt + LEFT = Jump back in song
Alt + Ctrl = Restart song
Alt + RIGHT = Jump forward in song
Alt + 1, 2, 3, 4, 5, 6 = Give player point
Alt + Ctrl + 1, 2, 3, 4, 5, 6 = Take point from player"
var version: String = "1.8.5"
func make_request2(address: String, func_name: Callable, expect_data: bool) -> void:
var error_handling: Callable = func(_result: int, response_code: int, _headers: PackedStringArray, body: PackedByteArray) -> void:
+92 -3
View File
@@ -15,6 +15,15 @@ var add_to_database_button: CheckButton = %AddToDatabaseCheckButton
@onready
var low_played_button: CheckButton = %LowPlayedCheckButton
@onready
var hide_beginning_button: CheckButton = %HideBeginningCheckButton
@onready
var hide_length_button: CheckButton = %HideLengthCheckButton
@onready
var hide_ticks_button: CheckButton = %HideTicksCheckButton
@onready
var score_label: Label = %ScoreLabel
@@ -33,15 +42,30 @@ var lower_cache_button: Button = %LowerCacheButton
@onready
var increase_cache_button: Button = %IncreaseCacheButton
@onready
var inspiration_speed_label: Label = %InspirationListSpeedLabel
@onready
var lower_inspiration_speed_button: Button = %LowerInspirationSpeedButton
@onready
var increase_inspiration_speed_button: Button = %IncreaseInspirationSpeedButton
@onready
var hide_for_seconds_label: Label = %HideForSecondsLabel
@onready
var lower_hide_for_seconds_button: Button = %LowerHideForSecondsButton
@onready
var increase_hide_for_seconds_button: Button = %IncreaseHideForSecondsButton
@onready
var select_server_button: OptionButton = %SelectServerButton
@onready
var fullscreen_button: CheckButton = %FullscreenButton
#@onready
#var quick_sync_button := $QuickSyncButton
@onready
var local_button: CheckButton = %LocalButton
@@ -56,10 +80,17 @@ func _ready() -> void:
hide_next_track_button.pressed.connect(hide_next_track)
add_to_database_button.pressed.connect(add_to_database)
low_played_button.pressed.connect(low_played)
hide_beginning_button.pressed.connect(hide_beginning)
hide_length_button.pressed.connect(hide_length)
hide_ticks_button.pressed.connect(hide_ticks)
lower_winning_score_button.pressed.connect(lower_winning_score)
increase_winning_score_button.pressed.connect(increase_winning_score)
lower_cache_button.pressed.connect(lower_cache)
increase_cache_button.pressed.connect(increase_cache)
lower_inspiration_speed_button.pressed.connect(lower_inspiration_speed)
increase_inspiration_speed_button.pressed.connect(increase_inspiration_speed)
lower_hide_for_seconds_button.pressed.connect(lower_hide_for_seconds)
increase_hide_for_seconds_button.pressed.connect(increase_hide_for_seconds)
fullscreen_button.pressed.connect(fullscreen)
local_button.pressed.connect(local_play)
@@ -67,9 +98,15 @@ func _ready() -> void:
hide_next_track_button.button_pressed = Settings.hide_next_track
add_to_database_button.button_pressed = Settings.add_to_stats
low_played_button.button_pressed = Settings.use_low_played_mode
hide_beginning_button.button_pressed = Settings.hide_beginning
hide_length_button.button_pressed = Settings.hide_length
hide_ticks_button.button_pressed = Settings.hide_ticks
score_label.text = str(Settings.winning_score)
cache_label.text = str(Playlist.number_of_tracks_to_preload)
inspiration_speed_label.text = str(Settings.inspiration_list_speed)
hide_for_seconds_label.text = str(Settings.hide_for_seconds)
fullscreen_button.button_pressed = Settings.fullscreen
update_hide_for_seconds_enabled()
select_server_button.select(Settings.selected_server)
select_server_button.item_selected.connect(select_server)
@@ -102,6 +139,20 @@ func add_to_database() -> void:
func low_played() -> void:
Settings.use_low_played_mode = !Settings.use_low_played_mode
func hide_beginning() -> void:
Settings.hide_beginning = !Settings.hide_beginning
update_hide_for_seconds_enabled()
func update_hide_for_seconds_enabled() -> void:
var enabled: bool = Settings.hide_beginning
%HideForSecondsHBoxContainer.visible = enabled
func hide_length() -> void:
Settings.hide_length = !Settings.hide_length
func hide_ticks() -> void:
Settings.hide_ticks = !Settings.hide_ticks
func lower_winning_score() -> void:
Settings.winning_score -= 1
score_label.text = str(Settings.winning_score)
@@ -110,6 +161,10 @@ func increase_winning_score() -> void:
Settings.winning_score += 1
score_label.text = str(Settings.winning_score)
func set_winning_score(new_score: int) -> void:
Settings.winning_score = new_score
score_label.text = str(Settings.winning_score)
func lower_cache() -> void:
Playlist.number_of_tracks_to_preload -= 1
if Playlist.number_of_tracks_to_preload < 1:
@@ -120,7 +175,41 @@ func increase_cache() -> void:
Playlist.number_of_tracks_to_preload += 1
cache_label.text = str(Playlist.number_of_tracks_to_preload)
func lower_inspiration_speed() -> void:
Settings.inspiration_list_speed -= 1
if Settings.inspiration_list_speed < 1:
Settings.inspiration_list_speed = 1
inspiration_speed_label.text = str(Settings.inspiration_list_speed)
func increase_inspiration_speed() -> void:
Settings.inspiration_list_speed += 1
inspiration_speed_label.text = str(Settings.inspiration_list_speed )
func lower_hide_for_seconds() -> void:
Settings.hide_for_seconds -= 1.0
if Settings.hide_for_seconds < 0:
Settings.hide_for_seconds = 0
hide_for_seconds_label.text = str(Settings.hide_for_seconds)
func increase_hide_for_seconds() -> void:
Settings.hide_for_seconds += 1.0
if Settings.hide_for_seconds > 10.0:
Settings.hide_for_seconds = 10.0
hide_for_seconds_label.text = str(Settings.hide_for_seconds)
func select_server(new_server: int) -> void:
print("select_server")
Settings.default_path = select_server_button.get_item_text(new_server)
Settings.selected_server = new_server
print("Settings.default_path: " + Settings.default_path)
print("Settings.selected_server: " + str(Settings.selected_server))
print("new_server: " + str(new_server))
print("select_server_button.get_item_text(new_server): " + select_server_button.get_item_text(new_server))
server_changed.emit()
func set_selected_server(new_server: int) -> void:
print("set_selected_server")
select_server_button.select(new_server)
Settings.default_path = select_server_button.get_item_text(new_server)
Settings.selected_server = new_server
print("Settings.default_path: " + Settings.default_path)
+107 -28
View File
@@ -1,11 +1,11 @@
[gd_scene load_steps=3 format=3 uid="uid://dldpeo5y3l5hq"]
[gd_scene format=3 uid="uid://dldpeo5y3l5hq"]
[ext_resource type="Script" uid="uid://dukqyjoduf1af" path="res://SettingsWindow.gd" id="1_bt55j"]
[sub_resource type="LabelSettings" id="LabelSettings_3xrlm"]
font_size = 25
[node name="SettingsControl" type="Control"]
[node name="SettingsControl" type="Control" unique_id=1298840328]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@@ -14,30 +14,30 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_bt55j")
[node name="SettingsPanel" type="Panel" parent="."]
[node name="SettingsPanel" type="Panel" parent="." unique_id=45537159]
unique_name_in_owner = true
layout_mode = 0
offset_right = 500.0
offset_bottom = 640.0
[node name="ScrollContainer" type="ScrollContainer" parent="SettingsPanel"]
[node name="ScrollContainer" type="ScrollContainer" parent="SettingsPanel" unique_id=1325795358]
layout_mode = 0
offset_right = 500.0
offset_bottom = 640.0
[node name="VBoxContainer" type="VBoxContainer" parent="SettingsPanel/ScrollContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="SettingsPanel/ScrollContainer" unique_id=1796635163]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
[node name="Label" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="Label" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=1111531402]
layout_mode = 2
size_flags_vertical = 0
text = "Settings"
label_settings = SubResource("LabelSettings_3xrlm")
horizontal_alignment = 1
[node name="StopAfterCurrentCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="StopAfterCurrentCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=508305575]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
@@ -45,7 +45,7 @@ button_pressed = true
action_mode = 0
text = "Stop after current"
[node name="HideNextTrackCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="HideNextTrackCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=1568244599]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
@@ -53,33 +53,84 @@ button_pressed = true
action_mode = 0
text = "Hide next track"
[node name="AddToDatabaseCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="AddToDatabaseCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=1673750542]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
action_mode = 0
text = "Turn on played to database"
[node name="LowPlayedCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="LowPlayedCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=1672657048]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
action_mode = 0
text = "Use low played mode"
[node name="HBoxContainer" type="HBoxContainer" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="HideBeginningCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=1370617867]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
action_mode = 0
text = "Hide beginning of songs"
[node name="HideForSecondsHBoxContainer" type="HBoxContainer" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=1368485120]
unique_name_in_owner = true
layout_mode = 2
[node name="Label2" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/HBoxContainer"]
[node name="HideForSecondsTitle" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/HideForSecondsHBoxContainer" unique_id=1822369383]
unique_name_in_owner = true
layout_mode = 2
text = "Hide Start Seconds: "
[node name="HideForSecondsLabel" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/HideForSecondsHBoxContainer" unique_id=1580108945]
unique_name_in_owner = true
layout_mode = 2
text = "5.0"
[node name="LowerHideForSecondsButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/HideForSecondsHBoxContainer" unique_id=180643442]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
focus_mode = 0
action_mode = 0
text = "-1"
[node name="IncreaseHideForSecondsButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/HideForSecondsHBoxContainer" unique_id=340681770]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
focus_mode = 0
action_mode = 0
text = "+1"
[node name="HideLengthCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=67806372]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
action_mode = 0
text = "Hide length of songs"
[node name="HideTicksCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=706322752]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
action_mode = 0
text = "Hide ticks in playbar"
[node name="HBoxContainer" type="HBoxContainer" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=2140610992]
layout_mode = 2
[node name="Label2" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/HBoxContainer" unique_id=1892907487]
layout_mode = 2
text = "Winning Score: "
[node name="ScoreLabel" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/HBoxContainer"]
[node name="ScoreLabel" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/HBoxContainer" unique_id=444542662]
unique_name_in_owner = true
layout_mode = 2
text = "20"
[node name="LowerButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/HBoxContainer"]
[node name="LowerButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/HBoxContainer" unique_id=614806355]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
@@ -87,7 +138,7 @@ focus_mode = 0
action_mode = 0
text = "-1"
[node name="IncreaseButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/HBoxContainer"]
[node name="IncreaseButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/HBoxContainer" unique_id=1837169457]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
@@ -95,19 +146,19 @@ focus_mode = 0
action_mode = 0
text = "+1"
[node name="CacheHBoxContainer" type="HBoxContainer" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="CacheHBoxContainer" type="HBoxContainer" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=658210492]
layout_mode = 2
[node name="CacheTitleLabel" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/CacheHBoxContainer"]
[node name="CacheTitleLabel" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/CacheHBoxContainer" unique_id=365012193]
layout_mode = 2
text = "Predownload songs: "
[node name="CacheLabel" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/CacheHBoxContainer"]
[node name="CacheLabel" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/CacheHBoxContainer" unique_id=1558370172]
unique_name_in_owner = true
layout_mode = 2
text = "1"
[node name="LowerCacheButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/CacheHBoxContainer"]
[node name="LowerCacheButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/CacheHBoxContainer" unique_id=1990385038]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
@@ -115,7 +166,7 @@ focus_mode = 0
action_mode = 0
text = "-1"
[node name="IncreaseCacheButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/CacheHBoxContainer"]
[node name="IncreaseCacheButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/CacheHBoxContainer" unique_id=1806295533]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
@@ -123,29 +174,57 @@ focus_mode = 0
action_mode = 0
text = "+1"
[node name="SelectServerButton" type="OptionButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="InspirationHBoxContainer" type="HBoxContainer" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=1686756540]
layout_mode = 2
[node name="InspirationListSpeedTitle" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/InspirationHBoxContainer" unique_id=1397861506]
layout_mode = 2
text = "Inspiration List Speed: "
[node name="InspirationListSpeedLabel" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer/InspirationHBoxContainer" unique_id=867387668]
unique_name_in_owner = true
layout_mode = 2
text = "1"
[node name="LowerInspirationSpeedButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/InspirationHBoxContainer" unique_id=845209534]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
focus_mode = 0
action_mode = 0
text = "-1"
[node name="IncreaseInspirationSpeedButton" type="Button" parent="SettingsPanel/ScrollContainer/VBoxContainer/InspirationHBoxContainer" unique_id=1122701153]
unique_name_in_owner = true
custom_minimum_size = Vector2(30, 2.08165e-12)
layout_mode = 2
focus_mode = 0
action_mode = 0
text = "+1"
[node name="SelectServerButton" type="OptionButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=434350694]
unique_name_in_owner = true
layout_mode = 2
selected = 0
item_count = 5
popup/item_0/text = "https://music.sanplex.tech"
popup/item_0/text = "https://music.sanplex.xyz"
popup/item_0/id = 1
popup/item_1/text = "https://tmusic.sanplex.tech"
popup/item_1/text = "https://tmusic.sanplex.xyz"
popup/item_1/id = 2
popup/item_2/text = "https://rmusic.sanplex.tech"
popup/item_2/text = "https://rmusic.sanplex.xyz"
popup/item_2/id = 3
popup/item_3/text = "https://old-music.sanplex.tech"
popup/item_3/text = "https://old-music.sanplex.xyz"
popup/item_3/id = 4
popup/item_4/text = "http://localhost:8080"
popup/item_4/id = 5
[node name="FullscreenButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="FullscreenButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=400304684]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
text = "Fullscreen"
[node name="QuickSyncButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="QuickSyncButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=49497448]
visible = false
layout_mode = 2
size_flags_horizontal = 0
@@ -153,7 +232,7 @@ button_pressed = true
action_mode = 0
text = "Quick sync"
[node name="LocalButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer"]
[node name="LocalButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=905844805]
unique_name_in_owner = true
visible = false
layout_mode = 2
+54
View File
@@ -0,0 +1,54 @@
[gd_scene format=3 uid="uid://cxlsmxnrp0agh"]
[ext_resource type="Script" uid="uid://dxpb22xbwf3t1" path="res://winner_window.gd" id="1_winner_script"]
[ext_resource type="Texture2D" uid="uid://r4as0nmtoa7p" path="res://noCharacter.png" id="2_no_character"]
[sub_resource type="LabelSettings" id="LabelSettings_hr75l"]
font_size = 35
[node name="WinnerControl" type="Control" unique_id=1111111111]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_winner_script")
[node name="WinnerPanel" type="Panel" parent="." unique_id=89212869]
unique_name_in_owner = true
layout_mode = 0
offset_right = 500.0
offset_bottom = 600.0
[node name="VBoxContainer" type="VBoxContainer" parent="WinnerPanel" unique_id=471159349]
layout_mode = 0
offset_top = 25.0
offset_right = 500.0
offset_bottom = 282.0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="WinnerPicture" type="TextureRect" parent="WinnerPanel/VBoxContainer" unique_id=1543774067]
unique_name_in_owner = true
custom_minimum_size = Vector2(480, 200)
layout_mode = 2
texture = ExtResource("2_no_character")
expand_mode = 3
stretch_mode = 5
[node name="WinnerLabel" type="Label" parent="WinnerPanel/VBoxContainer" unique_id=1437597286]
unique_name_in_owner = true
texture_filter = 1
layout_mode = 2
text = "Winner!"
label_settings = SubResource("LabelSettings_hr75l")
horizontal_alignment = 1
vertical_alignment = 2
[node name="PlayersList" type="VBoxContainer" parent="WinnerPanel/VBoxContainer" unique_id=471159350]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
+7
View File
@@ -0,0 +1,7 @@
Copyright 2022-present Iceflower S (iceflower@gmx.de)
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.
+75
View File
@@ -0,0 +1,75 @@
extends RefCounted
var _data: PackedByteArray = []
func duplicate():
var dup = new()
dup._data = self._data.duplicate()
return dup
func resize(size: int) -> void:
self._data.resize(size)
func size() -> int:
return self._data.size()
func clear() -> void:
return self._data.clear()
func get_array() -> PackedByteArray:
return self._data
func to_byte_array() -> PackedByteArray:
var byte_arr: PackedByteArray = []
var cur_byte: int = 0
for idx: int in range(self._data.size()):
var byte_idx: int = 7 - idx & 7
if self._data[idx]:
cur_byte |= (1 << byte_idx)
if (idx != 0 && byte_idx == 0) || idx == self._data.size() - 1:
byte_arr.append(cur_byte)
cur_byte = 0
return byte_arr
func prepend_bit(bit: bool) -> void:
self._data.insert(0, int(bit))
func append_bit(bit: bool) -> void:
self._data.append(int(bit))
func append_stream(stream) -> void:
self._data.append_array(stream.get_array())
func append_byte_array(arr: PackedByteArray) -> void:
for val: int in arr:
self.append(val, 8)
func prepend(value: int, total_bits: int) -> void:
for idx: int in range(total_bits - 1, -1, -1):
self._data.insert(0, int((value & (1 << idx)) != 0))
func append(value: int, total_bits: int) -> void:
for idx: int in range(total_bits - 1, -1, -1):
self._data.append(int((value & (1 << idx)) != 0))
func set_bit(idx: int, bit: bool) -> void:
self._data[idx] = int(bit)
func get_bit(idx: int) -> bool:
return bool(self._data[idx])
func _to_string() -> String:
var val: String = ""
for idx: int in range(self._data.size()):
if (idx + 1) & 7 == 1:
val += "["
val += str(self._data[idx])
if (idx + 1) & 7 == 0:
val += "]"
if (idx + 1) & 3 == 0:
val += " "
val = val.strip_edges()
if val[-1] != "]":
val += "]"
return val
+1
View File
@@ -0,0 +1 @@
uid://dyt1tls86b518
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="16"
height="16"
version="1.1"
viewBox="0 0 16 16"
id="svg4"
xmlns="http://www.w3.org/2000/svg"
>
<defs
id="defs4" />
<path
id="rect4"
style="fill:#8eef97;fill-opacity:1;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
d="M 0,0 V 6 H 6 V 0 Z M 1,1 H 5 V 5 H 1 Z" />
<path
id="rect4-4-4"
style="fill:#8eef97;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
transform="rotate(90)"
d="m 2,-4 h 2 v 2 H 2 Z" />
<path
id="rect4-9"
style="fill:#8eef97;fill-opacity:1;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
d="m 10,0 v 6 h 6 V 0 Z m 1,1 h 4 v 4 h -4 z" />
<path
id="rect4-4-4-7"
style="fill:#8eef97;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
transform="rotate(90)"
d="m 2,-14 h 2 v 2 H 2 Z" />
<path
id="rect4-90"
style="fill:#8eef97;fill-opacity:1;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
d="m 0,10 v 6 h 6 v -6 z m 1,1 h 4 v 4 H 1 Z" />
<path
id="rect4-4-4-8"
style="fill:#8eef97;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
transform="rotate(90)"
d="m 12,-4 h 2 v 2 h -2 z" />
<path
id="rect5"
style="fill:#8eef97;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
d="m 10,12 h 2 v 2 h -2 z" />
<path
id="rect5-31"
style="fill:#8eef97;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
d="m 14,8 h 2 v 2 h -2 z" />
<path
id="rect5-3"
style="fill:#8eef97;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
d="m 8,14 h 2 v 2 H 8 Z" />
<path
id="rect5-0"
style="fill:#8eef97;fill-opacity:1;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
d="m 14,12 v 2 h -2 v 2 h 4 v -4 z" />
<path
id="rect5-0-2-7"
style="fill:#8eef97;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
d="m 12,10 h 2 v 2 h -2 z" />
<path
id="rect5-5"
style="fill:#8eef97;fill-opacity:1;fill-rule:evenodd;stroke-width:32;paint-order:fill markers stroke"
d="m 8,8 v 4 h 2 v -2 h 2 V 8 Z" />
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+43
View File
@@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cn383mw8drmm5"
path="res://.godot/imported/icon.svg-f2b8283af99fea807d6be2c96605b944.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/kenyoni/qr_code/icon.svg"
dest_files=["res://.godot/imported/icon.svg-f2b8283af99fea807d6be2c96605b944.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
+20
View File
@@ -0,0 +1,20 @@
[plugin]
name="QR Code"
description="QR Code generator."
author="Kenyoni Software"
version="2.0.0"
script="plugin.gd"
license="MIT"
repository="https://github.com/kenyoni-software/godot-addons"
keywords=[
"node",
"tool"
]
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License"
]
[plugin.dependencies]
godot=">=4.4"
+10
View File
@@ -0,0 +1,10 @@
@tool
extends EditorPlugin
const QrCodeRect := preload("res://addons/kenyoni/qr_code/qr_code_rect.gd")
func _enter_tree() -> void:
self.add_custom_type("QRCodeRect", "TextureRect", QrCodeRect, preload("res://addons/kenyoni/qr_code/icon.svg"))
func _exit_tree() -> void:
self.remove_custom_type("QRCodeRect")
+1
View File
@@ -0,0 +1 @@
uid://bepdve2jn8q0i
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
uid://c7aw4f3o7g8sc
+415
View File
@@ -0,0 +1,415 @@
@tool
@icon("res://addons/kenyoni/qr_code/icon.svg")
extends TextureRect
class_name QRCodeRect
const QRCode := preload("res://addons/kenyoni/qr_code/qr_code.gd")
const ShiftJIS := preload("res://addons/kenyoni/qr_code/shift_jis.gd")
var mode: QRCode.Mode:
set = set_mode,
get = get_mode
var error_correction: QRCode.ErrorCorrection:
set = set_error_correction,
get = get_error_correction
## Use Extended Channel Interpretation (ECI).
var use_eci: bool:
set = set_use_eci,
get = get_use_eci
## Extended Channel Interpretation (ECI) Value.
var eci_value: int:
set = set_eci_value,
get = get_eci_value
var data: Variant = "":
set = set_data,
get = get_data
## Automatically update the QR Code when a property changes.
var auto_update: bool = true:
set = set_auto_update
## Use automatically the smallest version possible.
var auto_version: bool = true:
set = set_auto_version,
get = get_auto_version
var version: int = 1:
set = set_version,
get = get_version
## Use automatically the best mask pattern.
var auto_mask_pattern: bool = true:
set = set_auto_mask_pattern,
get = get_auto_mask_pattern
## Used mask pattern.
var mask_pattern: int = 0:
set = set_mask_pattern,
get = get_mask_pattern
var light_module_color: Color = Color.WHITE:
set = set_light_module_color
var dark_module_color: Color = Color.BLACK:
set = set_dark_module_color
## Automatically set the module pixel size based on the size.
## Do not use expand mode KEEP_SIZE when using it.
## Turn this off when the QR Code is resized often, as it impacts the performance quite heavily.
var auto_module_size: bool = true:
set = set_auto_module_size
## Use that many pixel for one module.
## If auto_module_size is set, this value might by only occasionally updated. In this case do not rely on it.
var module_size: int = 1:
set = set_module_size
## Use that many modules for the quiet zone. A value of 4 is recommended.
var quiet_zone_size: int = 4:
set = set_quiet_zone_size
var _qr: QRCode = QRCode.new()
var _update_fn: Callable = self.update
var _cached_data: PackedByteArray = PackedByteArray()
func set_mode(new_mode: QRCode.Mode) -> void:
self._qr.mode = new_mode
self.notify_property_list_changed()
if self.auto_update:
self.update()
func get_mode() -> QRCode.Mode:
return self._qr.mode
func set_error_correction(new_error_correction: QRCode.ErrorCorrection) -> void:
self._qr.error_correction = new_error_correction
if self.auto_update:
self.update()
func get_error_correction() -> QRCode.ErrorCorrection:
return self._qr.error_correction
func set_use_eci(new_use_eci: bool) -> void:
self._qr.use_eci = new_use_eci
self.notify_property_list_changed()
if self.auto_update:
self.update()
func get_use_eci() -> bool:
return self._qr.use_eci
func set_eci_value(new_eci_value: int) -> void:
if self._qr.eci_value == new_eci_value:
return
self._qr.eci_value = new_eci_value
self.notify_property_list_changed()
if self.auto_update:
self.update()
func get_eci_value() -> int:
return self._qr.eci_value
func set_data(new_data: Variant) -> void:
match self._qr.mode:
QRCode.Mode.NUMERIC:
self._qr.put_numeric(new_data)
QRCode.Mode.ALPHANUMERIC:
self._qr.put_alphanumeric(new_data)
QRCode.Mode.BYTE:
if typeof(new_data) == TYPE_PACKED_BYTE_ARRAY || ! self.use_eci:
self._qr.put_byte(new_data)
return
match self.eci_value:
QRCode.ECI.ISO_8859_1:
self._qr.put_byte(new_data.to_ascii_buffer())
QRCode.ECI.SHIFT_JIS:
self._qr.put_byte(ShiftJIS.to_shift_jis_2004_buffer(new_data))
QRCode.ECI.UTF_8:
self._qr.put_byte(new_data.to_utf8_buffer())
QRCode.ECI.UTF_16:
self._qr.put_byte(new_data.to_utf16_buffer())
QRCode.ECI.US_ASCII:
self._qr.put_byte(new_data.to_ascii_buffer())
_:
self._qr.put_byte(new_data)
QRCode.Mode.KANJI:
self._qr.put_kanji(new_data)
if self.auto_update:
self.update()
func get_data() -> Variant:
var input_data: Variant = self._qr.get_input_data()
if self.mode == QRCode.Mode.BYTE && self.use_eci:
match self.eci_value:
QRCode.ECI.ISO_8859_1:
return input_data.get_string_from_ascii()
QRCode.ECI.SHIFT_JIS:
return ShiftJIS.get_string_from_shift_jis_2004(input_data)
QRCode.ECI.UTF_8:
return input_data.get_string_from_utf8()
QRCode.ECI.UTF_16:
return input_data.get_string_from_utf16()
QRCode.ECI.US_ASCII:
return input_data.get_string_from_ascii()
return self._qr.get_input_data()
func set_auto_update(new_auto_update: bool) -> void:
if auto_update == new_auto_update:
return
auto_update = new_auto_update
self.notify_property_list_changed()
if auto_update:
self.update()
func set_auto_version(new_auto_version: bool) -> void:
if self._qr.auto_version == new_auto_version:
return
self._qr.auto_version = new_auto_version
self.notify_property_list_changed()
if self.auto_update:
self.update()
func get_auto_version() -> bool:
return self._qr.auto_version
func set_version(new_version: int) -> void:
if self.auto_version || self._qr.version == new_version:
return
self._qr.version = new_version
if self.auto_update:
self.update()
func get_version() -> int:
return self._qr.version
func set_auto_mask_pattern(new_auto_mask_pattern: bool) -> void:
if self._qr.auto_mask_pattern == new_auto_mask_pattern:
return
self._qr.auto_mask_pattern = new_auto_mask_pattern
self.notify_property_list_changed()
if self.auto_update:
self.update()
func get_auto_mask_pattern() -> bool:
return self._qr.auto_mask_pattern
func set_mask_pattern(new_mask_pattern: int) -> void:
if self.auto_mask_pattern || self._qr.mask_pattern == new_mask_pattern:
return
self._qr.mask_pattern = new_mask_pattern
if self.auto_update:
self.update()
func get_mask_pattern() -> int:
return self._qr.mask_pattern
func set_light_module_color(new_light_module_color: Color) -> void:
if light_module_color == new_light_module_color:
return
light_module_color = new_light_module_color
if self.auto_update:
self._update_texture()
func set_dark_module_color(new_dark_module_color: Color) -> void:
if dark_module_color == new_dark_module_color:
return
dark_module_color = new_dark_module_color
if self.auto_update:
self._update_texture()
func set_auto_module_size(new_auto_module_size: bool) -> void:
if auto_module_size == new_auto_module_size:
return
auto_module_size = new_auto_module_size
self.notify_property_list_changed()
self.update_configuration_warnings()
if self.auto_update:
self._update_texture()
func set_module_size(new_module_size: int) -> void:
if module_size == new_module_size:
return
module_size = new_module_size
# if not auto it was set directly
if ! self.auto_module_size && self.auto_update:
self._update_texture()
func set_quiet_zone_size(new_quiet_zone_size: int) -> void:
if quiet_zone_size == new_quiet_zone_size:
return
quiet_zone_size = maxi(0, new_quiet_zone_size)
if self.auto_module_size && self.auto_update:
self._update_texture()
elif self.auto_module_size:
self._update_module_size()
func _ready() -> void:
if self.texture != null && self.auto_update:
self.update()
func update() -> void:
self._cached_data = self._qr.encode()
self._update_texture()
func _set(property: StringName, value: Variant) -> bool:
if property == "expand_mode":
self.update_configuration_warnings()
return false
func _get_property_list() -> Array[Dictionary]:
var data_prop: Dictionary = {
"name": "data",
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
}
match self.mode:
QRCode.Mode.NUMERIC:
data_prop["type"] = TYPE_STRING
QRCode.Mode.ALPHANUMERIC, QRCode.Mode.KANJI:
data_prop["type"] = TYPE_STRING
data_prop["hint"] = PROPERTY_HINT_MULTILINE_TEXT
QRCode.Mode.BYTE:
# these encoding is natively supported
if self.use_eci && self.eci_value in [QRCode.ECI.ISO_8859_1, QRCode.ECI.SHIFT_JIS, QRCode.ECI.UTF_8, QRCode.ECI.UTF_16, QRCode.ECI.US_ASCII]:
data_prop["type"] = TYPE_STRING
data_prop["hint"] = PROPERTY_HINT_MULTILINE_TEXT
else:
data_prop["type"] = TYPE_PACKED_BYTE_ARRAY
return [
{
"name": "_update_fn",
"type": TYPE_CALLABLE,
"usage": PROPERTY_USAGE_NONE if self.auto_update else PROPERTY_USAGE_EDITOR,
"hint": PROPERTY_HINT_TOOL_BUTTON,
"hint_string": "Update"
},
{
"name": "auto_update",
"type": TYPE_BOOL,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
},
{
"name": "mode",
"type": TYPE_INT,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
"hint": PROPERTY_HINT_ENUM,
"hint_string": "Numeric:1,Alphanumeric:2,Byte:4,Kanji:8"
},
{
"name": "error_correction",
"type": TYPE_INT,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
"hint": PROPERTY_HINT_ENUM,
"hint_string": "Low:1,Medium:0,Quartile:3,High:2"
},
{
"name": "use_eci",
"type": TYPE_BOOL,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
},
{
"name": "eci_value",
"type": TYPE_INT,
"usage": (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE) if self.use_eci else (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY),
"hint": PROPERTY_HINT_ENUM,
"hint_string": "Code Page 437:2,ISO 8859-1:3,ISO 8859-2:4,ISO 8859-3:5,ISO 8859-4:6,ISO 8859-5:7,ISO 8859-6:8,ISO 8859-7:9,ISO 8859-8:10,ISO 8859-9:11,ISO 8859-10:12,ISO 8859-11:13,ISO 8859-12:14,ISO 8859-13:15,ISO 8859-14:16,ISO 8859-15:17,ISO 8859-16:18,Shift JIS:20,Windows 1250:21,Windows 1251:22,Windows 1252:23,Windows 1256:24,UTF-16:25,UTF-8:26,US ASCII:27,BIG 5:28,GB 18030:29,EUC KR:30"
},
data_prop,
{
"name": "auto_version",
"type": TYPE_BOOL,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
},
{
"name": "version",
"type": TYPE_INT,
"usage": (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY) if self.auto_version else (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE),
"hint": PROPERTY_HINT_RANGE,
"hint_string": "1,40"
},
{
"name": "auto_mask_pattern",
"type": TYPE_BOOL,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
},
{
"name": "mask_pattern",
"type": TYPE_INT,
"usage": (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY) if self.auto_mask_pattern else (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE),
"hint": PROPERTY_HINT_RANGE,
"hint_string": "0,7"
},
{
"name": "Appearance",
"type": TYPE_NIL,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_GROUP,
},
{
"name": "light_module_color",
"type": TYPE_COLOR,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
},
{
"name": "dark_module_color",
"type": TYPE_COLOR,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
},
{
"name": "auto_module_size",
"type": TYPE_BOOL,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
},
{
"name": "module_size",
"type": TYPE_INT,
"usage": (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY) if self.auto_module_size else (PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE),
"hint": PROPERTY_HINT_RANGE,
"hint_string": "1,1,or_greater"
},
{
"name": "quiet_zone_size",
"type": TYPE_INT,
"usage": PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE,
"hint_string": "0,1,or_greater",
},
]
func _validate_property(property: Dictionary) -> void:
if property.name == "texture":
property.usage &= ~(PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE)
func _property_can_revert(property: StringName) -> bool:
return property in ["eci_value", "auto_version", "auto_mask_pattern", "light_module_color", "dark_module_color", "auto_module_size", "quiet_zone_size"]
func _property_get_revert(property: StringName) -> Variant:
match property:
"eci_value":
return QRCode.ECI.ISO_8859_1
"auto_version":
return true
"auto_mask_pattern":
return true
"light_module_color":
return Color.WHITE
"dark_module_color":
return Color.BLACK
"auto_module_size":
return true
"quiet_zone_size":
return 4
_:
return null
func _get_configuration_warnings() -> PackedStringArray:
if self.auto_module_size && self.expand_mode == EXPAND_KEEP_SIZE:
return ["Do not use auto module px size AND keep size expand mode."]
return []
func _notification(what: int) -> void:
match what:
NOTIFICATION_RESIZED:
if self.auto_module_size && self.auto_update:
self._update_texture()
elif self.auto_module_size:
self._update_module_size()
func _update_module_size() -> void:
self.module_size = mini(self.size.x, self.size.y) / (self._qr.get_dimension() + 2 * self.quiet_zone_size)
func _update_texture() -> void:
if self.auto_module_size:
self._update_module_size()
self.texture = ImageTexture.create_from_image(QRCode.generate_image(self._cached_data, self.module_size, self.light_module_color, self.dark_module_color, self.quiet_zone_size))
@@ -0,0 +1 @@
uid://dynulhnyq5hpq
+76
View File
@@ -0,0 +1,76 @@
# log -> exponent/antilog
static var _anti_log_table: PackedByteArray = []
# exponent/antilog -> log
static var _log_table: PackedByteArray = []
static func _static_init() -> void:
_create_log_anti_log_tables()
static func _anti_log(degree: int) -> int:
var res: int = 1
var alpha: int = 2
while degree != 0:
if degree & 1 == 1:
res = mul(res, alpha)
degree = degree >> 1
alpha = mul(alpha, alpha)
return res
static func _create_log_anti_log_tables() -> void:
_anti_log_table.resize(256)
_anti_log_table.fill(0)
_log_table.resize(256)
_log_table.fill(0)
for degree: int in range(0, 256):
var value: int = _anti_log(degree)
_anti_log_table[degree] = value
_log_table[value] = degree % 255
# Russian Peasant Multiplication algorithm, adapted to reed solomon
static func mul(lhs: int, rhs: int) -> int:
var res: int = 0
while rhs > 0:
if rhs & 1:
res = res ^ lhs
lhs = lhs << 1 # lhs * 2
rhs = rhs >> 1 # rhs / 2
if lhs & 256:
lhs = lhs ^ 0x11D
return res
static func generator_polynom(size: int) -> PackedByteArray:
var res: PackedByteArray = []
res.resize(size + 1)
res.fill(0)
res[0] = 1
var a_j: int = 1
for exp: int in range(0, size):
var cur_val: int = a_j
for cur_exp: int in range(1, exp + 1):
var old_res: int = res[cur_exp]
res[cur_exp] = cur_val ^ old_res
cur_val = mul(old_res, a_j)
res[exp + 1] = cur_val
a_j = mul(a_j, 0x02)
return res
static func encode(data: PackedByteArray, code_words: int) -> PackedByteArray:
assert(len(data) + code_words <= 255, "message to encode is to long")
var gen_poly: PackedByteArray = generator_polynom(code_words)
var enc_msg: PackedByteArray = []
enc_msg.resize(len(data) + len(gen_poly) - 1)
enc_msg.fill(0)
for idx: int in range(len(data)):
enc_msg[idx] = data[idx]
for idx: int in range(len(data)):
var coef: int = enc_msg[idx]
for p_idx: int in range(1, len(gen_poly)):
enc_msg[idx+p_idx] ^= mul(gen_poly[p_idx], coef)
return enc_msg.slice(len(data))
@@ -0,0 +1 @@
uid://g8jskaqqsmlg
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
uid://8yd22fd2gbxt
+5 -1
View File
@@ -3,6 +3,9 @@ extends Control
@onready
var character_panel: Panel = %CharacterPanel
@onready
var title_label: Label = %TitleLabel
@onready
var character_grid: GridContainer = %CharacterGridContainer
@@ -42,8 +45,9 @@ func load_characters() -> void:
character_box.connect("new_character_selected", _on_character_selected)
Settings.make_request2("/characters", fetch_character_list, true)
func show_grid() -> void:
func show_grid(player_name: String) -> void:
print("show_grid")
title_label.text = "Select character for " + player_name
close_timer.stop()
self.visible = true
Settings.character_select_open = true
+2 -1
View File
@@ -22,7 +22,8 @@ offset_right = 1263.0
offset_bottom = 659.0
size_flags_horizontal = 3
[node name="Label" type="Label" parent="CharacterPanel/VBoxContainer"]
[node name="TitleLabel" type="Label" parent="CharacterPanel/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
text = "Character Select"
+9 -1
View File
@@ -8,11 +8,15 @@
config_version=5
[animation]
compatibility/default_parent_skeleton_in_mesh_instance_3d=true
[application]
config/name="MusicPlayer"
run/main_scene="res://MainWindow.tscn"
config/features=PackedStringArray("4.5", "Forward Plus")
config/features=PackedStringArray("4.6", "Forward Plus")
config/icon="res://icon.svg"
[autoload]
@@ -37,6 +41,10 @@ window/vsync/vsync_mode=2
project/assembly_name="MusicPlayer"
[editor_plugins]
enabled=PackedStringArray("res://addons/kenyoni/qr_code/plugin.cfg")
[input]
ui_accept={
+47
View File
@@ -0,0 +1,47 @@
[gd_scene load_steps=2 format=3 uid="uid://bd1by80q1v27e"]
[ext_resource type="Script" uid="uid://rolypd0cqd6h" path="res://shortcuts_window.gd" id="1_12pxi"]
[node name="ShorcutsControl" type="Control"]
custom_minimum_size = Vector2(700, 700)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_12pxi")
[node name="ShortcutsPanel" type="Panel" parent="."]
unique_name_in_owner = true
custom_minimum_size = Vector2(700, 700)
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="ScrollContainer" type="ScrollContainer" parent="ShortcutsPanel"]
custom_minimum_size = Vector2(700, 700)
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="shortcutsVBox" type="VBoxContainer" parent="ShortcutsPanel/ScrollContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(700, 700)
layout_mode = 2
[node name="HBoxContainer" type="HBoxContainer" parent="ShortcutsPanel/ScrollContainer/shortcutsVBox"]
layout_mode = 2
alignment = 1
[node name="Label" type="Label" parent="ShortcutsPanel/ScrollContainer/shortcutsVBox/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "testar"
horizontal_alignment = 1
[node name="Label2" type="Label" parent="ShortcutsPanel/ScrollContainer/shortcutsVBox/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "testera 2"
horizontal_alignment = 1
+86
View File
@@ -0,0 +1,86 @@
extends Control
@onready
var shortcuts_vbox: VBoxContainer = %shortcutsVBox
@onready
var shortcuts_panel: Panel = %ShortcutsPanel
var shortcuts_dic: Dictionary = {
"Alt + S": "Search",
"Alt + A": "Add Players",
"Alt + Z": "Reset",
"Alt + X": "Play/Pause",
"Alt + C": "Next Song",
"Alt + V": "Show Answer",
"Alt + L": "Show Debug Log",
"Alt + K": "Show shortcuts",
"Alt + Enter": "Fullscreen",
"Alt + UP": "Volume up",
"Alt + DOWN": "Volume down",
"Alt + LEFT": "Jump back in song",
"Alt + Ctrl + LEFT": "Restart song",
"Alt + RIGHT": "Jump forward in song",
"Alt + 1 - 9": "Give player point",
"Alt + Ctrl + 1 - 9": "Take point from player",
}
#Color(0.18, 0.18, 0.18)
#Color(0.302, 0.302, 0.302)
#Color(0.259, 0.259, 0.259)
func _input(event: InputEvent) -> void:
if self.visible == true:
if shortcuts_panel == null:
return
if event is InputEventMouseButton && event.is_pressed():
var evLocal: InputEvent = make_input_local(event)
if !Rect2(Vector2(0, 0), shortcuts_panel.size).has_point(evLocal.position):
self.visible = false
func _ready() -> void:
shortcuts_dic.sort()
Settings.delete_children(shortcuts_vbox)
var title: Label = Label.new()
title.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
title.add_theme_font_size_override("font_size", 20)
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
title.text = "Shortcuts"
shortcuts_vbox.add_child(title)
var count: int = 0
for shortcut: String in shortcuts_dic.keys():
var panel: PanelContainer = PanelContainer.new()
var hbox: HBoxContainer = HBoxContainer.new()
hbox.alignment = BoxContainer.ALIGNMENT_CENTER
var label: Label = Label.new()
label.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
label.add_theme_font_size_override("font_size", 20)
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
label.text = shortcut
label.autowrap_mode = TextServer.AUTOWRAP_WORD
label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
var label2: Label = Label.new()
label2.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
label2.add_theme_font_size_override("font_size", 20)
label2.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
label2.text = shortcuts_dic[shortcut]
label2.autowrap_mode = TextServer.AUTOWRAP_WORD
label2.size_flags_horizontal = Control.SIZE_EXPAND_FILL
if count % 2 == 0:
var new_stylebox_normal: Resource = panel.get_theme_stylebox("panel").duplicate()
new_stylebox_normal.bg_color = Color(0.18, 0.18, 0.18)
panel.add_theme_stylebox_override("panel", new_stylebox_normal)
#label.add_theme_stylebox_override("normal", new_stylebox_normal)
#label2.add_theme_stylebox_override("normal", new_stylebox_normal)
hbox.add_child(label)
hbox.add_child(label2)
panel.add_child(hbox)
shortcuts_vbox.add_child(panel)
count += 1
+1
View File
@@ -0,0 +1 @@
uid://rolypd0cqd6h
+63
View File
@@ -0,0 +1,63 @@
extends Control
@onready
var winner_panel: Panel = %WinnerPanel
@onready
var winner_picture: TextureRect = %WinnerPicture
@onready
var winner_label: Label = %WinnerLabel
@onready
var players_list: VBoxContainer = %PlayersList
func _ready() -> void:
visible = false
func show_winner(winning_player_id: int) -> void:
visible = true
# Set winner info
var winner: PlayerObject = Settings.player_array[winning_player_id]
winner_label.text = winner.player_name + " won with " + str(winner.player_score) + \
" points!!"
winner_picture.texture = winner.character
winner_picture.custom_minimum_size = Vector2(480, 200)
winner_picture.expand_mode = TextureRect.EXPAND_FIT_WIDTH_PROPORTIONAL
winner_picture.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
# Clear previous player list entries
for child: Node in players_list.get_children():
child.queue_free()
# Sort players by score (descending) and add to list
var sorted_players: Array = Settings.player_array.duplicate()
sorted_players.sort_custom(
func(a: PlayerObject, b: PlayerObject) -> bool:
return a.player_score > b.player_score
)
var placing: int = 2
for player: PlayerObject in sorted_players:
if player.id == winning_player_id:
continue # Skip the winner, already shown above
var label: Label = Label.new()
label.text = str(placing) + ". " + player.player_name + " - " + \
str(player.player_score) + " points"
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
players_list.add_child(label)
placing += 1
func hide_window() -> void:
visible = false
func _input(event: InputEvent) -> void:
if visible:
if event is InputEventMouseButton and event.is_pressed():
var ev_local: InputEvent = make_input_local(event)
if !Rect2(Vector2(0, 0), winner_panel.size).has_point(ev_local.position):
visible = false
+1
View File
@@ -0,0 +1 @@
uid://dxpb22xbwf3t1