Put the whole look into one project theme
themes/main_theme.tres is the project theme. It holds Godot's default look for every control type the game uses, plus named styles for the game's own look (popups, the background, spacers, list rows, title and text sizes, highlights) and a palette for the popup dimming. Scenes and scripts name these styles instead of setting colours, sizes or style boxes, and the five old theme files are gone. themes/README.md explains the styles and how to make a new theme. The screenshot tour now uses the real character pictures, so the layout baseline is taken again. Screenshots are pixel-identical to before, and test_theme.gd checks that the look stays in the theme.
This commit was merged in pull request #36.
This commit is contained in:
1 parent
a7bf38c5f9
commit
8b71723a34
39 files changed
+3283
-1869
No files matched your search
@@ -1,10 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://cp54idaudb8dp"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b7bh0of7olbcb" path="res://popups/about_popup.gd" id="1_about_script"]
|
||||
[ext_resource type="Theme" path="res://themes/popup_theme.tres" id="popup_theme"]
|
||||
|
||||
[node name="AboutPopup" type="Control" unique_id=1626010355 node_paths=PackedStringArray("panel")]
|
||||
theme = ExtResource("popup_theme")
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -19,6 +17,7 @@ unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 600.0
|
||||
offset_bottom = 640.0
|
||||
theme_type_variation = &"PopupBackground"
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="AboutPanel" unique_id=200295721]
|
||||
layout_mode = 0
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://c7ecjj2af6usf"]
|
||||
[gd_scene format=3 uid="uid://c7ecjj2af6usf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://i35b3scbpwpu" path="res://popups/character_card.gd" id="1_pjt0s"]
|
||||
[ext_resource type="Texture2D" uid="uid://cv3hdd6bsruau" path="res://icon.svg" id="2_pjt0s"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pjt0s"]
|
||||
bg_color = Color(0.302, 0.302, 0.302, 1)
|
||||
|
||||
[node name="CharacterCard" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
@@ -15,7 +12,7 @@ script = ExtResource("1_pjt0s")
|
||||
layout_mode = 0
|
||||
offset_right = 240.0
|
||||
offset_bottom = 145.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_pjt0s")
|
||||
theme_type_variation = &"CharacterCard"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel"]
|
||||
layout_mode = 0
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cdy4kvemwaiom"]
|
||||
[gd_scene format=3 uid="uid://cdy4kvemwaiom"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cvffg87wr6r3y" path="res://popups/character_select_popup.gd" id="1_h4tdp"]
|
||||
[ext_resource type="Theme" path="res://themes/popup_theme.tres" id="popup_theme"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_p4iny"]
|
||||
font_size = 25
|
||||
|
||||
[node name="CharacterSelectPopup" type="Control" node_paths=PackedStringArray("panel")]
|
||||
theme = ExtResource("popup_theme")
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_h4tdp")
|
||||
@@ -18,6 +13,7 @@ unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 1290.0
|
||||
offset_bottom = 665.0
|
||||
theme_type_variation = &"PopupBackground"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CharacterPanel"]
|
||||
layout_mode = 0
|
||||
@@ -29,8 +25,8 @@ size_flags_horizontal = 3
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme_type_variation = &"Title"
|
||||
text = "Character Select"
|
||||
label_settings = SubResource("LabelSettings_p4iny")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="CharacterPanel/VBoxContainer"]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bijh5h5yrivm3"]
|
||||
[gd_scene format=3 uid="uid://bijh5h5yrivm3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cw41y87l64qo7" path="res://popups/log_popup.gd" id="1_q72ua"]
|
||||
[ext_resource type="Theme" path="res://themes/popup_theme.tres" id="popup_theme"]
|
||||
|
||||
[node name="LogPopup" type="Control" node_paths=PackedStringArray("panel")]
|
||||
theme = ExtResource("popup_theme")
|
||||
custom_minimum_size = Vector2(700, 700)
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@@ -22,13 +20,14 @@ custom_minimum_size = Vector2(700, 700)
|
||||
layout_mode = 0
|
||||
offset_right = 700.0
|
||||
offset_bottom = 700.0
|
||||
theme_type_variation = &"PopupBackground"
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="LogPanel"]
|
||||
layout_mode = 0
|
||||
offset_top = 8.0
|
||||
offset_right = 700.0
|
||||
offset_bottom = 48.0
|
||||
theme_override_font_sizes/font_size = 25
|
||||
theme_type_variation = &"Title"
|
||||
text = "Log"
|
||||
horizontal_alignment = 1
|
||||
|
||||
|
||||
+1
-2
@@ -2,10 +2,8 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://bsa6xg5xos6h7" path="res://popups/qr_popup.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"]
|
||||
[ext_resource type="Theme" path="res://themes/popup_theme.tres" id="popup_theme"]
|
||||
|
||||
[node name="QRPopup" type="Control" unique_id=1996957585 node_paths=PackedStringArray("panel")]
|
||||
theme = ExtResource("popup_theme")
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -20,6 +18,7 @@ unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 450.0
|
||||
offset_bottom = 520.0
|
||||
theme_type_variation = &"PopupBackground"
|
||||
|
||||
[node name="QRCodeRect" type="TextureRect" parent="QRPanel" unique_id=1054378438]
|
||||
unique_name_in_owner = true
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://bxydgil1yifps"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bg5yo08638600" path="res://popups/search_popup.gd" id="1_m7bij"]
|
||||
[ext_resource type="Theme" path="res://themes/popup_theme.tres" id="popup_theme"]
|
||||
|
||||
[node name="SearchPopup" type="Control" unique_id=616238617 node_paths=PackedStringArray("panel")]
|
||||
theme = ExtResource("popup_theme")
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -19,6 +17,7 @@ unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 640.0
|
||||
theme_type_variation = &"PopupBackground"
|
||||
|
||||
[node name="ClearButton" type="Button" parent="." unique_id=1549439398]
|
||||
layout_mode = 0
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://dldpeo5y3l5hq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dukqyjoduf1af" path="res://popups/settings_popup.gd" id="1_bt55j"]
|
||||
[ext_resource type="Theme" path="res://themes/popup_theme.tres" id="popup_theme"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_3xrlm"]
|
||||
font_size = 25
|
||||
|
||||
[node name="SettingsPopup" type="Control" unique_id=1298840328 node_paths=PackedStringArray("panel")]
|
||||
theme = ExtResource("popup_theme")
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -22,6 +17,7 @@ unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 500.0
|
||||
offset_bottom = 640.0
|
||||
theme_type_variation = &"PopupBackground"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="SettingsPanel" unique_id=1325795358]
|
||||
layout_mode = 0
|
||||
@@ -39,8 +35,8 @@ size_flags_horizontal = 3
|
||||
[node name="Label" type="Label" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=1111531402]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme_type_variation = &"Title"
|
||||
text = "Settings"
|
||||
label_settings = SubResource("LabelSettings_3xrlm")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="StopAfterCurrentCheckButton" type="CheckButton" parent="SettingsPanel/ScrollContainer/VBoxContainer" unique_id=508305575]
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bd1by80q1v27e"]
|
||||
[gd_scene format=3 uid="uid://bd1by80q1v27e"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://rolypd0cqd6h" path="res://popups/shortcuts_popup.gd" id="1_12pxi"]
|
||||
[ext_resource type="Theme" path="res://themes/popup_theme.tres" id="popup_theme"]
|
||||
|
||||
[node name="ShortcutsPopup" type="Control" node_paths=PackedStringArray("panel")]
|
||||
theme = ExtResource("popup_theme")
|
||||
custom_minimum_size = Vector2(700, 700)
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@@ -21,6 +19,7 @@ custom_minimum_size = Vector2(700, 700)
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
theme_type_variation = &"PopupBackground"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="ShortcutsPanel"]
|
||||
custom_minimum_size = Vector2(700, 700)
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
[gd_scene format=3 uid="uid://dpdem7pdxweb5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3ejukwth512a" path="res://popups/sync_popup.gd" id="1_8ba47"]
|
||||
[ext_resource type="Theme" path="res://themes/popup_theme.tres" id="popup_theme"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_anbfi"]
|
||||
font_size = 25
|
||||
|
||||
[node name="SyncPopup" type="Control" unique_id=1302914356 node_paths=PackedStringArray("panel")]
|
||||
theme = ExtResource("popup_theme")
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -22,6 +17,7 @@ unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 1500.0
|
||||
offset_bottom = 640.0
|
||||
theme_type_variation = &"PopupBackground"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="SyncPanel" unique_id=1289116349]
|
||||
layout_mode = 0
|
||||
@@ -40,8 +36,8 @@ theme_override_constants/separation = 12
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme_type_variation = &"Title"
|
||||
text = "Sync"
|
||||
label_settings = SubResource("LabelSettings_anbfi")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="SyncTime" type="Label" parent="SyncPanel/ScrollContainer/SyncVBoxContainer" unique_id=1344333200]
|
||||
@@ -55,8 +51,8 @@ unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme_type_variation = &"Title"
|
||||
text = "No changes since last sync"
|
||||
label_settings = SubResource("LabelSettings_anbfi")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ProgressHBoxContainer" type="HBoxContainer" parent="SyncPanel/ScrollContainer/SyncVBoxContainer" unique_id=196414805]
|
||||
|
||||
@@ -2,13 +2,8 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://dxpb22xbwf3t1" path="res://popups/winner_popup.gd" id="1_winner_script"]
|
||||
[ext_resource type="Texture2D" uid="uid://r4as0nmtoa7p" path="res://noCharacter.png" id="2_no_character"]
|
||||
[ext_resource type="Theme" path="res://themes/popup_theme.tres" id="popup_theme"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_hr75l"]
|
||||
font_size = 35
|
||||
|
||||
[node name="WinnerPopup" type="Control" unique_id=1111111111 node_paths=PackedStringArray("panel")]
|
||||
theme = ExtResource("popup_theme")
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -23,6 +18,7 @@ unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 500.0
|
||||
offset_bottom = 600.0
|
||||
theme_type_variation = &"PopupBackground"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="WinnerPanel" unique_id=471159349]
|
||||
layout_mode = 0
|
||||
@@ -44,8 +40,8 @@ stretch_mode = 5
|
||||
[node name="WinnerLabel" type="Label" parent="WinnerPanel/VBoxContainer" unique_id=1437597286]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"TitleMedium"
|
||||
text = "Winner!"
|
||||
label_settings = SubResource("LabelSettings_hr75l")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 2
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ func add_log_row(text: String) -> void:
|
||||
|
||||
func make_log_label(row: String) -> Label:
|
||||
var log_label: Label = Label.new()
|
||||
log_label.add_theme_font_size_override("font_size", 20)
|
||||
log_label.theme_type_variation = &"TextLarge"
|
||||
log_label.text = row
|
||||
log_label.autowrap_mode = TextServer.AUTOWRAP_WORD
|
||||
return log_label
|
||||
|
||||
@@ -15,10 +15,10 @@ var _popups: Array[BasePopup] = []
|
||||
static func add_to(parent: Control, popups: Array[BasePopup]) -> PopupBackdrop:
|
||||
var backdrop: PopupBackdrop = PopupBackdrop.new()
|
||||
backdrop.name = "PopupBackdrop"
|
||||
backdrop.color = Color(0, 0, 0, 0.55)
|
||||
backdrop.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
backdrop._popups = popups
|
||||
parent.add_child(backdrop)
|
||||
backdrop.color = backdrop.get_theme_color(&"backdrop", &"Palette")
|
||||
backdrop.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
for popup: BasePopup in popups:
|
||||
parent.move_child(popup, -1)
|
||||
|
||||
@@ -25,15 +25,12 @@ var shortcuts_dic: Dictionary = {
|
||||
@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.theme_type_variation = &"TextLarge"
|
||||
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
title.text = "Shortcuts"
|
||||
shortcuts_vbox.add_child(title)
|
||||
@@ -45,23 +42,21 @@ func _ready() -> void:
|
||||
hbox.alignment = BoxContainer.ALIGNMENT_CENTER
|
||||
|
||||
var label: Label = Label.new()
|
||||
label.add_theme_font_size_override("font_size", 20)
|
||||
label.theme_type_variation = &"TextLarge"
|
||||
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.theme_type_variation = &"TextLarge"
|
||||
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)
|
||||
panel.theme_type_variation = &"ShortcutRowDark"
|
||||
|
||||
hbox.add_child(label)
|
||||
hbox.add_child(label2)
|
||||
|
||||
@@ -171,19 +171,16 @@ func list_visible(vbox: VBoxContainer, separator: VSeparator) -> void:
|
||||
|
||||
func make_header_label(vbox: VBoxContainer, text: String) -> void:
|
||||
var label: Label = Label.new()
|
||||
label.add_theme_font_size_override("font_size", 20)
|
||||
label.theme_type_variation = &"HighlightLarge"
|
||||
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
label.add_theme_color_override("font_color", Color(1, 0.5, 0))
|
||||
label.text = text
|
||||
vbox.add_child(label)
|
||||
|
||||
|
||||
# Items alternate between white and orange text as well as background shade
|
||||
func make_soundtrack_row(text: String, row: int) -> ListRow:
|
||||
var list_row: ListRow = ListRow.create(text, row, 18, HORIZONTAL_ALIGNMENT_CENTER)
|
||||
if row % 2 != 0:
|
||||
list_row.label.add_theme_color_override("font_color", Color(1, 0.5, 0))
|
||||
return list_row
|
||||
var label_style: StringName = &"HighlightMedium" if row % 2 != 0 else &"TextMedium"
|
||||
return ListRow.create(text, row, label_style, HORIZONTAL_ALIGNMENT_CENTER)
|
||||
|
||||
|
||||
func reset_sync_result() -> void:
|
||||
|
||||
Reference in new issue
Block a user