init
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 9H1V2l2 2a3.875 5 30 0 1 9 11 3.5 5 10 0 0-6-8z" fill="#e0e0e0"/></svg>
|
||||
|
After Width: | Height: | Size: 167 B |
@@ -0,0 +1,43 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b23e4kqj4o6dv"
|
||||
path="res://.godot/imported/Revert.svg-83732f7446608123e95cc2f2a2cf35c6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/components/settings-menu/Revert.svg"
|
||||
dest_files=["res://.godot/imported/Revert.svg-83732f7446608123e95cc2f2a2cf35c6.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=2.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
@@ -0,0 +1,33 @@
|
||||
extends Button
|
||||
|
||||
var event_idx = 0
|
||||
|
||||
signal action_changed(action: String)
|
||||
|
||||
func _ready():
|
||||
set_process_unhandled_key_input(false)
|
||||
|
||||
func _toggled(b_pressed):
|
||||
set_process_unhandled_key_input(b_pressed)
|
||||
if b_pressed:
|
||||
text = "..."
|
||||
release_focus()
|
||||
|
||||
func _input(event):
|
||||
if not button_pressed:
|
||||
return
|
||||
|
||||
if event is InputEventKey or event is InputEventJoypadButton or event is InputEventMouseButton:
|
||||
action_changed.emit(event)
|
||||
get_viewport().set_input_as_handled()
|
||||
button_pressed = false
|
||||
|
||||
func _display_event(event: InputEvent):
|
||||
if event == null:
|
||||
text = "Unassigned"
|
||||
else:
|
||||
text = event.as_text()
|
||||
tooltip_text = text
|
||||
|
||||
func set_event(event: InputEvent):
|
||||
_display_event(event)
|
||||
@@ -0,0 +1 @@
|
||||
uid://b7fb4ravo24q0
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_scene format=3 uid="uid://ngjm8kk8u7fm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b7fb4ravo24q0" path="res://ui/components/settings-menu/action-remapping-button/action_remapping_button.gd" id="1_jb8u1"]
|
||||
|
||||
[node name="InputRemappingButton" type="Button" unique_id=740968636]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
toggle_mode = true
|
||||
text_overrun_behavior = 3
|
||||
script = ExtResource("1_jb8u1")
|
||||
184
rougelikeaboutmechs/ui/components/settings-menu/settings_menu.gd
Normal file
184
rougelikeaboutmechs/ui/components/settings-menu/settings_menu.gd
Normal file
@@ -0,0 +1,184 @@
|
||||
extends TabContainer
|
||||
|
||||
@onready var action_remapping_button_scene: PackedScene = load("res://ui/components/settings-menu/action-remapping-button/action_remapping_button.tscn")
|
||||
|
||||
func _ready() -> void:
|
||||
call_deferred("_populate_menu")
|
||||
|
||||
func _populate_menu() -> void:
|
||||
var tab_idx = 0
|
||||
|
||||
# Iterate through root categories (these become tabs)
|
||||
for root_category in Settings.get_root_categories():
|
||||
var margin_container = MarginContainer.new()
|
||||
add_child(margin_container)
|
||||
set_tab_title(tab_idx, root_category.display_text)
|
||||
|
||||
var scroll_container = ScrollContainer.new()
|
||||
scroll_container.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
||||
margin_container.add_child(scroll_container)
|
||||
|
||||
var margin_container2 = MarginContainer.new()
|
||||
margin_container2.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
margin_container2.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
scroll_container.add_child(margin_container2)
|
||||
|
||||
var cat_vbox = VBoxContainer.new()
|
||||
cat_vbox.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
cat_vbox.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
margin_container2.add_child(cat_vbox)
|
||||
|
||||
# Add subcategories as sections, and their settings
|
||||
_populate_category(cat_vbox, root_category, root_category.name)
|
||||
|
||||
tab_idx += 1
|
||||
|
||||
## Recursively populate a category and its subcategories
|
||||
## Subcategories become section headers, deeper ones are flattened
|
||||
func _populate_category(container: VBoxContainer, category: Settings.SettingCategory, path_prefix: String, depth: int = 0) -> void:
|
||||
# If this is a subcategory (depth > 0), add a section header
|
||||
if depth > 0:
|
||||
var lbl_section_title = Label.new()
|
||||
lbl_section_title.text = category.display_text
|
||||
lbl_section_title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
lbl_section_title.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
lbl_section_title.theme_type_variation = "SettingsGroupLabel"
|
||||
container.add_child(lbl_section_title)
|
||||
container.add_child(HSeparator.new())
|
||||
|
||||
# Add all settings in this category
|
||||
for setting in category.settings:
|
||||
_add_setting_ui(container, setting, path_prefix + "/" + setting.name)
|
||||
|
||||
# Recursively add all subcategories
|
||||
for sub_category in category.sub_categories:
|
||||
var sub_path = path_prefix + "/" + sub_category.name
|
||||
_populate_category(container, sub_category, sub_path, depth + 1)
|
||||
|
||||
func _add_setting_ui(container: VBoxContainer, setting: Settings.Setting, setting_path: String) -> void:
|
||||
var hbox = HBoxContainer.new()
|
||||
hbox.custom_minimum_size = Vector2(0, 40)
|
||||
container.add_child(hbox)
|
||||
|
||||
# Another HBoxContainer for the label and revert button
|
||||
var hbox_lbl = HBoxContainer.new()
|
||||
hbox_lbl.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
hbox.add_child(hbox_lbl)
|
||||
|
||||
# Label for the name of the setting
|
||||
var lbl_name = Label.new()
|
||||
lbl_name.text = setting.display_text
|
||||
lbl_name.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
hbox_lbl.add_child(lbl_name)
|
||||
|
||||
# Revert button for changing the setting back to its default value
|
||||
# For input bindings a new button for each remapping is created later
|
||||
if not setting is Settings.InputRemappingSetting:
|
||||
var revert_btn = Button.new()
|
||||
revert_btn.icon = get_theme_icon("icon", "RevertButton")
|
||||
revert_btn.custom_minimum_size = Vector2(32, 32)
|
||||
revert_btn.theme_type_variation = "FlatButton"
|
||||
revert_btn.connect("pressed", func(): Settings.reset_value(setting_path))
|
||||
hbox_lbl.add_child(revert_btn)
|
||||
setting.value_changed.connect(func(__): _update_revert_button(setting_path, revert_btn))
|
||||
_update_revert_button(setting_path, revert_btn)
|
||||
|
||||
# TODO: Tooltip
|
||||
|
||||
# Setting-specific editor
|
||||
if setting is Settings.FloatSetting:
|
||||
var slider_setting = setting as Settings.FloatSetting
|
||||
var slider = HSlider.new()
|
||||
slider.min_value = slider_setting.min_value
|
||||
slider.max_value = slider_setting.max_value
|
||||
slider.step = slider_setting.step
|
||||
slider.value = slider_setting.value
|
||||
slider.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
slider.size_flags_vertical = Control.SIZE_FILL
|
||||
slider.connect("value_changed", setting.set_value)
|
||||
setting.value_changed.connect(slider.set_value_no_signal)
|
||||
hbox.add_child(slider)
|
||||
elif setting is Settings.OptionSetting:
|
||||
var dropdown_setting = setting as Settings.OptionSetting
|
||||
var option_button = OptionButton.new()
|
||||
for i in range(dropdown_setting.options.size()):
|
||||
option_button.add_item(dropdown_setting.options[i], i)
|
||||
# Find the index of the current value
|
||||
var current_idx = dropdown_setting.options.find(dropdown_setting.value)
|
||||
if current_idx >= 0:
|
||||
option_button.selected = current_idx
|
||||
option_button.connect("item_selected", func(idx: int): setting.set_value(dropdown_setting.options[idx]))
|
||||
setting.value_changed.connect(func(val): option_button.select(dropdown_setting.options.find(val)))
|
||||
hbox.add_child(option_button)
|
||||
elif setting is Settings.BoolSetting:
|
||||
var checkbox = CheckBox.new()
|
||||
checkbox.button_pressed = setting.value
|
||||
checkbox.connect("toggled", setting.set_value)
|
||||
setting.value_changed.connect(checkbox.set_pressed_no_signal)
|
||||
hbox.add_child(checkbox)
|
||||
elif setting is Settings.InputRemappingSetting:
|
||||
_add_input_remapping_ui(hbox, setting as Settings.InputRemappingSetting, setting_path)
|
||||
else:
|
||||
# Assume it's a basic boolean setting if it has a bool value
|
||||
if typeof(setting.value) == TYPE_BOOL:
|
||||
var checkbox = CheckBox.new()
|
||||
checkbox.button_pressed = setting.value
|
||||
checkbox.connect("toggled", setting.set_value)
|
||||
setting.value_changed.connect(checkbox.set_pressed_no_signal)
|
||||
hbox.add_child(checkbox)
|
||||
else:
|
||||
push_warning("Unknown setting type for: " + setting.display_text)
|
||||
|
||||
func _add_input_remapping_ui(hbox: HBoxContainer, setting: Settings.InputRemappingSetting, setting_path: String) -> void:
|
||||
var events = setting.value as Array[InputEvent]
|
||||
|
||||
# First reset button
|
||||
var input_revert_btn_1 = Button.new()
|
||||
input_revert_btn_1.icon = get_theme_icon("icon", "RevertButton")
|
||||
input_revert_btn_1.custom_minimum_size = Vector2(32, 32)
|
||||
input_revert_btn_1.theme_type_variation = "FlatButton"
|
||||
input_revert_btn_1.connect("pressed", func(): Settings.reset_input_binding(setting_path, 0))
|
||||
hbox.add_child(input_revert_btn_1)
|
||||
setting.value_changed.connect(func(__): _update_input_mapping_revert_button(setting_path, 0, input_revert_btn_1))
|
||||
_update_input_mapping_revert_button(setting_path, 0, input_revert_btn_1)
|
||||
|
||||
# First remapping button
|
||||
var remapping_btn1 = action_remapping_button_scene.instantiate()
|
||||
remapping_btn1.set_event(events[0] if events.size() > 0 else null)
|
||||
remapping_btn1.connect("action_changed", func(event: InputEvent): _keymap_changed(event, 0, setting_path))
|
||||
setting.value_changed.connect(func(value: Array[InputEvent]): _update_remapping_button(value, 0, remapping_btn1))
|
||||
hbox.add_child(remapping_btn1)
|
||||
|
||||
# Second reset button
|
||||
var input_revert_btn_2 = Button.new()
|
||||
input_revert_btn_2.icon = get_theme_icon("icon", "RevertButton")
|
||||
input_revert_btn_2.custom_minimum_size = Vector2(32, 32)
|
||||
input_revert_btn_2.theme_type_variation = "FlatButton"
|
||||
input_revert_btn_2.connect("pressed", func(): Settings.reset_input_binding(setting_path, 1))
|
||||
hbox.add_child(input_revert_btn_2)
|
||||
setting.value_changed.connect(func(__): _update_input_mapping_revert_button(setting_path, 1, input_revert_btn_2))
|
||||
_update_input_mapping_revert_button(setting_path, 1, input_revert_btn_2)
|
||||
|
||||
# Second remapping button
|
||||
var remapping_btn2 = action_remapping_button_scene.instantiate()
|
||||
remapping_btn2.set_event(events[1] if events.size() > 1 else null)
|
||||
remapping_btn2.connect("action_changed", func(event: InputEvent): _keymap_changed(event, 1, setting_path))
|
||||
setting.value_changed.connect(func(value: Array[InputEvent]): _update_remapping_button(value, 1, remapping_btn2))
|
||||
hbox.add_child(remapping_btn2)
|
||||
|
||||
func _keymap_changed(event: InputEvent, event_idx: int, setting_path: String) -> void:
|
||||
var events = Settings.get_value(setting_path).duplicate()
|
||||
if event_idx >= events.size():
|
||||
events.push_back(null)
|
||||
events[event_idx] = event
|
||||
print("Keymap changed " + str(event_idx) + ":" + str(events))
|
||||
Settings.set_value(setting_path, events)
|
||||
|
||||
func _update_revert_button(p_setting_path: String, button: Button) -> void:
|
||||
button.visible = not Settings.is_value_default(p_setting_path)
|
||||
|
||||
func _update_remapping_button(value: Array[InputEvent], index: int, btn: Button):
|
||||
btn.set_event(value[index] if value.size() > index else null)
|
||||
|
||||
func _update_input_mapping_revert_button(p_setting_path: String, index: int, button: Button) -> void:
|
||||
button.modulate = Color.WHITE if not Settings.is_input_binding_default(p_setting_path, index) else Color.TRANSPARENT
|
||||
@@ -0,0 +1 @@
|
||||
uid://ij8xcd6np4vt
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene format=3 uid="uid://cv271fh4d2p13"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ij8xcd6np4vt" path="res://ui/components/settings-menu/settings_menu.gd" id="1_eae2p"]
|
||||
[ext_resource type="Theme" uid="uid://hheneshfv1b2" path="res://ui/themes/your_theme.tres" id="1_scglv"]
|
||||
|
||||
[node name="SettingsMenu" type="TabContainer" unique_id=1538995254]
|
||||
clip_contents = true
|
||||
custom_minimum_size = Vector2(600, 400)
|
||||
size_flags_vertical = 3
|
||||
theme = ExtResource("1_scglv")
|
||||
tab_alignment = 1
|
||||
script = ExtResource("1_eae2p")
|
||||
@@ -0,0 +1,7 @@
|
||||
extends Control
|
||||
|
||||
func _ready():
|
||||
$Continue.grab_focus()
|
||||
|
||||
func _on_continue_pressed() -> void:
|
||||
queue_free()
|
||||
@@ -0,0 +1 @@
|
||||
uid://c1i00arsdf2mw
|
||||
@@ -0,0 +1,74 @@
|
||||
[gd_scene format=3 uid="uid://bpr6du5ydm0lw"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://hheneshfv1b2" path="res://ui/themes/your_theme.tres" id="1_x8l5g"]
|
||||
[ext_resource type="Script" uid="uid://c1i00arsdf2mw" path="res://ui/screens/control-screen/control_screen.gd" id="2_wdxwm"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_5tgjf"]
|
||||
font_size = 60
|
||||
|
||||
[node name="ControlScreen" type="Control" unique_id=707664794]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_x8l5g")
|
||||
script = ExtResource("2_wdxwm")
|
||||
|
||||
[node name="Panel" type="Panel" parent="." unique_id=1329424348]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="ControlsTitle" type="Label" parent="." unique_id=1553206497]
|
||||
custom_minimum_size = Vector2(731.345, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -576.0
|
||||
offset_top = 25.0
|
||||
offset_right = 576.0
|
||||
offset_bottom = 108.0
|
||||
grow_horizontal = 2
|
||||
text = "Controls"
|
||||
label_settings = SubResource("LabelSettings_5tgjf")
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="ControlsTitle2" type="Label" parent="." unique_id=394444381]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -86.5
|
||||
offset_top = -11.5
|
||||
offset_right = 86.5
|
||||
offset_bottom = 11.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Put your controls here"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Continue" type="Button" parent="." unique_id=426511693]
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -39.5
|
||||
offset_top = -58.0
|
||||
offset_right = 39.5
|
||||
offset_bottom = -27.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
text = "Continue"
|
||||
|
||||
[connection signal="pressed" from="Continue" to="." method="_on_continue_pressed"]
|
||||
@@ -0,0 +1,20 @@
|
||||
class_name CreditButton
|
||||
extends VBoxContainer
|
||||
|
||||
signal display_license
|
||||
|
||||
var credit: CreditEntry
|
||||
|
||||
func set_credit(credit_entry: CreditEntry) -> void:
|
||||
credit = credit_entry
|
||||
if credit.descriptor:
|
||||
$DescribtorLabel.text = credit.descriptor
|
||||
$HBoxContainer/CreditButton.text = credit.name
|
||||
if credit.url:
|
||||
$HBoxContainer/CreditButton.pressed.connect(open_url)
|
||||
|
||||
func open_url():
|
||||
OS.shell_open(credit.url)
|
||||
|
||||
func _on_license_button_pressed() -> void:
|
||||
display_license.emit(credit)
|
||||
@@ -0,0 +1 @@
|
||||
uid://6q5m84onxilu
|
||||
@@ -0,0 +1,39 @@
|
||||
[gd_scene format=3 uid="uid://bhqw5lfvaq0bg"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://6q5m84onxilu" path="res://ui/screens/credit-screen/credit_element.gd" id="1_ukcj5"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2mwwd"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_p0wxk"]
|
||||
font_size = 12
|
||||
|
||||
[node name="Credit" type="VBoxContainer" unique_id=69516036]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
script = ExtResource("1_ukcj5")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=599791176]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CreditButton" type="Button" parent="HBoxContainer" unique_id=955063757]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_font_sizes/font_size = 20
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_2mwwd")
|
||||
flat = true
|
||||
|
||||
[node name="LicenseButton" type="Button" parent="HBoxContainer" unique_id=351433666]
|
||||
layout_mode = 2
|
||||
text = "License"
|
||||
|
||||
[node name="DescribtorLabel" type="Label" parent="." unique_id=322246210]
|
||||
modulate = Color(1, 1, 1, 0.670588)
|
||||
layout_mode = 2
|
||||
label_settings = SubResource("LabelSettings_p0wxk")
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[connection signal="pressed" from="HBoxContainer/LicenseButton" to="." method="_on_license_button_pressed"]
|
||||
@@ -0,0 +1,8 @@
|
||||
class_name CreditEntry
|
||||
extends Resource
|
||||
|
||||
@export var name: String
|
||||
@export var descriptor: String
|
||||
@export var license: String
|
||||
@export var license_file: String
|
||||
@export var url: String
|
||||
@@ -0,0 +1 @@
|
||||
uid://cjhxtjhj5o81f
|
||||
@@ -0,0 +1,84 @@
|
||||
extends Control
|
||||
|
||||
@export var credits: String
|
||||
|
||||
func _ready() -> void:
|
||||
$VBoxContainer/Return.grab_focus()
|
||||
|
||||
var credit_button_scene = load("res://ui/screens/credit-screen/credit_element.tscn")
|
||||
|
||||
var creds: Array[CreditEntry] = _dicts_to_entry(_read_credits())
|
||||
for c in creds:
|
||||
var b: CreditButton = credit_button_scene.instantiate()
|
||||
b.display_license.connect(display_license)
|
||||
b.set_credit(c)
|
||||
$VBoxContainer/ScrollContainer/VBoxContainer/VBoxContainer.add_child(b)
|
||||
$VBoxContainer/ScrollContainer.scroll_vertical = 0
|
||||
|
||||
func _on_return_pressed() -> void:
|
||||
queue_free()
|
||||
|
||||
func _read_credits() -> Array:
|
||||
var text = FileAccess.open(credits, FileAccess.READ).get_as_text()
|
||||
var content_as_dictionary: Array = JSON.parse_string(text)
|
||||
return content_as_dictionary
|
||||
|
||||
|
||||
func _dicts_to_entry(array: Array) -> Array[CreditEntry]:
|
||||
var item_array: Array[CreditEntry] = []
|
||||
for dict in array:
|
||||
var item = CreditEntry.new()
|
||||
item.name = dict["name"]
|
||||
item.descriptor = dict["descriptor"] if dict.has("descriptor") else ""
|
||||
if dict.has("license"):
|
||||
item.license = dict["license"] if dict["license"] else ""
|
||||
elif dict.has("license_file"):
|
||||
item.license = FileAccess.open(dict["license_file"], FileAccess.READ).get_as_text()\
|
||||
if FileAccess.file_exists(dict["license_file"]) else ""
|
||||
else:
|
||||
item.license = ""
|
||||
item.url = dict["url"] if dict.has("url") else ""
|
||||
item_array.append(item)
|
||||
return item_array
|
||||
|
||||
func _on_detailed_g_credits_pressed() -> void:
|
||||
if not $VBoxContainer/ScrollContainer/Godot3PCredits.text:
|
||||
var copyright_info = Engine.get_copyright_info()
|
||||
var copyright_text = "Godot Engine Copyright Information:"
|
||||
for entry in copyright_info:
|
||||
copyright_text += "\n\n" + entry["name"] + ":\n"
|
||||
var parts = entry["parts"]
|
||||
for part in parts:
|
||||
copyright_text += "Files:\n"
|
||||
for file in part["files"]:
|
||||
copyright_text += " " + file + "\n"
|
||||
for copyright_owner in part["copyright"]:
|
||||
copyright_text += "© " + copyright_owner + "\n"
|
||||
copyright_text += "License:" + part["license"] + "\n"
|
||||
# Append full license texts
|
||||
var license_texts = Engine.get_license_info()
|
||||
copyright_text += "\n\n\n\nFull license texts:"
|
||||
for license in license_texts:
|
||||
copyright_text += "\n\n" + license + ":\n"
|
||||
copyright_text += license_texts[license]
|
||||
|
||||
$VBoxContainer/ScrollContainer/Godot3PCredits.text = copyright_text
|
||||
|
||||
$VBoxContainer/ScrollContainer/Godot3PCredits.visible = \
|
||||
not $VBoxContainer/ScrollContainer/Godot3PCredits.visible
|
||||
|
||||
$VBoxContainer/ScrollContainer/VBoxContainer.visible = \
|
||||
not $VBoxContainer/ScrollContainer/VBoxContainer.visible
|
||||
|
||||
if $VBoxContainer/ScrollContainer/Godot3PCredits.visible:
|
||||
$DetailedGCredits.text = "Return to Credits"
|
||||
else:
|
||||
$DetailedGCredits.text = "Show detailed Godot Credits"
|
||||
|
||||
func display_license(credit: CreditEntry) -> void:
|
||||
$LicenseText.visible = true
|
||||
$LicenseText/VBoxContainer/Label.text = credit.name
|
||||
$LicenseText/VBoxContainer/ScrollContainer/Label.text = credit.license
|
||||
|
||||
func _on_close_licence_text_pressed() -> void:
|
||||
$LicenseText.visible = false
|
||||
@@ -0,0 +1 @@
|
||||
uid://dx5iawpcgwhlm
|
||||
116
rougelikeaboutmechs/ui/screens/credit-screen/credit_screen.tscn
Normal file
116
rougelikeaboutmechs/ui/screens/credit-screen/credit_screen.tscn
Normal file
@@ -0,0 +1,116 @@
|
||||
[gd_scene format=3 uid="uid://fd3xmnc047tm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dx5iawpcgwhlm" path="res://ui/screens/credit-screen/credit_screen.gd" id="1_h6a2t"]
|
||||
[ext_resource type="Theme" uid="uid://hheneshfv1b2" path="res://ui/themes/your_theme.tres" id="2_dvsi5"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_cutkl"]
|
||||
font_size = 22
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_r8dx7"]
|
||||
font_size = 12
|
||||
|
||||
[node name="CreditScreen" type="MarginContainer" unique_id=554750649]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("2_dvsi5")
|
||||
script = ExtResource("1_h6a2t")
|
||||
credits = "res://ui/screens/credit-screen/credits.json"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1426215384]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer" unique_id=193875904]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer" unique_id=1766199227]
|
||||
custom_minimum_size = Vector2(700, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="LabelCredits" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer" unique_id=500318037]
|
||||
custom_minimum_size = Vector2(731.345, 0)
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderLarge"
|
||||
text = "Credits"
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Spacer2" type="Control" parent="VBoxContainer/ScrollContainer/VBoxContainer" unique_id=341639053]
|
||||
custom_minimum_size = Vector2(0, 27.17)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LabelCreatedBy" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer" unique_id=1161453390]
|
||||
layout_mode = 2
|
||||
text = "Created by You"
|
||||
label_settings = SubResource("LabelSettings_cutkl")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="LabelSpecialThanks" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer" unique_id=1866642574]
|
||||
layout_mode = 2
|
||||
text = "Special thanks to Also You"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer/ScrollContainer/VBoxContainer" unique_id=123317386]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer" unique_id=1405225546]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Godot3PCredits" type="Label" parent="VBoxContainer/ScrollContainer" unique_id=1092186786]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
label_settings = SubResource("LabelSettings_r8dx7")
|
||||
|
||||
[node name="Return" type="Button" parent="VBoxContainer" unique_id=464459005]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
text = "Return to Main Menu
|
||||
"
|
||||
|
||||
[node name="DetailedGCredits" type="Button" parent="." unique_id=729625426]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 8
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "Show detailed Godot Credits"
|
||||
flat = true
|
||||
|
||||
[node name="LicenseText" type="PanelContainer" parent="." unique_id=1702054193]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_dvsi5")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="LicenseText" unique_id=1286974170]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="LicenseText/VBoxContainer" unique_id=426678051]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme = ExtResource("2_dvsi5")
|
||||
theme_type_variation = &"HeaderMedium"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="LicenseText/VBoxContainer" unique_id=1054289490]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Label" type="Label" parent="LicenseText/VBoxContainer/ScrollContainer" unique_id=589755459]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
|
||||
[node name="CloseLicense" type="Button" parent="LicenseText/VBoxContainer" unique_id=102920052]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
text = "Close"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/Return" to="." method="_on_return_pressed"]
|
||||
[connection signal="pressed" from="DetailedGCredits" to="." method="_on_detailed_g_credits_pressed"]
|
||||
[connection signal="pressed" from="LicenseText/VBoxContainer/CloseLicense" to="." method="_on_close_licence_text_pressed"]
|
||||
18
rougelikeaboutmechs/ui/screens/credit-screen/credits.json
Normal file
18
rougelikeaboutmechs/ui/screens/credit-screen/credits.json
Normal file
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"name": "Godot",
|
||||
"descriptor": "Open Source 2D/3D Game Engine",
|
||||
"license": "This game uses Godot Engine, available under the following license:\n\nCopyright (c) 2014-present Godot Engine contributors.\nCopyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.",
|
||||
"url": "https://godotengine.org/license"
|
||||
},
|
||||
{
|
||||
"name": "Godot Game Template",
|
||||
"descriptor": "Universal game template targeted at game jams.",
|
||||
"license": "MIT License\n\nCopyright (c) 2025 Ekaterina Ehringhaus and Hendrik Brucker\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.",
|
||||
"url": "https://github.com/Godot-Stammtisch-Karlsruhe/godot-game-template"
|
||||
},
|
||||
{
|
||||
"name": "Sample Asset",
|
||||
"descriptor": "Sample description (optional)"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,11 @@
|
||||
class_name LevelButton
|
||||
extends Button
|
||||
|
||||
var level_nr: int
|
||||
signal select_level(level_nr: int)
|
||||
|
||||
func _ready() -> void:
|
||||
text = str(level_nr)
|
||||
|
||||
func _on_pressed() -> void:
|
||||
select_level.emit(level_nr)
|
||||
@@ -0,0 +1 @@
|
||||
uid://dwav7d4amw8yu
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene format=3 uid="uid://ccrodv5x16nay"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dwav7d4amw8yu" path="res://ui/screens/level-select-screen/level_button.gd" id="1_ej8yx"]
|
||||
|
||||
[node name="LevelButton" type="Button" unique_id=923151870]
|
||||
custom_minimum_size = Vector2(90, 90)
|
||||
offset_right = 8.0
|
||||
offset_bottom = 8.0
|
||||
theme_override_font_sizes/font_size = 56
|
||||
script = ExtResource("1_ej8yx")
|
||||
|
||||
[connection signal="pressed" from="." to="." method="_on_pressed"]
|
||||
@@ -0,0 +1,43 @@
|
||||
extends Control
|
||||
|
||||
@export var buttonContainer: Container
|
||||
|
||||
var level_buttons: Array[Button] = []
|
||||
var completed_levels: Array[bool] = []
|
||||
|
||||
signal start_level(level_nr: int)
|
||||
signal test_level()
|
||||
signal exit()
|
||||
|
||||
func init_buttons(max_level: int, completed_level_information: Array[bool]) -> void:
|
||||
if max_level > 0:
|
||||
$VBoxContainer/Label.visible = false
|
||||
|
||||
completed_levels = completed_level_information
|
||||
for i in range(max_level):
|
||||
var b: LevelButton = load("res://ui/screens/level-select-screen/level_button.tscn").instantiate()
|
||||
b.level_nr = i + 1
|
||||
b.select_level.connect(_level_button_pressed)
|
||||
b.disabled = not completed_levels[i]
|
||||
level_buttons.append(b)
|
||||
buttonContainer.add_child(b)
|
||||
|
||||
func _level_button_pressed(level_nr: int) -> void:
|
||||
print("Start Level ",level_nr)
|
||||
start_level.emit(level_nr)
|
||||
queue_free()
|
||||
|
||||
func _return_to_title() -> void:
|
||||
exit.emit()
|
||||
queue_free()
|
||||
|
||||
func _on_unlock_levels_toggled(toggled_on: bool) -> void:
|
||||
for i in range(len(level_buttons)):
|
||||
if toggled_on:
|
||||
level_buttons[i].disabled = false
|
||||
else:
|
||||
level_buttons[i].disabled = !completed_levels[i]
|
||||
|
||||
func _on_test_level_pressed() -> void:
|
||||
test_level.emit()
|
||||
queue_free()
|
||||
@@ -0,0 +1 @@
|
||||
uid://d2i8k7votngvg
|
||||
@@ -0,0 +1,66 @@
|
||||
[gd_scene format=3 uid="uid://cv82k2twxie3n"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://hheneshfv1b2" path="res://ui/themes/your_theme.tres" id="1_cpj7q"]
|
||||
[ext_resource type="Script" uid="uid://d2i8k7votngvg" path="res://ui/screens/level-select-screen/level_select.gd" id="2_lcog6"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_mfdjd"]
|
||||
font_size = 60
|
||||
|
||||
[node name="LevelSelect" type="MarginContainer" unique_id=1286521924 node_paths=PackedStringArray("buttonContainer")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_cpj7q")
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
script = ExtResource("2_lcog6")
|
||||
buttonContainer = NodePath("VBoxContainer/HFlowContainer")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1716877818]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LevelSelectTitle" type="Label" parent="VBoxContainer" unique_id=1290767086]
|
||||
custom_minimum_size = Vector2(731.345, 0)
|
||||
layout_mode = 2
|
||||
text = "Level Select"
|
||||
label_settings = SubResource("LabelSettings_mfdjd")
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Spacer" type="Control" parent="VBoxContainer" unique_id=1769227168]
|
||||
custom_minimum_size = Vector2(0, 28)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer" unique_id=878866277]
|
||||
layout_mode = 2
|
||||
text = "This Level Select Screen is provided by the template.
|
||||
|
||||
Numbered buttons related to a given level will be displayed here, if multiple_levels is enabled and the max number of levels is larger than zero.
|
||||
|
||||
The default location for levels ist the 'levels/' Folder with levels using the \"level_x.tscn\" naming scheme."
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HFlowContainer" type="HFlowContainer" parent="VBoxContainer" unique_id=2027526310]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Control" type="HBoxContainer" parent="VBoxContainer" unique_id=1711230144]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 10
|
||||
|
||||
[node name="UnlockLevels" type="CheckButton" parent="VBoxContainer/Control" unique_id=1583371876]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 10
|
||||
text = "Unlock all Levels"
|
||||
|
||||
[node name="Return" type="Button" parent="VBoxContainer" unique_id=2120122741]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Return to Main Menu"
|
||||
|
||||
[connection signal="toggled" from="VBoxContainer/Control/UnlockLevels" to="." method="_on_unlock_levels_toggled"]
|
||||
[connection signal="pressed" from="VBoxContainer/Return" to="." method="_return_to_title"]
|
||||
37
rougelikeaboutmechs/ui/screens/pause-menu/pause_menu.gd
Normal file
37
rougelikeaboutmechs/ui/screens/pause-menu/pause_menu.gd
Normal file
@@ -0,0 +1,37 @@
|
||||
extends Control
|
||||
|
||||
signal continue_btn_pressed
|
||||
signal settings_btn_pressed
|
||||
signal exit_to_main_menu_btn_pressed
|
||||
signal exit_game_btn_pressed
|
||||
|
||||
|
||||
func reset():
|
||||
%SettingsMenuPopup.hide()
|
||||
%MainPauseMenuPopup.show()
|
||||
|
||||
func _on_btn_continue_pressed():
|
||||
continue_btn_pressed.emit()
|
||||
hide()
|
||||
|
||||
func _on_btn_settings_pressed():
|
||||
settings_btn_pressed.emit()
|
||||
%SettingsMenuPopup.show()
|
||||
%MainPauseMenuPopup.hide()
|
||||
|
||||
func _on_btn_exit_to_main_menu_pressed():
|
||||
exit_to_main_menu_btn_pressed.emit()
|
||||
hide()
|
||||
|
||||
func _on_btn_exit_game_pressed():
|
||||
exit_game_btn_pressed.emit()
|
||||
hide()
|
||||
|
||||
func _on_save_and_back_btn_pressed():
|
||||
Settings.save_config()
|
||||
reset()
|
||||
|
||||
|
||||
func _on_continue_btn_visibility_changed() -> void:
|
||||
if visible:
|
||||
$CenterContainer/MainPauseMenuPopup/VBoxContainer/ContinueBtn.grab_focus()
|
||||
@@ -0,0 +1 @@
|
||||
uid://2n7o5t6b5g4w
|
||||
85
rougelikeaboutmechs/ui/screens/pause-menu/pause_menu.tscn
Normal file
85
rougelikeaboutmechs/ui/screens/pause-menu/pause_menu.tscn
Normal file
@@ -0,0 +1,85 @@
|
||||
[gd_scene format=3 uid="uid://bilai15byqef2"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://hheneshfv1b2" path="res://ui/themes/your_theme.tres" id="1_0kumn"]
|
||||
[ext_resource type="Script" uid="uid://2n7o5t6b5g4w" path="res://ui/screens/pause-menu/pause_menu.gd" id="2_0mnak"]
|
||||
[ext_resource type="PackedScene" uid="uid://cv271fh4d2p13" path="res://ui/components/settings-menu/settings_menu.tscn" id="4_e3p6x"]
|
||||
|
||||
[node name="PauseMenuScreen" type="Control" unique_id=2087442611]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_0mnak")
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="." unique_id=983714819]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_0kumn")
|
||||
|
||||
[node name="MainPauseMenuPopup" type="PanelContainer" parent="CenterContainer" unique_id=1216636000]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/MainPauseMenuPopup" unique_id=1361849718]
|
||||
custom_minimum_size = Vector2(250, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PausedLbl" type="Label" parent="CenterContainer/MainPauseMenuPopup/VBoxContainer" unique_id=338515519]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderMedium"
|
||||
text = "Paused"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ContinueBtn" type="Button" parent="CenterContainer/MainPauseMenuPopup/VBoxContainer" unique_id=2012541750]
|
||||
layout_mode = 2
|
||||
text = "Continue"
|
||||
|
||||
[node name="SettingsButton" type="Button" parent="CenterContainer/MainPauseMenuPopup/VBoxContainer" unique_id=1680382734]
|
||||
layout_mode = 2
|
||||
text = "Settings"
|
||||
|
||||
[node name="ExitToMainMenuBtn" type="Button" parent="CenterContainer/MainPauseMenuPopup/VBoxContainer" unique_id=300221649]
|
||||
layout_mode = 2
|
||||
text = "Quit to title screen"
|
||||
|
||||
[node name="ExitGameBtn" type="Button" parent="CenterContainer/MainPauseMenuPopup/VBoxContainer" unique_id=104298902]
|
||||
layout_mode = 2
|
||||
text = "Quit game"
|
||||
|
||||
[node name="SettingsMenuPopup" type="PanelContainer" parent="CenterContainer" unique_id=1654694978]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_0kumn")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/SettingsMenuPopup" unique_id=680704985]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 12
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/SettingsMenuPopup/VBoxContainer" unique_id=547993980]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderMedium"
|
||||
text = "Settings"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="SettingsMenu" parent="CenterContainer/SettingsMenuPopup/VBoxContainer" unique_id=1510978317 instance=ExtResource("4_e3p6x")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SaveAndBackBtn" type="Button" parent="CenterContainer/SettingsMenuPopup/VBoxContainer" unique_id=312254833]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
text = "Save and back"
|
||||
|
||||
[connection signal="pressed" from="CenterContainer/MainPauseMenuPopup/VBoxContainer/ContinueBtn" to="." method="_on_btn_continue_pressed"]
|
||||
[connection signal="visibility_changed" from="CenterContainer/MainPauseMenuPopup/VBoxContainer/ContinueBtn" to="." method="_on_continue_btn_visibility_changed"]
|
||||
[connection signal="pressed" from="CenterContainer/MainPauseMenuPopup/VBoxContainer/SettingsButton" to="." method="_on_btn_settings_pressed"]
|
||||
[connection signal="pressed" from="CenterContainer/MainPauseMenuPopup/VBoxContainer/ExitToMainMenuBtn" to="." method="_on_btn_exit_to_main_menu_pressed"]
|
||||
[connection signal="pressed" from="CenterContainer/MainPauseMenuPopup/VBoxContainer/ExitGameBtn" to="." method="_on_btn_exit_game_pressed"]
|
||||
[connection signal="pressed" from="CenterContainer/SettingsMenuPopup/VBoxContainer/SaveAndBackBtn" to="." method="_on_save_and_back_btn_pressed"]
|
||||
@@ -0,0 +1,11 @@
|
||||
extends MarginContainer
|
||||
|
||||
signal exit()
|
||||
|
||||
func _ready():
|
||||
$VBoxContainer/Return.grab_focus()
|
||||
|
||||
func _return_to_title_screen() -> void:
|
||||
exit.emit()
|
||||
queue_free()
|
||||
Settings.save_config()
|
||||
@@ -0,0 +1 @@
|
||||
uid://roiysiotwsbq
|
||||
@@ -0,0 +1,46 @@
|
||||
[gd_scene format=3 uid="uid://ywybicp1ess8"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://hheneshfv1b2" path="res://ui/themes/your_theme.tres" id="1_i4lq1"]
|
||||
[ext_resource type="Script" uid="uid://roiysiotwsbq" path="res://ui/screens/settings-screen/settings_screen.gd" id="2_ck7g6"]
|
||||
[ext_resource type="PackedScene" uid="uid://cv271fh4d2p13" path="res://ui/components/settings-menu/settings_menu.tscn" id="4_i4lq1"]
|
||||
|
||||
[node name="OptionsMenu" type="MarginContainer" unique_id=420614935]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_vertical = 0
|
||||
theme = ExtResource("1_i4lq1")
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
script = ExtResource("2_ck7g6")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1967046289]
|
||||
custom_minimum_size = Vector2(450, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="OptionsTitle" type="Label" parent="VBoxContainer" unique_id=1806842321]
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme_type_variation = &"HeaderLarge"
|
||||
text = "Options"
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="SettingsMenu" parent="VBoxContainer" unique_id=784596614 instance=ExtResource("4_i4lq1")]
|
||||
custom_minimum_size = Vector2(800, 400)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Return" type="Button" parent="VBoxContainer" unique_id=1869177324]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
text = "Return to Main Menu"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/Return" to="." method="_return_to_title_screen"]
|
||||
33
rougelikeaboutmechs/ui/screens/title-screen/title_screen.gd
Normal file
33
rougelikeaboutmechs/ui/screens/title-screen/title_screen.gd
Normal file
@@ -0,0 +1,33 @@
|
||||
extends Control
|
||||
|
||||
signal start_game()
|
||||
signal show_credits()
|
||||
signal show_level_select()
|
||||
signal show_settings_screen()
|
||||
signal quit()
|
||||
|
||||
func _ready():
|
||||
$CenterContainer2/VBoxContainer/Start.grab_focus()
|
||||
|
||||
func _on_start_pressed() -> void:
|
||||
start_game.emit()
|
||||
queue_free()
|
||||
|
||||
func _on_credit_pressed() -> void:
|
||||
show_credits.emit()
|
||||
queue_free()
|
||||
|
||||
func _on_level_select_pressed() -> void:
|
||||
show_level_select.emit()
|
||||
queue_free()
|
||||
|
||||
func _on_options_pressed() -> void:
|
||||
show_settings_screen.emit()
|
||||
queue_free()
|
||||
|
||||
func _on_quit_pressed():
|
||||
quit.emit()
|
||||
queue_free()
|
||||
|
||||
func show_levels(b: bool) -> void:
|
||||
$CenterContainer2/VBoxContainer/LevelSelect.visible = b
|
||||
@@ -0,0 +1 @@
|
||||
uid://1mjt83fygiua
|
||||
116
rougelikeaboutmechs/ui/screens/title-screen/title_screen.tscn
Normal file
116
rougelikeaboutmechs/ui/screens/title-screen/title_screen.tscn
Normal file
@@ -0,0 +1,116 @@
|
||||
[gd_scene format=3 uid="uid://ddc3qfst7mbgc"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://hheneshfv1b2" path="res://ui/themes/your_theme.tres" id="1_qt2rq"]
|
||||
[ext_resource type="Script" uid="uid://1mjt83fygiua" path="res://ui/screens/title-screen/title_screen.gd" id="1_rm86k"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_s0ue6"]
|
||||
font_size = 150
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_73xnf"]
|
||||
font_size = 50
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_wly7t"]
|
||||
font_size = 12
|
||||
|
||||
[node name="TitleScreen" type="Control" unique_id=165552926]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_qt2rq")
|
||||
script = ExtResource("1_rm86k")
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="." unique_id=129658239]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 2.0
|
||||
offset_top = 20.0
|
||||
offset_right = 2.0
|
||||
offset_bottom = -269.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer" unique_id=1543886662]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/VBoxContainer" unique_id=457043767]
|
||||
custom_minimum_size = Vector2(731.345, 0)
|
||||
layout_mode = 2
|
||||
text = "R.A.M."
|
||||
label_settings = SubResource("LabelSettings_s0ue6")
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="CenterContainer/VBoxContainer" unique_id=2117014839]
|
||||
custom_minimum_size = Vector2(731.345, 0)
|
||||
layout_mode = 2
|
||||
text = "rouge-like about machines"
|
||||
label_settings = SubResource("LabelSettings_73xnf")
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="CenterContainer2" type="CenterContainer" parent="." unique_id=1706430698]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = 309.0
|
||||
offset_bottom = -28.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer2" unique_id=11688683]
|
||||
custom_minimum_size = Vector2(300, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Start" type="Button" parent="CenterContainer2/VBoxContainer" unique_id=603626461]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "Start"
|
||||
|
||||
[node name="LevelSelect" type="Button" parent="CenterContainer2/VBoxContainer" unique_id=1964255967]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "Level Select"
|
||||
|
||||
[node name="Options" type="Button" parent="CenterContainer2/VBoxContainer" unique_id=1650158032]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "Settings"
|
||||
|
||||
[node name="Credit" type="Button" parent="CenterContainer2/VBoxContainer" unique_id=426848008]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "Credits"
|
||||
|
||||
[node name="Quit" type="Button" parent="CenterContainer2/VBoxContainer" unique_id=2004677633]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "Quit"
|
||||
|
||||
[node name="Label" type="Label" parent="." unique_id=1786336606]
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -76.5
|
||||
offset_top = -25.0
|
||||
offset_right = 76.5
|
||||
offset_bottom = -2.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
text = "My Version"
|
||||
label_settings = SubResource("LabelSettings_wly7t")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="CenterContainer2/VBoxContainer/Start" to="." method="_on_start_pressed"]
|
||||
[connection signal="pressed" from="CenterContainer2/VBoxContainer/LevelSelect" to="." method="_on_level_select_pressed"]
|
||||
[connection signal="pressed" from="CenterContainer2/VBoxContainer/Options" to="." method="_on_options_pressed"]
|
||||
[connection signal="pressed" from="CenterContainer2/VBoxContainer/Credit" to="." method="_on_credit_pressed"]
|
||||
[connection signal="pressed" from="CenterContainer2/VBoxContainer/Quit" to="." method="_on_quit_pressed"]
|
||||
7
rougelikeaboutmechs/ui/screens/win-screen/win_screen.gd
Normal file
7
rougelikeaboutmechs/ui/screens/win-screen/win_screen.gd
Normal file
@@ -0,0 +1,7 @@
|
||||
extends Control
|
||||
|
||||
func _ready():
|
||||
$CenterContainer/VBoxContainer/Button.grab_focus()
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
queue_free()
|
||||
@@ -0,0 +1 @@
|
||||
uid://dgtme0a6lym5c
|
||||
51
rougelikeaboutmechs/ui/screens/win-screen/win_screen.tscn
Normal file
51
rougelikeaboutmechs/ui/screens/win-screen/win_screen.tscn
Normal file
@@ -0,0 +1,51 @@
|
||||
[gd_scene format=3 uid="uid://g2g8hydsgxid"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dgtme0a6lym5c" path="res://ui/screens/win-screen/win_screen.gd" id="1_lgw0b"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_rbmgw"]
|
||||
font_size = 100
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_rvyxm"]
|
||||
font_size = 25
|
||||
|
||||
[node name="WinScreen" type="Control" unique_id=858939810]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_lgw0b")
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="." unique_id=2007437466]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer" unique_id=1911103298]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="CenterContainer/VBoxContainer" unique_id=1273209801]
|
||||
custom_minimum_size = Vector2(731.345, 0)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
text = "You won!"
|
||||
label_settings = SubResource("LabelSettings_rbmgw")
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Label2" type="Label" parent="CenterContainer/VBoxContainer" unique_id=1313320644]
|
||||
layout_mode = 2
|
||||
text = "Congratulations and thank you for playing"
|
||||
label_settings = SubResource("LabelSettings_rvyxm")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Button" type="Button" parent="CenterContainer/VBoxContainer" unique_id=533980693]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Return to title screen"
|
||||
|
||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/Button" to="." method="_on_button_pressed"]
|
||||
24
rougelikeaboutmechs/ui/themes/your_theme.tres
Normal file
24
rougelikeaboutmechs/ui/themes/your_theme.tres
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_resource type="Theme" format=3 uid="uid://hheneshfv1b2"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b23e4kqj4o6dv" path="res://ui/components/settings-menu/Revert.svg" id="1_r1020"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0d4dl"]
|
||||
content_margin_left = 8.0
|
||||
content_margin_top = 8.0
|
||||
content_margin_right = 8.0
|
||||
content_margin_bottom = 8.0
|
||||
bg_color = Color(0.212305, 0.212305, 0.212305, 1)
|
||||
corner_radius_top_left = 2
|
||||
corner_radius_top_right = 2
|
||||
corner_radius_bottom_right = 2
|
||||
corner_radius_bottom_left = 2
|
||||
|
||||
[resource]
|
||||
HeaderLarge/font_sizes/font_size = 56
|
||||
HeaderMedium/font_sizes/font_size = 24
|
||||
MarginContainer/constants/margin_bottom = 8
|
||||
MarginContainer/constants/margin_left = 8
|
||||
MarginContainer/constants/margin_right = 8
|
||||
MarginContainer/constants/margin_top = 8
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxFlat_0d4dl")
|
||||
RevertButton/icons/icon = ExtResource("1_r1020")
|
||||
Reference in New Issue
Block a user