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
+10
-14
@@ -1,11 +1,6 @@
|
||||
class_name ShortcutsPopup
|
||||
extends BasePopup
|
||||
|
||||
@onready
|
||||
var shortcuts_vbox: VBoxContainer = %shortcutsVBox
|
||||
|
||||
@onready
|
||||
var shortcuts_panel: Panel = %ShortcutsPanel
|
||||
## Lists the keyboard shortcuts. Opened with Alt+K or the Shortcuts button.
|
||||
|
||||
var shortcuts_dic: Dictionary = {
|
||||
"Alt + S": "Search",
|
||||
@@ -26,14 +21,17 @@ var shortcuts_dic: Dictionary = {
|
||||
"Alt + Ctrl + 1 - 9": "Take point from player",
|
||||
}
|
||||
|
||||
@onready var shortcuts_vbox: VBoxContainer = %shortcutsVBox
|
||||
@onready var shortcuts_panel: Panel = %ShortcutsPanel
|
||||
|
||||
|
||||
#Color(0.18, 0.18, 0.18)
|
||||
#Color(0.302, 0.302, 0.302)
|
||||
#Color(0.259, 0.259, 0.259)
|
||||
|
||||
func _ready() -> void:
|
||||
shortcuts_dic.sort()
|
||||
Settings.delete_children(shortcuts_vbox)
|
||||
|
||||
|
||||
var title: Label = Label.new()
|
||||
title.add_theme_font_size_override("font_size", 20)
|
||||
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
@@ -45,28 +43,26 @@ func _ready() -> void:
|
||||
var panel: PanelContainer = PanelContainer.new()
|
||||
var hbox: HBoxContainer = HBoxContainer.new()
|
||||
hbox.alignment = BoxContainer.ALIGNMENT_CENTER
|
||||
|
||||
|
||||
var label: Label = Label.new()
|
||||
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.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)
|
||||
|
||||
Reference in new issue
Block a user