Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6989b53dda | |||
| 899e99864f | |||
| 84608c95c2 | |||
| acd8d65b95 | |||
| d957c02373 | |||
| 0316df2f95 | |||
| b4ba96cf63 | |||
| 2a32cc34ef | |||
| bae5831a3e | |||
| c6ed3c8e53 |
@@ -9,11 +9,9 @@ on:
|
|||||||
branches: [main, develop]
|
branches: [main, develop]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GODOT_VERSION: 4.5
|
GODOT_VERSION: 4.6
|
||||||
PROJECT_PATH: .
|
PROJECT_PATH: .
|
||||||
#GAME_VERSION: 0.0.8
|
EXPORT_NAME: MusicPlayer
|
||||||
#GAME_VERSION: ${{gitea.ref_name}}
|
|
||||||
EXPORT_NAME: test-project
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -54,8 +52,8 @@ jobs:
|
|||||||
cd $PROJECT_PATH
|
cd $PROJECT_PATH
|
||||||
./godot --headless --verbose --export-release "Linux" "build/$EXPORT_NAME.x86_64"
|
./godot --headless --verbose --export-release "Linux" "build/$EXPORT_NAME.x86_64"
|
||||||
|
|
||||||
- name: MacOS Build
|
# - name: MacOS Build
|
||||||
run: |
|
# run: |
|
||||||
cd $PROJECT_PATH
|
# cd $PROJECT_PATH
|
||||||
./godot --headless --verbose --export-release "macOS" "build/$EXPORT_NAME.zip"
|
# ./godot --headless --verbose --export-release "macOS" "build/$EXPORT_NAME.zip"
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ on:
|
|||||||
- '*.*'
|
- '*.*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GODOT_VERSION: 4.5
|
GODOT_VERSION: 4.6
|
||||||
PROJECT_PATH: .
|
PROJECT_PATH: .
|
||||||
PROJECT_NAME: MusicPlayer
|
PROJECT_NAME: MusicPlayer
|
||||||
GAME_VERSION: ${{gitea.ref_name}}
|
GAME_VERSION: ${{gitea.ref_name}}
|
||||||
@@ -55,31 +55,31 @@ jobs:
|
|||||||
cd $PROJECT_PATH
|
cd $PROJECT_PATH
|
||||||
./godot --headless --verbose --export-release "Linux" "build/$EXPORT_NAME.x86_64"
|
./godot --headless --verbose --export-release "Linux" "build/$EXPORT_NAME.x86_64"
|
||||||
|
|
||||||
- name: MacOS Build
|
# - name: MacOS Build
|
||||||
run: |
|
# run: |
|
||||||
cd $PROJECT_PATH
|
# cd $PROJECT_PATH
|
||||||
./godot --headless --verbose --export-release "macOS" "build/$EXPORT_NAME.zip"
|
# ./godot --headless --verbose --export-release "macOS" "build/$EXPORT_NAME.zip"
|
||||||
|
|
||||||
- name: Upload Artifact Windows
|
- name: Upload Artifact Windows
|
||||||
run: |
|
run: |
|
||||||
#ls -la build
|
#ls -la build
|
||||||
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
|
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
|
||||||
--upload-file "build/$EXPORT_NAME.exe" \
|
--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
|
- name: Upload Artifact Linux
|
||||||
run: |
|
run: |
|
||||||
ls -la build
|
ls -la build
|
||||||
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
|
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
|
||||||
--upload-file "build/$EXPORT_NAME.x86_64" \
|
--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
|
# - name: Upload Artifact MacOS
|
||||||
run: |
|
# run: |
|
||||||
ls -la build
|
# ls -la build
|
||||||
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
|
# curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
|
||||||
--upload-file "build/$EXPORT_NAME.zip" \
|
# --upload-file "build/$EXPORT_NAME.zip" \
|
||||||
https://gitea.sanplex.tech/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$EXPORT_NAME.zip
|
# https://gitea.sanplex.xyz/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$EXPORT_NAME.zip
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: akkuman/gitea-release-action@v1
|
uses: akkuman/gitea-release-action@v1
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://b7bh0of7olbcb
|
||||||
@@ -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
|
||||||
@@ -1,36 +1,34 @@
|
|||||||
extends ScrollContainer
|
extends ScrollContainer
|
||||||
|
|
||||||
var SCROLL = 0
|
var SCROLL: float = 0
|
||||||
var delay = 0.02 #seconds
|
var delay: float = 0.02 #seconds
|
||||||
var wait = 0
|
var wait: float = 0
|
||||||
|
|
||||||
var SPEED: int = 1
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready() -> void:
|
||||||
wait = delay
|
wait = delay
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta):
|
func _process(delta: float) -> void:
|
||||||
wait -= delta
|
wait -= delta
|
||||||
if wait < 0:
|
if wait < 0:
|
||||||
wait = delay
|
wait = delay
|
||||||
#SCROLL DOWN
|
#SCROLL DOWN
|
||||||
if SCROLL == 1:
|
if SCROLL == 1:
|
||||||
if (scroll_vertical + get_v_scroll_bar().page) < get_v_scroll_bar().max_value:
|
if (scroll_vertical + get_v_scroll_bar().page) < get_v_scroll_bar().max_value:
|
||||||
scroll_vertical += SPEED
|
scroll_vertical += Settings.inspiration_list_speed
|
||||||
else:
|
else:
|
||||||
scroll_back_up()
|
scroll_back_up()
|
||||||
#SCROLL UP
|
#SCROLL UP
|
||||||
elif SCROLL == -1:
|
elif SCROLL == -1:
|
||||||
if scroll_vertical != 0:
|
if scroll_vertical != 0:
|
||||||
scroll_vertical -= SPEED
|
scroll_vertical -= Settings.inspiration_list_speed
|
||||||
else:
|
else:
|
||||||
scroll_to_bottom()
|
scroll_to_bottom()
|
||||||
|
|
||||||
func scroll_back_up():
|
func scroll_back_up() -> void:
|
||||||
SCROLL = -1
|
SCROLL = -1
|
||||||
|
|
||||||
func scroll_to_bottom():
|
func scroll_to_bottom() -> void:
|
||||||
scroll_vertical = 0 #Reset to top first.
|
scroll_vertical = 0 #Reset to top first.
|
||||||
SCROLL = 1
|
SCROLL = 1
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://bijh5h5yrivm3"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cw41y87l64qo7" path="res://log.gd" id="1_q72ua"]
|
||||||
|
|
||||||
|
[node name="Control" 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_q72ua")
|
||||||
|
|
||||||
|
[node name="LogPanel" type="Panel" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
visibility_layer = 513
|
||||||
|
custom_minimum_size = Vector2(700, 700)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 40.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
|
||||||
|
[node name="LogScrollContainer" type="ScrollContainer" parent="LogPanel"]
|
||||||
|
custom_minimum_size = Vector2(700, 700)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 40.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
|
||||||
|
[node name="LogVBoxContainer" type="VBoxContainer" parent="LogPanel/LogScrollContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
custom_minimum_size = Vector2(700, 700)
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/separation = 1
|
||||||
+58
-50
@@ -61,6 +61,18 @@ var settings_button: Button = $SettingsButton
|
|||||||
@onready
|
@onready
|
||||||
var settings_window: Control = $SettingsWindow
|
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
|
@onready
|
||||||
var statistics_button: Button = $StatisticsButton
|
var statistics_button: Button = $StatisticsButton
|
||||||
|
|
||||||
@@ -70,11 +82,14 @@ var statistic_popup: PopupPanel = $StatisticsPopupPanel
|
|||||||
@onready
|
@onready
|
||||||
var statistic_label: Label = $StatisticsPopupPanel/StatisticsLabel
|
var statistic_label: Label = $StatisticsPopupPanel/StatisticsLabel
|
||||||
|
|
||||||
|
@onready
|
||||||
|
var shortcuts_button: Button = $ShortcutsButton
|
||||||
|
|
||||||
@onready
|
@onready
|
||||||
var about_button: Button = $AboutButton
|
var about_button: Button = $AboutButton
|
||||||
|
|
||||||
@onready
|
@onready
|
||||||
var about_popup: PopupPanel = $AboutPopupPanel
|
var about_window: Control = %AboutWindow
|
||||||
|
|
||||||
@onready
|
@onready
|
||||||
var show_answer_button: Button = $ShowAnswerButton
|
var show_answer_button: Button = $ShowAnswerButton
|
||||||
@@ -103,33 +118,15 @@ var search_button: Button = $SearchButton
|
|||||||
@onready
|
@onready
|
||||||
var search_view: Control= $Search
|
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
|
@onready
|
||||||
var auto_repeat_song_button: CheckButton = $RepeatSongCheckButton
|
var auto_repeat_song_button: CheckButton = $RepeatSongCheckButton
|
||||||
|
|
||||||
@onready
|
@onready
|
||||||
var music_player_container: PanelContainer = $MusicPlayer
|
var music_player_container: PanelContainer = $MusicPlayer
|
||||||
|
|
||||||
|
@onready
|
||||||
|
var log_window: Control = %Log
|
||||||
|
|
||||||
@onready
|
@onready
|
||||||
var debug_label: Label = $DebugLabel
|
var debug_label: Label = $DebugLabel
|
||||||
|
|
||||||
@@ -148,9 +145,8 @@ func _ready() -> void:
|
|||||||
print("is_debug")
|
print("is_debug")
|
||||||
debug_label.visible = true
|
debug_label.visible = true
|
||||||
Settings.is_debug = true
|
Settings.is_debug = true
|
||||||
Settings.default_path = "http://localhost:8080"
|
settings_window.set_winning_score(5)
|
||||||
Settings.selected_server = 3
|
settings_window.set_selected_server(4)
|
||||||
Settings.winning_score = 5
|
|
||||||
if is_mac:
|
if is_mac:
|
||||||
print("is_mac")
|
print("is_mac")
|
||||||
next_button.pressed.connect(play_next_song)
|
next_button.pressed.connect(play_next_song)
|
||||||
@@ -159,8 +155,10 @@ func _ready() -> void:
|
|||||||
sync_button.pressed.connect(sync_games)
|
sync_button.pressed.connect(sync_games)
|
||||||
sound_test_button.pressed.connect(music_player_container.get_sound_test_song)
|
sound_test_button.pressed.connect(music_player_container.get_sound_test_song)
|
||||||
statistics_button.pressed.connect(get_statistics)
|
statistics_button.pressed.connect(get_statistics)
|
||||||
|
shortcuts_button.pressed.connect(show_shortcuts)
|
||||||
about_button.pressed.connect(show_about)
|
about_button.pressed.connect(show_about)
|
||||||
settings_button.pressed.connect(show_settings)
|
settings_button.pressed.connect(show_settings)
|
||||||
|
qr_button.pressed.connect(show_qr)
|
||||||
reset_playlist_button.pressed.connect(reset_playlist)
|
reset_playlist_button.pressed.connect(reset_playlist)
|
||||||
reset_points_button.pressed.connect(reset_points)
|
reset_points_button.pressed.connect(reset_points)
|
||||||
|
|
||||||
@@ -205,10 +203,15 @@ func _input(event: InputEvent) -> void:
|
|||||||
if event.alt_pressed && event.keycode == KEY_ENTER:
|
if event.alt_pressed && event.keycode == KEY_ENTER:
|
||||||
print("Alt + Enter pressed")
|
print("Alt + Enter pressed")
|
||||||
Settings.fullscreen = !Settings.fullscreen
|
Settings.fullscreen = !Settings.fullscreen
|
||||||
|
settings_window.fullscreen_button.button_pressed = Settings.fullscreen
|
||||||
if Settings.fullscreen == true:
|
if Settings.fullscreen == true:
|
||||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
||||||
if Settings.fullscreen == false:
|
if Settings.fullscreen == false:
|
||||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
|
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_window.visible = !log_window.visible
|
||||||
|
|
||||||
func server_updated() -> void:
|
func server_updated() -> void:
|
||||||
print("server_updated")
|
print("server_updated")
|
||||||
@@ -351,16 +354,20 @@ func reset_points() -> void:
|
|||||||
|
|
||||||
func show_about() -> void:
|
func show_about() -> void:
|
||||||
print("show_about")
|
print("show_about")
|
||||||
about_popup.visible = true
|
about_window.show_window()
|
||||||
version_label.text = Settings.version
|
|
||||||
whats_new_label.text = Settings.whats_new
|
func show_shortcuts() -> void:
|
||||||
shortcut_label.text = Settings.shortcuts
|
print("show_shortcuts")
|
||||||
coming_label.text = Settings.whats_left
|
shortcuts_window.visible = true
|
||||||
|
|
||||||
func show_settings() -> void:
|
func show_settings() -> void:
|
||||||
print("show_settings")
|
print("show_settings")
|
||||||
settings_window.visible = true
|
settings_window.visible = true
|
||||||
|
|
||||||
|
func show_qr() -> void:
|
||||||
|
print("show_qr")
|
||||||
|
qr_window.show_window()
|
||||||
|
|
||||||
func get_statistics() -> void:
|
func get_statistics() -> void:
|
||||||
print("get_statistics")
|
print("get_statistics")
|
||||||
statistic_popup.visible = true
|
statistic_popup.visible = true
|
||||||
@@ -384,6 +391,7 @@ func _on_sync_finished() -> void:
|
|||||||
sound_test_button.disabled = false
|
sound_test_button.disabled = false
|
||||||
reset_playlist_button.disabled = false
|
reset_playlist_button.disabled = false
|
||||||
show_answer_button.disabled = false
|
show_answer_button.disabled = false
|
||||||
|
reset_points()
|
||||||
|
|
||||||
func get_suggestion_list() -> void:
|
func get_suggestion_list() -> void:
|
||||||
print("get_suggestion_list")
|
print("get_suggestion_list")
|
||||||
@@ -412,16 +420,17 @@ func add_players() -> void:
|
|||||||
|
|
||||||
func add_player() -> void:
|
func add_player() -> void:
|
||||||
print("add_player")
|
print("add_player")
|
||||||
var new_player_object: PlayerObject = PlayerObject.new(new_player_name_field.text, Settings.player_array.size())
|
if new_player_name_field.text != "" && Settings.player_array.size() < Settings.MAX_NUMBER_OF_PLAYERS:
|
||||||
new_player_name_field.text = ""
|
var new_player_object: PlayerObject = PlayerObject.new(new_player_name_field.text, Settings.player_array.size())
|
||||||
Settings.player_array.append(new_player_object)
|
new_player_name_field.text = ""
|
||||||
new_player_object.connect("first_point_triggerd", music_player_container._on_point_triggered.bind("first"))
|
Settings.player_array.append(new_player_object)
|
||||||
new_player_object.connect("match_point_triggerd", music_player_container._on_point_triggered.bind("match"))
|
new_player_object.connect("first_point_triggerd", music_player_container._on_point_triggered.bind("first"))
|
||||||
new_player_object.connect("winner_triggerd", _on_player_won.bind(new_player_object.id))
|
new_player_object.connect("match_point_triggerd", music_player_container._on_point_triggered.bind("match"))
|
||||||
new_player_object.connect("point_given_sound", _on_make_point_given_sound)
|
new_player_object.connect("winner_triggerd", _on_player_won.bind(new_player_object.id))
|
||||||
new_player_object.connect("player_point_given", _on_point_given.bind(new_player_object.id))
|
new_player_object.connect("point_given_sound", _on_make_point_given_sound)
|
||||||
new_player_object.connect("player_point_taken", _on_point_taken.bind(new_player_object.id))
|
new_player_object.connect("player_point_given", _on_point_given.bind(new_player_object.id))
|
||||||
load_players()
|
new_player_object.connect("player_point_taken", _on_point_taken.bind(new_player_object.id))
|
||||||
|
load_players()
|
||||||
|
|
||||||
func load_players() -> void:
|
func load_players() -> void:
|
||||||
print("load_players")
|
print("load_players")
|
||||||
@@ -433,7 +442,7 @@ func load_players() -> void:
|
|||||||
var new_player: Player = player.instantiate()
|
var new_player: Player = player.instantiate()
|
||||||
new_player.id = counter
|
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))
|
new_player.connect("player_removed", _on_player_removed.bind(counter))
|
||||||
|
|
||||||
player_container.add_child(new_player)
|
player_container.add_child(new_player)
|
||||||
@@ -441,6 +450,7 @@ func load_players() -> void:
|
|||||||
|
|
||||||
func _on_point_given(player_given_point: int) -> void:
|
func _on_point_given(player_given_point: int) -> void:
|
||||||
print("_on_point_given")
|
print("_on_point_given")
|
||||||
|
log_window.add_log_row(Settings.player_array[player_given_point].player_name + " got a point")
|
||||||
if Playlist.currently_playing_song >= 0:
|
if Playlist.currently_playing_song >= 0:
|
||||||
Playlist.add_point(player_given_point)
|
Playlist.add_point(player_given_point)
|
||||||
update_song_list()
|
update_song_list()
|
||||||
@@ -450,6 +460,7 @@ func _on_make_point_given_sound() -> void:
|
|||||||
|
|
||||||
func _on_point_taken(player_taken_point: int) -> void:
|
func _on_point_taken(player_taken_point: int) -> void:
|
||||||
print("_on_point_taken")
|
print("_on_point_taken")
|
||||||
|
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"))
|
music_player_container.play_sound_effect(preload("res://sounds/itemequip.wav"))
|
||||||
if Playlist.currently_playing_song >= 0:
|
if Playlist.currently_playing_song >= 0:
|
||||||
Playlist.remove_point(player_taken_point)
|
Playlist.remove_point(player_taken_point)
|
||||||
@@ -457,13 +468,9 @@ func _on_point_taken(player_taken_point: int) -> void:
|
|||||||
|
|
||||||
func _on_player_won(winning_player_id: int) -> void:
|
func _on_player_won(winning_player_id: int) -> void:
|
||||||
print("_on_player_won")
|
print("_on_player_won")
|
||||||
winner_popup.visible = true
|
winner_window.show_winner(winning_player_id)
|
||||||
winner_label.text = Settings.player_array[winning_player_id].player_name + " won!!"
|
music_player_container.play_song(preload("res://sounds/winning.mp3"))
|
||||||
winner_picture.custom_minimum_size = Vector2(692, 300)
|
Settings.add_to_stats = false
|
||||||
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"))
|
|
||||||
|
|
||||||
func _on_player_removed(player_to_remove: int) -> void:
|
func _on_player_removed(player_to_remove: int) -> void:
|
||||||
print("_on_player_removed ", player_to_remove)
|
print("_on_player_removed ", player_to_remove)
|
||||||
@@ -472,10 +479,11 @@ func _on_player_removed(player_to_remove: int) -> void:
|
|||||||
Playlist.remove_player_from_list(player_to_remove)
|
Playlist.remove_player_from_list(player_to_remove)
|
||||||
update_song_list()
|
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")
|
print("_on_player_change_character_clicked")
|
||||||
current_player = new_player
|
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:
|
func _on_character_selected(file_name: String) -> void:
|
||||||
print("_on_character_selected")
|
print("_on_character_selected")
|
||||||
|
|||||||
+123
-154
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=28 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="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"]
|
[ext_resource type="PackedScene" uid="uid://b16on0oscg1bv" path="res://CharacterSelect.tscn" id="2_76kf4"]
|
||||||
@@ -11,8 +11,12 @@
|
|||||||
[ext_resource type="Theme" uid="uid://rxexo3ur85as" path="res://LightGrayTheme.tres" id="7_wxbv6"]
|
[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://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="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://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"]
|
[sub_resource type="LabelSettings" id="LabelSettings_ychxr"]
|
||||||
font_size = 25
|
font_size = 25
|
||||||
@@ -64,20 +68,17 @@ keycode = 83
|
|||||||
[sub_resource type="Shortcut" id="Shortcut_fbju4"]
|
[sub_resource type="Shortcut" id="Shortcut_fbju4"]
|
||||||
events = [SubResource("InputEventKey_ujjlu")]
|
events = [SubResource("InputEventKey_ujjlu")]
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_hr75l"]
|
[node name="Control" type="Control" unique_id=407149696]
|
||||||
font_size = 35
|
|
||||||
|
|
||||||
[node name="Control" type="Control"]
|
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
script = ExtResource("1_eu0t5")
|
script = ExtResource("1_eu0t5")
|
||||||
|
|
||||||
[node name="TopPanelContainer" type="PanelContainer" parent="."]
|
[node name="TopPanelContainer" type="PanelContainer" parent="." unique_id=663404711]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_right = 1920.0
|
offset_right = 1920.0
|
||||||
offset_bottom = 56.0
|
offset_bottom = 56.0
|
||||||
|
|
||||||
[node name="Title" type="Label" parent="."]
|
[node name="Title" type="Label" parent="." unique_id=1187907861]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 64.0
|
offset_left = 64.0
|
||||||
@@ -88,7 +89,7 @@ size_flags_horizontal = 0
|
|||||||
text = "Music Player Randomizer"
|
text = "Music Player Randomizer"
|
||||||
label_settings = SubResource("LabelSettings_ychxr")
|
label_settings = SubResource("LabelSettings_ychxr")
|
||||||
|
|
||||||
[node name="Open" type="Button" parent="."]
|
[node name="Open" type="Button" parent="." unique_id=165052329]
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1296.0
|
offset_left = 1296.0
|
||||||
@@ -97,7 +98,7 @@ offset_right = 1346.0
|
|||||||
offset_bottom = 97.0
|
offset_bottom = 97.0
|
||||||
text = "Open"
|
text = "Open"
|
||||||
|
|
||||||
[node name="FileDialog" type="FileDialog" parent="."]
|
[node name="FileDialog" type="FileDialog" parent="." unique_id=485771559]
|
||||||
title = "Open a Directory"
|
title = "Open a Directory"
|
||||||
initial_position = 2
|
initial_position = 2
|
||||||
size = Vector2i(616, 400)
|
size = Vector2i(616, 400)
|
||||||
@@ -106,7 +107,7 @@ file_mode = 2
|
|||||||
access = 2
|
access = 2
|
||||||
show_hidden_files = true
|
show_hidden_files = true
|
||||||
|
|
||||||
[node name="MusicListPanel" type="PanelContainer" parent="."]
|
[node name="MusicListPanel" type="PanelContainer" parent="." unique_id=2011292375]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 64.0
|
offset_left = 64.0
|
||||||
offset_top = 384.0
|
offset_top = 384.0
|
||||||
@@ -114,19 +115,19 @@ offset_right = 1152.0
|
|||||||
offset_bottom = 896.0
|
offset_bottom = 896.0
|
||||||
theme = ExtResource("7_wxbv6")
|
theme = ExtResource("7_wxbv6")
|
||||||
|
|
||||||
[node name="ScrollContainer" type="ScrollContainer" parent="MusicListPanel"]
|
[node name="ScrollContainer" type="ScrollContainer" parent="MusicListPanel" unique_id=707750459]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
follow_focus = true
|
follow_focus = true
|
||||||
script = ExtResource("7_dj026")
|
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
|
texture_filter = 1
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
theme_override_constants/separation = 10
|
theme_override_constants/separation = 10
|
||||||
|
|
||||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
[node name="ScrollContainer" type="ScrollContainer" parent="." unique_id=498283761]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1216.0
|
offset_left = 1216.0
|
||||||
@@ -137,20 +138,20 @@ horizontal_scroll_mode = 0
|
|||||||
vertical_scroll_mode = 3
|
vertical_scroll_mode = 3
|
||||||
script = ExtResource("2_gxtxm")
|
script = ExtResource("2_gxtxm")
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer"]
|
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer" unique_id=1215162949]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=42468498]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 64.0
|
offset_left = 64.0
|
||||||
offset_top = 64.0
|
offset_top = 64.0
|
||||||
offset_right = 1152.0
|
offset_right = 1152.0
|
||||||
offset_bottom = 384.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
|
texture_filter = 1
|
||||||
custom_minimum_size = Vector2(1, 1)
|
custom_minimum_size = Vector2(1, 1)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -158,7 +159,7 @@ label_settings = SubResource("LabelSettings_qspbu")
|
|||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
autowrap_mode = 2
|
autowrap_mode = 2
|
||||||
|
|
||||||
[node name="SongLabel" type="Label" parent="VBoxContainer"]
|
[node name="SongLabel" type="Label" parent="VBoxContainer" unique_id=1687490027]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
custom_minimum_size = Vector2(1, 1)
|
custom_minimum_size = Vector2(1, 1)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -166,7 +167,7 @@ label_settings = SubResource("LabelSettings_3m52w")
|
|||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
autowrap_mode = 2
|
autowrap_mode = 2
|
||||||
|
|
||||||
[node name="CharacterSelect" parent="." instance=ExtResource("2_76kf4")]
|
[node name="CharacterSelect" parent="." unique_id=2079506802 instance=ExtResource("2_76kf4")]
|
||||||
visible = false
|
visible = false
|
||||||
top_level = true
|
top_level = true
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
@@ -175,7 +176,7 @@ offset_top = 264.0
|
|||||||
offset_right = 776.0
|
offset_right = 776.0
|
||||||
offset_bottom = 424.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
|
layout_mode = 0
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
@@ -189,21 +190,21 @@ offset_bottom = 1024.0
|
|||||||
grow_horizontal = 1
|
grow_horizontal = 1
|
||||||
grow_vertical = 1
|
grow_vertical = 1
|
||||||
|
|
||||||
[node name="Players" type="PanelContainer" parent="."]
|
[node name="Players" type="PanelContainer" parent="." unique_id=1708375945]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1216.0
|
offset_left = 1216.0
|
||||||
offset_top = 576.0
|
offset_top = 576.0
|
||||||
offset_right = 1857.0
|
offset_right = 1857.0
|
||||||
offset_bottom = 977.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
|
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)
|
custom_minimum_size = Vector2(2.08165e-12, 40)
|
||||||
layout_mode = 2
|
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
|
texture_filter = 1
|
||||||
custom_minimum_size = Vector2(2.08165e-12, 40)
|
custom_minimum_size = Vector2(2.08165e-12, 40)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -213,7 +214,7 @@ text = "Players"
|
|||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
vertical_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
|
texture_filter = 1
|
||||||
custom_minimum_size = Vector2(2.08165e-12, 40)
|
custom_minimum_size = Vector2(2.08165e-12, 40)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -223,36 +224,36 @@ action_mode = 0
|
|||||||
shortcut = SubResource("Shortcut_jafqj")
|
shortcut = SubResource("Shortcut_jafqj")
|
||||||
texture_normal = ExtResource("5_31tjv")
|
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
|
visible = false
|
||||||
custom_minimum_size = Vector2(2.08165e-12, 40)
|
custom_minimum_size = Vector2(2.08165e-12, 40)
|
||||||
layout_mode = 2
|
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
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_qk7sj")
|
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)
|
custom_minimum_size = Vector2(2.08165e-12, 40)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
placeholder_text = "Player name"
|
placeholder_text = "Player name"
|
||||||
script = ExtResource("7_qsdfy")
|
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
|
texture_filter = 1
|
||||||
custom_minimum_size = Vector2(2.08165e-12, 40)
|
custom_minimum_size = Vector2(2.08165e-12, 40)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Add"
|
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)
|
custom_minimum_size = Vector2(2.08165e-12, 40)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_k1ygi")
|
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
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1359.0
|
offset_left = 1359.0
|
||||||
@@ -263,7 +264,7 @@ focus_mode = 0
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Reset playlist"
|
text = "Reset playlist"
|
||||||
|
|
||||||
[node name="ResetPointsButton" type="Button" parent="."]
|
[node name="ResetPointsButton" type="Button" parent="." unique_id=942880776]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1487.0
|
offset_left = 1487.0
|
||||||
@@ -274,7 +275,7 @@ focus_mode = 0
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Reset points"
|
text = "Reset points"
|
||||||
|
|
||||||
[node name="SyncButton" type="Button" parent="."]
|
[node name="SyncButton" type="Button" parent="." unique_id=1228313556]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1615.0
|
offset_left = 1615.0
|
||||||
@@ -285,7 +286,7 @@ focus_mode = 0
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Sync games"
|
text = "Sync games"
|
||||||
|
|
||||||
[node name="SoundTestButton" type="Button" parent="."]
|
[node name="SoundTestButton" type="Button" parent="." unique_id=1332971879]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1743.0
|
offset_left = 1743.0
|
||||||
@@ -296,7 +297,7 @@ focus_mode = 0
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Sound test"
|
text = "Sound test"
|
||||||
|
|
||||||
[node name="ShowAnswerButton" type="Button" parent="."]
|
[node name="ShowAnswerButton" type="Button" parent="." unique_id=415388039]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 65.0
|
offset_left = 65.0
|
||||||
@@ -308,7 +309,7 @@ action_mode = 0
|
|||||||
shortcut = SubResource("Shortcut_a7fvb")
|
shortcut = SubResource("Shortcut_a7fvb")
|
||||||
text = "Show answer"
|
text = "Show answer"
|
||||||
|
|
||||||
[node name="NextButton" type="Button" parent="."]
|
[node name="NextButton" type="Button" parent="." unique_id=1744703488]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 193.0
|
offset_left = 193.0
|
||||||
@@ -321,52 +322,74 @@ action_mode = 0
|
|||||||
shortcut = SubResource("Shortcut_d6fml")
|
shortcut = SubResource("Shortcut_d6fml")
|
||||||
text = "Randomize new track"
|
text = "Randomize new track"
|
||||||
|
|
||||||
[node name="SearchButton" type="Button" parent="."]
|
[node name="SearchButton" type="Button" parent="." unique_id=1782453581]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1488.0
|
offset_left = 1354.0
|
||||||
offset_top = 8.0
|
offset_top = 8.0
|
||||||
offset_right = 1558.0
|
offset_right = 1424.0
|
||||||
offset_bottom = 48.0
|
offset_bottom = 48.0
|
||||||
focus_mode = 0
|
focus_mode = 0
|
||||||
action_mode = 0
|
action_mode = 0
|
||||||
shortcut = SubResource("Shortcut_fbju4")
|
shortcut = SubResource("Shortcut_fbju4")
|
||||||
text = "Search"
|
text = "Search"
|
||||||
|
|
||||||
[node name="SettingsButton" type="Button" parent="."]
|
[node name="SettingsButton" type="Button" parent="." unique_id=1193400323]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1584.0
|
offset_left = 1442.0
|
||||||
offset_top = 8.0
|
offset_top = 8.0
|
||||||
offset_right = 1654.0
|
offset_right = 1512.0
|
||||||
offset_bottom = 48.0
|
offset_bottom = 48.0
|
||||||
focus_mode = 0
|
focus_mode = 0
|
||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Settings"
|
text = "Settings"
|
||||||
|
|
||||||
[node name="StatisticsButton" type="Button" parent="."]
|
[node name="StatisticsButton" type="Button" parent="." unique_id=2045021269]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1680.0
|
offset_left = 1530.0
|
||||||
offset_top = 8.0
|
offset_top = 8.0
|
||||||
offset_right = 1758.0
|
offset_right = 1600.0
|
||||||
offset_bottom = 48.0
|
offset_bottom = 48.0
|
||||||
focus_mode = 0
|
focus_mode = 0
|
||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Statistics"
|
text = "Statistics"
|
||||||
|
|
||||||
[node name="AboutButton" type="Button" parent="."]
|
[node name="ShortcutsButton" type="Button" parent="." unique_id=2066498226]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 1784.0
|
offset_left = 1626.0
|
||||||
offset_top = 8.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
|
offset_bottom = 48.0
|
||||||
focus_mode = 0
|
focus_mode = 0
|
||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "About"
|
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
|
visible = false
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
offset_left = 56.0
|
offset_left = 56.0
|
||||||
@@ -374,7 +397,7 @@ offset_top = 96.0
|
|||||||
offset_right = 56.0
|
offset_right = 56.0
|
||||||
offset_bottom = 96.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
|
unique_name_in_owner = true
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
@@ -383,7 +406,7 @@ offset_top = 153.0
|
|||||||
offset_right = 401.0
|
offset_right = 401.0
|
||||||
offset_bottom = 153.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
|
visible = false
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
offset_left = 720.0
|
offset_left = 720.0
|
||||||
@@ -391,7 +414,16 @@ offset_top = 153.0
|
|||||||
offset_right = 720.0
|
offset_right = 720.0
|
||||||
offset_bottom = 153.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
|
unique_name_in_owner = true
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
@@ -400,12 +432,21 @@ offset_top = 165.0
|
|||||||
offset_right = 1572.0
|
offset_right = 1572.0
|
||||||
offset_bottom = 805.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
|
oversampling_override = 1.0
|
||||||
initial_position = 2
|
initial_position = 2
|
||||||
size = Vector2i(450, 100)
|
size = Vector2i(450, 100)
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="StatisticsPopupPanel"]
|
[node name="Label" type="Label" parent="StatisticsPopupPanel" unique_id=548316493]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
offset_left = 4.0
|
offset_left = 4.0
|
||||||
offset_top = 4.0
|
offset_top = 4.0
|
||||||
@@ -414,7 +455,7 @@ offset_bottom = 96.0
|
|||||||
text = "Statistics"
|
text = "Statistics"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[node name="StatisticsLabel" type="Label" parent="StatisticsPopupPanel"]
|
[node name="StatisticsLabel" type="Label" parent="StatisticsPopupPanel" unique_id=58226477]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
offset_left = 4.0
|
offset_left = 4.0
|
||||||
offset_top = 4.0
|
offset_top = 4.0
|
||||||
@@ -424,118 +465,37 @@ text = "Total amount of games in the playlist: 9000"
|
|||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
vertical_alignment = 1
|
vertical_alignment = 1
|
||||||
|
|
||||||
[node name="AboutPopupPanel" type="PopupPanel" parent="."]
|
[node name="AboutWindow" parent="." unique_id=141261008 instance=ExtResource("16_about_window")]
|
||||||
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 = -4.0
|
|
||||||
offset_bottom = -4.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"]
|
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
custom_minimum_size = Vector2(692, 300)
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 1
|
||||||
texture = ExtResource("11_1qef0")
|
offset_left = 720.0
|
||||||
expand_mode = 3
|
offset_top = 153.0
|
||||||
stretch_mode = 5
|
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
|
unique_name_in_owner = true
|
||||||
texture_filter = 1
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 1
|
||||||
text = "Sansan won!!"
|
offset_left = 720.0
|
||||||
label_settings = SubResource("LabelSettings_hr75l")
|
offset_top = 153.0
|
||||||
horizontal_alignment = 1
|
offset_right = 720.0
|
||||||
vertical_alignment = 2
|
offset_bottom = 153.0
|
||||||
|
|
||||||
[node name="RepeatSongCheckButton" type="CheckButton" parent="."]
|
[node name="RepeatSongCheckButton" type="CheckButton" parent="." unique_id=776835053]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 64.0
|
offset_left = 64.0
|
||||||
offset_top = 1032.0
|
offset_top = 1032.0
|
||||||
offset_right = 208.0
|
offset_right = 208.0
|
||||||
offset_bottom = 1063.0
|
offset_bottom = 1063.0
|
||||||
focus_mode = 0
|
focus_mode = 0
|
||||||
|
button_pressed = true
|
||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Auto repeat"
|
text = "Auto repeat"
|
||||||
|
|
||||||
[node name="DebugLabel" type="Label" parent="."]
|
[node name="DebugLabel" type="Label" parent="." unique_id=1959221257]
|
||||||
|
visible = false
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 974.0
|
offset_left = 974.0
|
||||||
offset_top = 904.0
|
offset_top = 904.0
|
||||||
@@ -547,4 +507,13 @@ horizontal_alignment = 1
|
|||||||
vertical_alignment = 1
|
vertical_alignment = 1
|
||||||
autowrap_mode = 2
|
autowrap_mode = 2
|
||||||
|
|
||||||
|
[node name="Log" parent="." unique_id=1289881388 instance=ExtResource("14_26rwn")]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
|
layout_mode = 1
|
||||||
|
offset_left = 562.0
|
||||||
|
offset_top = 132.0
|
||||||
|
offset_right = 1262.0
|
||||||
|
offset_bottom = 832.0
|
||||||
|
|
||||||
[connection signal="dir_selected" from="FileDialog" to="." method="_on_file_dialog_dir_selected"]
|
[connection signal="dir_selected" from="FileDialog" to="." method="_on_file_dialog_dir_selected"]
|
||||||
|
|||||||
+35
-12
@@ -55,7 +55,8 @@ func _ready() -> void:
|
|||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
if audio_player.has_stream_playback() && !is_changing && !audio_player.stream_paused:
|
if audio_player.has_stream_playback() && !is_changing && !audio_player.stream_paused:
|
||||||
progress_slider.value = audio_player.get_playback_position()
|
if (!Settings.hide_beginning || audio_player.get_playback_position() > Settings.hide_for_seconds):
|
||||||
|
progress_slider.value = audio_player.get_playback_position()
|
||||||
if stream != null:
|
if stream != null:
|
||||||
music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
||||||
else:
|
else:
|
||||||
@@ -67,7 +68,14 @@ func format_time(time: float) -> String:
|
|||||||
return mins + ":" + sec
|
return mins + ":" + sec
|
||||||
|
|
||||||
func format_text(part: float, total: float) -> String:
|
func format_text(part: float, total: float) -> String:
|
||||||
return format_time(part) + " / " + format_time(total)
|
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:
|
func play_or_pause() -> void:
|
||||||
if song_finished:
|
if song_finished:
|
||||||
@@ -79,7 +87,10 @@ func play_or_pause() -> void:
|
|||||||
audio_player.seek(playback_position)
|
audio_player.seek(playback_position)
|
||||||
print("continue")
|
print("continue")
|
||||||
progress_slider.max_value = round(stream.get_length())
|
progress_slider.max_value = round(stream.get_length())
|
||||||
progress_slider.tick_count = round(stream.get_length() / 60)
|
if Settings.hide_ticks:
|
||||||
|
progress_slider.tick_count = 0
|
||||||
|
else:
|
||||||
|
progress_slider.tick_count = round(stream.get_length() / 60)
|
||||||
else:
|
else:
|
||||||
pause()
|
pause()
|
||||||
|
|
||||||
@@ -148,20 +159,23 @@ func play_sound(sound_name: AudioStream) -> void:
|
|||||||
song_finished = true
|
song_finished = true
|
||||||
play_button.texture_normal = play_icon
|
play_button.texture_normal = play_icon
|
||||||
progress_slider.value = 0
|
progress_slider.value = 0
|
||||||
if stream != null:
|
#if stream != null:
|
||||||
music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
# music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
||||||
|
|
||||||
func play_song(body: PackedByteArray) -> void:
|
func play_song(song: AudioStream) -> void:
|
||||||
var sound: AudioStream = AudioStreamMP3.new()
|
audio_player.stream = song
|
||||||
sound.data = body
|
|
||||||
audio_player.stream = sound
|
|
||||||
audio_player.play()
|
audio_player.play()
|
||||||
sound_player.stop()
|
sound_player.stop()
|
||||||
song_finished = false
|
song_finished = false
|
||||||
play_button.texture_normal = pause_icon
|
play_button.texture_normal = pause_icon
|
||||||
stream = audio_player.stream
|
stream = audio_player.stream
|
||||||
|
progress_slider.value = 0
|
||||||
progress_slider.max_value = round(stream.get_length())
|
progress_slider.max_value = round(stream.get_length())
|
||||||
progress_slider.tick_count = round(stream.get_length() / 60)
|
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:
|
func play_song_object(song_object_no: int) -> void:
|
||||||
print("play_song_object")
|
print("play_song_object")
|
||||||
@@ -174,8 +188,13 @@ func play_song_object(song_object_no: int) -> void:
|
|||||||
song_finished = false
|
song_finished = false
|
||||||
play_button.texture_normal = pause_icon
|
play_button.texture_normal = pause_icon
|
||||||
stream = audio_player.stream
|
stream = audio_player.stream
|
||||||
|
progress_slider.value = 0
|
||||||
progress_slider.max_value = round(stream.get_length())
|
progress_slider.max_value = round(stream.get_length())
|
||||||
progress_slider.tick_count = round(stream.get_length() / 60)
|
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.set_currently_playing_song(song_object_no)
|
||||||
Playlist.unset_is_playing()
|
Playlist.unset_is_playing()
|
||||||
if !Settings.hide_next_track:
|
if !Settings.hide_next_track:
|
||||||
@@ -186,7 +205,11 @@ func play_song_object(song_object_no: int) -> void:
|
|||||||
update_song_list.emit()
|
update_song_list.emit()
|
||||||
|
|
||||||
func get_sound_test_song() -> void:
|
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
|
##### LOCAL
|
||||||
var local_path: String = '/Users/sebastian/ResilioSync/Sorterat_test/Metal Gear Solid 4 - Guns of the Patriots/2-16 Metal Gear Saga.mp3'
|
var local_path: String = '/Users/sebastian/ResilioSync/Sorterat_test/Metal Gear Solid 4 - Guns of the Patriots/2-16 Metal Gear Saga.mp3'
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ scrollable = false
|
|||||||
|
|
||||||
[node name="MusicTimeLabel" type="Label" parent="MusicPlayerContainer"]
|
[node name="MusicTimeLabel" type="Label" parent="MusicPlayerContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "1:00 / 3:00"
|
text = "0:00 / 0:00"
|
||||||
|
|
||||||
[node name="VolumeSlider" parent="MusicPlayerContainer" instance=ExtResource("5_iifuj")]
|
[node name="VolumeSlider" parent="MusicPlayerContainer" instance=ExtResource("5_iifuj")]
|
||||||
custom_minimum_size = Vector2(100, 0)
|
custom_minimum_size = Vector2(100, 0)
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_821k2")
|
|||||||
custom_minimum_size = Vector2(130, 40)
|
custom_minimum_size = Vector2(130, 40)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 1
|
size_flags_vertical = 1
|
||||||
text = "Sansansans: 100"
|
text = ": 0"
|
||||||
vertical_alignment = 1
|
vertical_alignment = 1
|
||||||
|
|
||||||
[node name="Panel3" type="Panel" parent="HBoxContainer"]
|
[node name="Panel3" type="Panel" parent="HBoxContainer"]
|
||||||
|
|||||||
+41
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://bsa6xg5xos6h7
|
||||||
@@ -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
|
||||||
+61
-13
@@ -16,6 +16,7 @@ var close_button: Button = $CloseButton
|
|||||||
var search_bar: TextEdit = $Searchbar
|
var search_bar: TextEdit = $Searchbar
|
||||||
|
|
||||||
var games: Array = []
|
var games: Array = []
|
||||||
|
var regex: RegEx
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@@ -24,6 +25,7 @@ func _ready() -> void:
|
|||||||
search_bar.grab_focus()
|
search_bar.grab_focus()
|
||||||
search_bar.text_changed.connect(search)
|
search_bar.text_changed.connect(search)
|
||||||
visibility_changed.connect(focus)
|
visibility_changed.connect(focus)
|
||||||
|
regex = RegEx.new()
|
||||||
|
|
||||||
func focus() -> void:
|
func focus() -> void:
|
||||||
if self.visible == true:
|
if self.visible == true:
|
||||||
@@ -37,21 +39,25 @@ func close() -> void:
|
|||||||
func search() -> void:
|
func search() -> void:
|
||||||
print(search_bar.text)
|
print(search_bar.text)
|
||||||
Settings.delete_children(search_list)
|
Settings.delete_children(search_list)
|
||||||
|
var search_text: String = search_bar.text.to_lower()
|
||||||
for game: String in games:
|
for game: String in games:
|
||||||
if is_match_exact(search_bar.text, game):
|
if is_match_exact(search_text, game):
|
||||||
|
add_game(game)
|
||||||
|
var clean_search_text: String = clean_search_term(search_text)
|
||||||
|
for game: String in games:
|
||||||
|
if is_match_contains(clean_search_text, clean_game(game)):
|
||||||
add_game(game)
|
add_game(game)
|
||||||
for game: String in games:
|
for game: String in games:
|
||||||
if is_match_contains(clean_term(search_bar.text), clean_term(game)):
|
if is_match_regex(clean_search_text, clean_game(game)):
|
||||||
add_game(game)
|
|
||||||
for game: String in games:
|
|
||||||
if is_match_regex(clean_term(search_bar.text), clean_term(game)):
|
|
||||||
add_game(game)
|
add_game(game)
|
||||||
|
|
||||||
func clean_term(term: String) -> String:
|
func clean_search_term(term: String) -> String:
|
||||||
|
return term.replace(" ", "").replace("é", "e").replace("+", "plus").replace("&", "and").replace("'n", "and")
|
||||||
|
|
||||||
|
func clean_game(term: String) -> String:
|
||||||
return term.replace(" ", "").replace("é", "e").replace("+", "plus").replace("&", "and").replace("'n", "and").to_lower()
|
return term.replace(" ", "").replace("é", "e").replace("+", "plus").replace("&", "and").replace("'n", "and").to_lower()
|
||||||
|
|
||||||
func is_match_exact(search_term: String, game_name: String) -> bool:
|
func is_match_exact(search_term: String, game_name: String) -> bool:
|
||||||
search_term = search_term.to_lower()
|
|
||||||
game_name = game_name.to_lower()
|
game_name = game_name.to_lower()
|
||||||
|
|
||||||
if search_term == "":
|
if search_term == "":
|
||||||
@@ -78,7 +84,7 @@ func is_match_regex(search_term: String, game_name: String) -> bool:
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
func add_game(game: String) -> void:
|
func add_game(game: String) -> void:
|
||||||
var label := Label.new()
|
var label: Label = Label.new()
|
||||||
label.text = game
|
label.text = game
|
||||||
print("game: " + game)
|
print("game: " + game)
|
||||||
label.autowrap_mode = TextServer.AUTOWRAP_WORD
|
label.autowrap_mode = TextServer.AUTOWRAP_WORD
|
||||||
@@ -93,22 +99,21 @@ func check_if_game_exists(game: String) -> bool:
|
|||||||
return game_exists
|
return game_exists
|
||||||
|
|
||||||
func compile_regex(search_term: String) -> RegEx:
|
func compile_regex(search_term: String) -> RegEx:
|
||||||
var regex = RegEx.new()
|
|
||||||
var regText: String = ".*"
|
var regText: String = ".*"
|
||||||
for letter in search_term:
|
for letter: String in search_term:
|
||||||
regText += letter + ".*"
|
regText += letter + ".*"
|
||||||
regex.compile(regText)
|
regex.compile(regText)
|
||||||
return regex
|
return regex
|
||||||
|
|
||||||
func get_list_of_games() -> void:
|
func get_list_of_games() -> void:
|
||||||
print("get_list_of_games")
|
print("get_list_of_games")
|
||||||
var handle_games: Callable = func handle_games(array) -> void:
|
var handle_games: Callable = func handle_games(array: Array) -> void:
|
||||||
if typeof(array) == TYPE_ARRAY:
|
if typeof(array) == TYPE_ARRAY:
|
||||||
games = []
|
games = []
|
||||||
Settings.delete_children(search_list)
|
Settings.delete_children(search_list)
|
||||||
games.append_array(array)
|
games.append_array(array)
|
||||||
for game in games:
|
for game: String in games:
|
||||||
var label := Label.new()
|
var label: Label = Label.new()
|
||||||
label.text = game
|
label.text = game
|
||||||
label.autowrap_mode = TextServer.AUTOWRAP_WORD
|
label.autowrap_mode = TextServer.AUTOWRAP_WORD
|
||||||
search_list.add_child(label)
|
search_list.add_child(label)
|
||||||
@@ -128,3 +133,46 @@ func clear() -> void:
|
|||||||
search()
|
search()
|
||||||
search_bar.grab_focus()
|
search_bar.grab_focus()
|
||||||
|
|
||||||
|
func old_search() -> void:
|
||||||
|
print(search_bar.text)
|
||||||
|
Settings.delete_children(search_list)
|
||||||
|
for game: String in games:
|
||||||
|
if old_is_match_exact(search_bar.text, game):
|
||||||
|
add_game(game)
|
||||||
|
for game: String in games:
|
||||||
|
if is_match_contains(clean_term(search_bar.text), clean_term(game)):
|
||||||
|
add_game(game)
|
||||||
|
for game: String in games:
|
||||||
|
if old_is_match_regex(clean_term(search_bar.text), clean_term(game)):
|
||||||
|
add_game(game)
|
||||||
|
|
||||||
|
func clean_term(term: String) -> String:
|
||||||
|
return term.replace(" ", "").replace("é", "e").replace("+", "plus").replace("&", "and").replace("'n", "and").to_lower()
|
||||||
|
|
||||||
|
|
||||||
|
func old_is_match_exact(search_term: String, game_name: String) -> bool:
|
||||||
|
search_term = search_term.to_lower()
|
||||||
|
game_name = game_name.to_lower()
|
||||||
|
|
||||||
|
if search_term == "":
|
||||||
|
return true
|
||||||
|
elif game_name.contains(search_term):
|
||||||
|
return true
|
||||||
|
else:
|
||||||
|
return false
|
||||||
|
|
||||||
|
func old_is_match_regex(search_term: String, game_name: String) -> bool:
|
||||||
|
if search_term == "":
|
||||||
|
return true
|
||||||
|
elif compile_regex(search_term).search(game_name):
|
||||||
|
return true
|
||||||
|
else:
|
||||||
|
return false
|
||||||
|
|
||||||
|
func old_compile_regex(search_term: String) -> RegEx:
|
||||||
|
var regex = RegEx.new()
|
||||||
|
var regText: String = ".*"
|
||||||
|
for letter in search_term:
|
||||||
|
regText += letter + ".*"
|
||||||
|
regex.compile(regText)
|
||||||
|
return regex
|
||||||
|
|||||||
+10
-41
@@ -1,65 +1,34 @@
|
|||||||
extends Node
|
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 selected_server: int = 0
|
||||||
#var default_path: String = "https://tmusic.sanplex.tech"
|
|
||||||
#var selected_server: int = 1
|
|
||||||
|
|
||||||
var is_local: bool = false
|
var is_local: bool = false
|
||||||
|
|
||||||
var is_debug: bool = false
|
var is_debug: bool = false
|
||||||
|
|
||||||
var stop_after_current: bool = true
|
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 hide_next_track: bool = true
|
||||||
var add_to_stats: bool = true
|
var add_to_stats: bool = true
|
||||||
var use_low_played_mode: bool = false
|
var use_low_played_mode: bool = false
|
||||||
var winning_score: int = 20
|
var winning_score: int = 20
|
||||||
var fullscreen: bool = false
|
var fullscreen: bool = false
|
||||||
var play_local: 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 player_array: Array[PlayerObject]
|
||||||
var edit_players: bool = false
|
var edit_players: bool = false
|
||||||
var currently_syncing: bool = false
|
var currently_syncing: bool = false
|
||||||
var character_select_open: bool = false
|
var character_select_open: bool = false
|
||||||
|
|
||||||
var version: String = "1.6.0"
|
var version: String = "1.8.5"
|
||||||
|
|
||||||
var whats_new: String = "Changelog:
|
|
||||||
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"
|
|
||||||
|
|
||||||
func make_request2(address: String, func_name: Callable, expect_data: bool) -> void:
|
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:
|
var error_handling: Callable = func(_result: int, response_code: int, _headers: PackedStringArray, body: PackedByteArray) -> void:
|
||||||
|
|||||||
+92
-3
@@ -15,6 +15,15 @@ var add_to_database_button: CheckButton = %AddToDatabaseCheckButton
|
|||||||
@onready
|
@onready
|
||||||
var low_played_button: CheckButton = %LowPlayedCheckButton
|
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
|
@onready
|
||||||
var score_label: Label = %ScoreLabel
|
var score_label: Label = %ScoreLabel
|
||||||
|
|
||||||
@@ -33,15 +42,30 @@ var lower_cache_button: Button = %LowerCacheButton
|
|||||||
@onready
|
@onready
|
||||||
var increase_cache_button: Button = %IncreaseCacheButton
|
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
|
@onready
|
||||||
var select_server_button: OptionButton = %SelectServerButton
|
var select_server_button: OptionButton = %SelectServerButton
|
||||||
|
|
||||||
@onready
|
@onready
|
||||||
var fullscreen_button: CheckButton = %FullscreenButton
|
var fullscreen_button: CheckButton = %FullscreenButton
|
||||||
|
|
||||||
#@onready
|
|
||||||
#var quick_sync_button := $QuickSyncButton
|
|
||||||
|
|
||||||
@onready
|
@onready
|
||||||
var local_button: CheckButton = %LocalButton
|
var local_button: CheckButton = %LocalButton
|
||||||
|
|
||||||
@@ -56,10 +80,17 @@ func _ready() -> void:
|
|||||||
hide_next_track_button.pressed.connect(hide_next_track)
|
hide_next_track_button.pressed.connect(hide_next_track)
|
||||||
add_to_database_button.pressed.connect(add_to_database)
|
add_to_database_button.pressed.connect(add_to_database)
|
||||||
low_played_button.pressed.connect(low_played)
|
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)
|
lower_winning_score_button.pressed.connect(lower_winning_score)
|
||||||
increase_winning_score_button.pressed.connect(increase_winning_score)
|
increase_winning_score_button.pressed.connect(increase_winning_score)
|
||||||
lower_cache_button.pressed.connect(lower_cache)
|
lower_cache_button.pressed.connect(lower_cache)
|
||||||
increase_cache_button.pressed.connect(increase_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)
|
fullscreen_button.pressed.connect(fullscreen)
|
||||||
local_button.pressed.connect(local_play)
|
local_button.pressed.connect(local_play)
|
||||||
|
|
||||||
@@ -67,9 +98,15 @@ func _ready() -> void:
|
|||||||
hide_next_track_button.button_pressed = Settings.hide_next_track
|
hide_next_track_button.button_pressed = Settings.hide_next_track
|
||||||
add_to_database_button.button_pressed = Settings.add_to_stats
|
add_to_database_button.button_pressed = Settings.add_to_stats
|
||||||
low_played_button.button_pressed = Settings.use_low_played_mode
|
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)
|
score_label.text = str(Settings.winning_score)
|
||||||
cache_label.text = str(Playlist.number_of_tracks_to_preload)
|
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
|
fullscreen_button.button_pressed = Settings.fullscreen
|
||||||
|
update_hide_for_seconds_enabled()
|
||||||
select_server_button.select(Settings.selected_server)
|
select_server_button.select(Settings.selected_server)
|
||||||
select_server_button.item_selected.connect(select_server)
|
select_server_button.item_selected.connect(select_server)
|
||||||
|
|
||||||
@@ -102,6 +139,20 @@ func add_to_database() -> void:
|
|||||||
func low_played() -> void:
|
func low_played() -> void:
|
||||||
Settings.use_low_played_mode = !Settings.use_low_played_mode
|
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:
|
func lower_winning_score() -> void:
|
||||||
Settings.winning_score -= 1
|
Settings.winning_score -= 1
|
||||||
score_label.text = str(Settings.winning_score)
|
score_label.text = str(Settings.winning_score)
|
||||||
@@ -110,6 +161,10 @@ func increase_winning_score() -> void:
|
|||||||
Settings.winning_score += 1
|
Settings.winning_score += 1
|
||||||
score_label.text = str(Settings.winning_score)
|
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:
|
func lower_cache() -> void:
|
||||||
Playlist.number_of_tracks_to_preload -= 1
|
Playlist.number_of_tracks_to_preload -= 1
|
||||||
if 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
|
Playlist.number_of_tracks_to_preload += 1
|
||||||
cache_label.text = str(Playlist.number_of_tracks_to_preload)
|
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:
|
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.default_path = select_server_button.get_item_text(new_server)
|
||||||
Settings.selected_server = new_server
|
Settings.selected_server = new_server
|
||||||
print("Settings.default_path: " + Settings.default_path)
|
print("Settings.default_path: " + Settings.default_path)
|
||||||
|
|||||||
+107
-28
@@ -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"]
|
[ext_resource type="Script" uid="uid://dukqyjoduf1af" path="res://SettingsWindow.gd" id="1_bt55j"]
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_3xrlm"]
|
[sub_resource type="LabelSettings" id="LabelSettings_3xrlm"]
|
||||||
font_size = 25
|
font_size = 25
|
||||||
|
|
||||||
[node name="SettingsControl" type="Control"]
|
[node name="SettingsControl" type="Control" unique_id=1298840328]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@@ -14,30 +14,30 @@ grow_horizontal = 2
|
|||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
script = ExtResource("1_bt55j")
|
script = ExtResource("1_bt55j")
|
||||||
|
|
||||||
[node name="SettingsPanel" type="Panel" parent="."]
|
[node name="SettingsPanel" type="Panel" parent="." unique_id=45537159]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_right = 500.0
|
offset_right = 500.0
|
||||||
offset_bottom = 640.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
|
layout_mode = 0
|
||||||
offset_right = 500.0
|
offset_right = 500.0
|
||||||
offset_bottom = 640.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
|
clip_contents = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
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
|
layout_mode = 2
|
||||||
size_flags_vertical = 0
|
size_flags_vertical = 0
|
||||||
text = "Settings"
|
text = "Settings"
|
||||||
label_settings = SubResource("LabelSettings_3xrlm")
|
label_settings = SubResource("LabelSettings_3xrlm")
|
||||||
horizontal_alignment = 1
|
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
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
@@ -45,7 +45,7 @@ button_pressed = true
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Stop after current"
|
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
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
@@ -53,33 +53,84 @@ button_pressed = true
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Hide next track"
|
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
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Turn on played to database"
|
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
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Use low played mode"
|
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
|
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
|
layout_mode = 2
|
||||||
text = "Winning Score: "
|
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
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "20"
|
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
|
unique_name_in_owner = true
|
||||||
custom_minimum_size = Vector2(30, 2.08165e-12)
|
custom_minimum_size = Vector2(30, 2.08165e-12)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -87,7 +138,7 @@ focus_mode = 0
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "-1"
|
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
|
unique_name_in_owner = true
|
||||||
custom_minimum_size = Vector2(30, 2.08165e-12)
|
custom_minimum_size = Vector2(30, 2.08165e-12)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -95,19 +146,19 @@ focus_mode = 0
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "+1"
|
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
|
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
|
layout_mode = 2
|
||||||
text = "Predownload songs: "
|
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
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "1"
|
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
|
unique_name_in_owner = true
|
||||||
custom_minimum_size = Vector2(30, 2.08165e-12)
|
custom_minimum_size = Vector2(30, 2.08165e-12)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -115,7 +166,7 @@ focus_mode = 0
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "-1"
|
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
|
unique_name_in_owner = true
|
||||||
custom_minimum_size = Vector2(30, 2.08165e-12)
|
custom_minimum_size = Vector2(30, 2.08165e-12)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -123,29 +174,57 @@ focus_mode = 0
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "+1"
|
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
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
selected = 0
|
selected = 0
|
||||||
item_count = 5
|
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_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_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_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_3/id = 4
|
||||||
popup/item_4/text = "http://localhost:8080"
|
popup/item_4/text = "http://localhost:8080"
|
||||||
popup/item_4/id = 5
|
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
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
text = "Fullscreen"
|
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
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
@@ -153,7 +232,7 @@ button_pressed = true
|
|||||||
action_mode = 0
|
action_mode = 0
|
||||||
text = "Quick sync"
|
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
|
unique_name_in_owner = true
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|||||||
+1
-2
@@ -42,8 +42,7 @@ func get_song_info() -> String:
|
|||||||
|
|
||||||
func add_point(id: int) -> void:
|
func add_point(id: int) -> void:
|
||||||
print("add_point")
|
print("add_point")
|
||||||
if !players_given_point.has(id):
|
players_given_point.append(id)
|
||||||
players_given_point.append(id)
|
|
||||||
players_given_point.sort()
|
players_given_point.sort()
|
||||||
|
|
||||||
func remove_point(id: int) -> void:
|
func remove_point(id: int) -> void:
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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.
|
||||||
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://dyt1tls86b518
|
||||||
@@ -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 |
@@ -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
|
||||||
@@ -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"
|
||||||
@@ -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")
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://bepdve2jn8q0i
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
|||||||
|
uid://c7aw4f3o7g8sc
|
||||||
@@ -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
|
||||||
@@ -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
@@ -0,0 +1 @@
|
|||||||
|
uid://8yd22fd2gbxt
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
@onready
|
||||||
|
var log_panel: Panel = %LogPanel
|
||||||
|
|
||||||
|
@onready
|
||||||
|
var log_box: VBoxContainer = %LogVBoxContainer
|
||||||
|
|
||||||
|
var log_rows: Array
|
||||||
|
|
||||||
|
func add_log_row(text: String) -> void:
|
||||||
|
var log_row: String = get_time() + text
|
||||||
|
log_rows.append(log_row)
|
||||||
|
update_log()
|
||||||
|
|
||||||
|
func update_log() -> void:
|
||||||
|
print("update_log")
|
||||||
|
Settings.delete_children(log_box)
|
||||||
|
for row: String in log_rows:
|
||||||
|
var log_label: Label = Label.new()
|
||||||
|
log_label.set_texture_filter(TextureFilter.TEXTURE_FILTER_NEAREST)
|
||||||
|
log_label.add_theme_font_size_override("font_size", 20)
|
||||||
|
log_label.text = row
|
||||||
|
log_label.autowrap_mode = TextServer.AUTOWRAP_WORD
|
||||||
|
log_box.add_child(log_label)
|
||||||
|
|
||||||
|
func get_time() -> String:
|
||||||
|
var dateTime: Dictionary = Time.get_datetime_dict_from_system()
|
||||||
|
return "" + str(dateTime.hour) + ":" + str(dateTime.minute) + ":" + str(dateTime.second) + " "
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://cw41y87l64qo7
|
||||||
@@ -3,6 +3,9 @@ extends Control
|
|||||||
@onready
|
@onready
|
||||||
var character_panel: Panel = %CharacterPanel
|
var character_panel: Panel = %CharacterPanel
|
||||||
|
|
||||||
|
@onready
|
||||||
|
var title_label: Label = %TitleLabel
|
||||||
|
|
||||||
@onready
|
@onready
|
||||||
var character_grid: GridContainer = %CharacterGridContainer
|
var character_grid: GridContainer = %CharacterGridContainer
|
||||||
|
|
||||||
@@ -42,8 +45,10 @@ func load_characters() -> void:
|
|||||||
character_box.connect("new_character_selected", _on_character_selected)
|
character_box.connect("new_character_selected", _on_character_selected)
|
||||||
Settings.make_request2("/characters", fetch_character_list, true)
|
Settings.make_request2("/characters", fetch_character_list, true)
|
||||||
|
|
||||||
func show_grid() -> void:
|
func show_grid(player_name: String) -> void:
|
||||||
print("show_grid")
|
print("show_grid")
|
||||||
|
title_label.text = "Select character for " + player_name
|
||||||
|
close_timer.stop()
|
||||||
self.visible = true
|
self.visible = true
|
||||||
Settings.character_select_open = true
|
Settings.character_select_open = true
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ offset_right = 1263.0
|
|||||||
offset_bottom = 659.0
|
offset_bottom = 659.0
|
||||||
size_flags_horizontal = 3
|
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
|
layout_mode = 2
|
||||||
size_flags_vertical = 0
|
size_flags_vertical = 0
|
||||||
text = "Character Select"
|
text = "Character Select"
|
||||||
|
|||||||
+9
-1
@@ -8,11 +8,15 @@
|
|||||||
|
|
||||||
config_version=5
|
config_version=5
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
|
||||||
|
compatibility/default_parent_skeleton_in_mesh_instance_3d=true
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="MusicPlayer"
|
config/name="MusicPlayer"
|
||||||
run/main_scene="res://MainWindow.tscn"
|
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"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
[autoload]
|
[autoload]
|
||||||
@@ -37,6 +41,10 @@ window/vsync/vsync_mode=2
|
|||||||
|
|
||||||
project/assembly_name="MusicPlayer"
|
project/assembly_name="MusicPlayer"
|
||||||
|
|
||||||
|
[editor_plugins]
|
||||||
|
|
||||||
|
enabled=PackedStringArray("res://addons/kenyoni/qr_code/plugin.cfg")
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
ui_accept={
|
ui_accept={
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://rolypd0cqd6h
|
||||||
+11
-7
@@ -59,6 +59,8 @@ var sync_timer: Timer = %SyncTimer
|
|||||||
|
|
||||||
var changes: bool = false
|
var changes: bool = false
|
||||||
|
|
||||||
|
var has_synced: bool = false
|
||||||
|
|
||||||
signal sync_started
|
signal sync_started
|
||||||
signal sync_finished
|
signal sync_finished
|
||||||
|
|
||||||
@@ -75,13 +77,14 @@ func _input(event: InputEvent) -> void:
|
|||||||
func start_sync() -> void:
|
func start_sync() -> void:
|
||||||
print("start_sync")
|
print("start_sync")
|
||||||
self.visible = true
|
self.visible = true
|
||||||
var sync_request_sent: Callable = func sync_request_sent() -> void:
|
if !has_synced:
|
||||||
sync_timer.start(0.75)
|
var sync_request_sent: Callable = func sync_request_sent() -> void:
|
||||||
Settings.currently_syncing = true
|
sync_timer.start(0.75)
|
||||||
sync_started.emit()
|
Settings.currently_syncing = true
|
||||||
show_sync_progress()
|
sync_started.emit()
|
||||||
if !Settings.currently_syncing:
|
show_sync_progress()
|
||||||
Settings.make_request2("/sync", sync_request_sent, false)
|
if !Settings.currently_syncing:
|
||||||
|
Settings.make_request2("/sync", sync_request_sent, false)
|
||||||
|
|
||||||
func _on_sync_timeout() -> void:
|
func _on_sync_timeout() -> void:
|
||||||
print("_on_sync_timeout!")
|
print("_on_sync_timeout!")
|
||||||
@@ -97,6 +100,7 @@ func _on_sync_timeout() -> void:
|
|||||||
Settings.make_request2("/sync/progress", get_progress, true)
|
Settings.make_request2("/sync/progress", get_progress, true)
|
||||||
|
|
||||||
func on_sync_finished(data_received: Dictionary) -> void:
|
func on_sync_finished(data_received: Dictionary) -> void:
|
||||||
|
has_synced = true
|
||||||
reset_sync_result()
|
reset_sync_result()
|
||||||
if data_received.games_added != null:
|
if data_received.games_added != null:
|
||||||
changes = true
|
changes = true
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://dxpb22xbwf3t1
|
||||||
Reference in New Issue
Block a user