mirror of
https://github.com/Theaninova/mhlib.git
synced 2026-01-06 08:42:57 +00:00
ui
This commit is contained in:
@@ -85,6 +85,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("3_a2fmg")
|
||||
theme_override_constants/margin_left = 32
|
||||
theme_override_constants/margin_top = 32
|
||||
theme_override_constants/margin_right = 32
|
||||
|
||||
74
godot/mhjnr/menu.tscn
Normal file
74
godot/mhjnr/menu.tscn
Normal file
@@ -0,0 +1,74 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dleusk0maomll"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://ks2uyxqg6u4k" path="res://mhjnr/theme.tres" id="1_o0c21"]
|
||||
[ext_resource type="Texture2D" uid="uid://dkeuhlg0ki67o" path="res://remakes/minimize.svg" id="3_qkgqr"]
|
||||
[ext_resource type="Texture2D" uid="uid://24kg870sjulo" path="res://remakes/close.svg" id="4_a24a2"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_oemh7"]
|
||||
script/source = "extends MarginContainer
|
||||
|
||||
@export var entry = \"main\"
|
||||
|
||||
var menu: Node
|
||||
|
||||
func _ready() -> void:
|
||||
set_menu(entry)
|
||||
|
||||
func set_menu(name: String) -> void:
|
||||
if menu != null:
|
||||
menu.queue_free()
|
||||
var translations: Translation = load(\"datafile://data/text.csv\")
|
||||
menu = load(\"datafile://data/menu/screens/%s.xml\" % name).instantiate()
|
||||
add_child(menu)
|
||||
move_child(menu, 0)
|
||||
|
||||
for button in menu.find_children(\"*\", \"Button\"):
|
||||
if not button.has_meta(\"action\"):
|
||||
continue
|
||||
var action = button.get_meta(\"action\")
|
||||
var callable = Callable(self, \"_on_action_%s\" % action.name)
|
||||
button.connect(\"pressed\", callable.bindv(action.args))
|
||||
|
||||
for node in menu.find_children(\"*\"):
|
||||
if node.has_method(\"set_text\"):
|
||||
node.text = translations.tr(node.text)
|
||||
|
||||
func _on_close_pressed() -> void:
|
||||
get_tree().quit()
|
||||
|
||||
func _on_action_SetMenu(name: String) -> void:
|
||||
set_menu(name)
|
||||
|
||||
func _on_action_CheckStartGame() -> void:
|
||||
print(\"CheckStartGame\")
|
||||
"
|
||||
|
||||
[node name="Root" type="MarginContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_o0c21")
|
||||
script = SubResource("GDScript_oemh7")
|
||||
|
||||
[node name="Titlebar" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 0
|
||||
|
||||
[node name="Minimize" type="Button" parent="Titlebar"]
|
||||
layout_mode = 2
|
||||
focus_mode = 1
|
||||
theme_override_colors/icon_hover_color = Color(0.403922, 0.403922, 0.403922, 1)
|
||||
icon = ExtResource("3_qkgqr")
|
||||
flat = true
|
||||
|
||||
[node name="Close" type="Button" parent="Titlebar"]
|
||||
layout_mode = 2
|
||||
focus_mode = 1
|
||||
theme_override_colors/icon_hover_color = Color(0.780392, 0.435294, 0.360784, 1)
|
||||
icon = ExtResource("4_a24a2")
|
||||
flat = true
|
||||
|
||||
[connection signal="pressed" from="Titlebar/Close" to="." method="_on_close_pressed"]
|
||||
@@ -1,6 +1,17 @@
|
||||
[gd_resource type="Theme" format=3 uid="uid://ks2uyxqg6u4k"]
|
||||
[gd_resource type="Theme" load_steps=3 format=3 uid="uid://ks2uyxqg6u4k"]
|
||||
|
||||
[ext_resource type="FontFile" path="datafile://data/fonts/menufont.bmp" id="9_6bx8b"]
|
||||
[ext_resource type="FontFile" uid="uid://b50bdb32aerbb" path="res://remakes/font/LondrinaSolid-Regular.otf" id="1_1apnt"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wa7wi"]
|
||||
|
||||
[resource]
|
||||
/fonts/menufont = ExtResource("9_6bx8b")
|
||||
default_font = ExtResource("1_1apnt")
|
||||
default_font_size = 29
|
||||
Button/colors/font_color = Color(0.572549, 0.517647, 0.411765, 0.929412)
|
||||
Button/colors/font_outline_color = Color(0, 0, 0, 0.568627)
|
||||
Button/constants/outline_size = 2
|
||||
Button/font_sizes/font_size = 39
|
||||
Button/styles/focus = SubResource("StyleBoxEmpty_wa7wi")
|
||||
Fonts/fonts/large = ExtResource("1_1apnt")
|
||||
Label/colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
Label/constants/outline_size = 8
|
||||
|
||||
Reference in New Issue
Block a user