Follow the GDScript style guide in every script
- Types on every parameter, return value and variable, and snake_case names (the player name limit is the constant MAX_NAME_LENGTH). - Spelling fixes: *_triggered, character_selected, separator, caught_errors. The server's catched_errors key stays as the server sends it. - Signals are connected with signal.connect() instead of by name. - Code is ordered signals, constants, exported vars, vars, @onready vars, functions, with @onready on one line and two blank lines between functions. - Every script starts with a ## description. Template comments, old LOC notes and commented-out code are gone, apart from the local play code. - Lines are at most 100 characters, apart from the local play path. - The screenshot tour turns off the blinking text cursor so pictures match.
This commit is contained in:
1 parent
674604425f
commit
a0428e3475
45 files changed
+580
-589
No files matched your search
+7
-20
@@ -1,33 +1,19 @@
|
||||
class_name SongRow
|
||||
extends PanelContainer
|
||||
|
||||
@onready
|
||||
var song_list_label: Label = %SongListLabel
|
||||
|
||||
@onready
|
||||
var song_list_players: HBoxContainer = %SongListPlayers
|
||||
## One song in the music list: its number, soundtrack and title, and a marker for
|
||||
## each player who got a point for it.
|
||||
|
||||
var song_object: SongObject
|
||||
|
||||
#Color(0.18, 0.18, 0.18)
|
||||
#Color(0.302, 0.302, 0.302)
|
||||
#Color(0.259, 0.259, 0.259)
|
||||
@onready var song_list_label: Label = %SongListLabel
|
||||
@onready var song_list_players: HBoxContainer = %SongListPlayers
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
#if song_object != null && song_object.song_number % 2 == 0:
|
||||
# var new_stylebox_normal = self.get_theme_stylebox("panel").duplicate()
|
||||
# new_stylebox_normal.bg_color = Color(0.18, 0.18, 0.18)
|
||||
# self.add_theme_stylebox_override("panel", new_stylebox_normal)
|
||||
# song_list_label.add_theme_stylebox_override("normal", new_stylebox_normal)
|
||||
#else:
|
||||
# var new_stylebox_normal = self.get_theme_stylebox("panel").duplicate()
|
||||
# new_stylebox_normal.bg_color = Color(0.18, 0.18, 0.18)
|
||||
# self.add_theme_stylebox_override("panel", new_stylebox_normal)
|
||||
# song_list_label.add_theme_stylebox_override("normal", new_stylebox_normal)
|
||||
set_label()
|
||||
update_players()
|
||||
|
||||
|
||||
func set_label() -> void:
|
||||
if song_object != null:
|
||||
var size_to_change: int = song_object.players_given_point.size() * 50
|
||||
@@ -36,6 +22,7 @@ func set_label() -> void:
|
||||
song_list_label.add_theme_color_override("font_color", Color(1, 0.5, 0))
|
||||
song_list_label.text = song_object.get_song_info()
|
||||
|
||||
|
||||
func update_players() -> void:
|
||||
Settings.delete_children(song_list_players)
|
||||
if song_object != null:
|
||||
|
||||
Reference in new issue
Block a user