Post Game jam commit
This commit is contained in:
commit
6db2131520
164 changed files with 172524 additions and 0 deletions
BIN
ui/checkbox_empty.aseprite
Normal file
BIN
ui/checkbox_empty.aseprite
Normal file
Binary file not shown.
47
ui/default_theme.tres
Normal file
47
ui/default_theme.tres
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
[gd_resource type="Theme" load_steps=11 format=3 uid="uid://d3iyu7ukwsn1p"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://ctv72j20ly3an" path="res://assets/fonts/ByteBounce.ttf" id="1_vos2p"]
|
||||
[ext_resource type="Texture2D" uid="uid://dw2h0od36xkcc" path="res://ui/checkbox_tick.png" id="2_0ie0l"]
|
||||
[ext_resource type="Texture2D" uid="uid://bk2onkgbsrhwk" path="res://ui/slider_head.png" id="2_i4llc"]
|
||||
[ext_resource type="Texture2D" uid="uid://w1xt8uvq5e5w" path="res://ui/checkbox_empty.png" id="3_xv3vb"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0ie0l"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_i4llc"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5r0yv"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0ie0l"]
|
||||
content_margin_left = 4.0
|
||||
content_margin_top = 4.0
|
||||
content_margin_right = 4.0
|
||||
content_margin_bottom = 4.0
|
||||
bg_color = Color(0.3478395, 0.3308407, 0.4738807, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xv3vb"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wwq0p"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
|
||||
[resource]
|
||||
Button/fonts/font = ExtResource("1_vos2p")
|
||||
CheckBox/icons/checked = ExtResource("2_0ie0l")
|
||||
CheckBox/icons/unchecked = ExtResource("3_xv3vb")
|
||||
CheckBox/styles/focus = SubResource("StyleBoxEmpty_0ie0l")
|
||||
HSlider/constants/center_grabber = -1
|
||||
HSlider/icons/grabber = ExtResource("2_i4llc")
|
||||
HSlider/icons/grabber_highlight = ExtResource("2_i4llc")
|
||||
HSlider/styles/grabber_area = SubResource("StyleBoxFlat_i4llc")
|
||||
HSlider/styles/grabber_area_highlight = SubResource("StyleBoxFlat_5r0yv")
|
||||
HSlider/styles/slider = SubResource("StyleBoxFlat_0ie0l")
|
||||
Label/font_sizes/font_size = 16
|
||||
Label/fonts/font = ExtResource("1_vos2p")
|
||||
MarginContainer/constants/margin_bottom = 12
|
||||
MarginContainer/constants/margin_left = 12
|
||||
MarginContainer/constants/margin_right = 12
|
||||
MarginContainer/constants/margin_top = 12
|
||||
ProgressBar/fonts/font = ExtResource("1_vos2p")
|
||||
ProgressBar/styles/background = SubResource("StyleBoxFlat_xv3vb")
|
||||
ProgressBar/styles/fill = SubResource("StyleBoxFlat_wwq0p")
|
||||
RichTextLabel/fonts/mono_font = ExtResource("1_vos2p")
|
||||
RichTextLabel/fonts/normal_font = ExtResource("1_vos2p")
|
||||
65
ui/dialogue.gd
Normal file
65
ui/dialogue.gd
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
class_name Dialog
|
||||
extends Control
|
||||
|
||||
@export var char_delay := 0.02
|
||||
|
||||
var message_queue : Array[String] = []
|
||||
var is_printing := false
|
||||
var skip_requested := false
|
||||
@export var dialogue_label : RichTextLabel
|
||||
|
||||
func _ready() -> void:
|
||||
dialogue_label.bbcode_enabled = true
|
||||
dialogue_label.visible_characters = 0
|
||||
|
||||
EventBus.dialogue_requested.connect(add_to_queue)
|
||||
|
||||
|
||||
func add_to_queue(msg: String) -> void:
|
||||
message_queue.append(msg)
|
||||
if not is_printing:
|
||||
visible = true
|
||||
is_printing = true
|
||||
get_tree().paused = true
|
||||
_show_messages()
|
||||
|
||||
func _show_messages() -> void:
|
||||
while not message_queue.is_empty():
|
||||
var next_msg : String = message_queue.pop_front()
|
||||
await _type_text(next_msg)
|
||||
|
||||
_finish_dialogue()
|
||||
|
||||
|
||||
func _type_text(msg: String) -> void:
|
||||
|
||||
dialogue_label.text = msg
|
||||
dialogue_label.visible_characters = 0
|
||||
skip_requested = false
|
||||
|
||||
for i in msg.length():
|
||||
if skip_requested:
|
||||
break
|
||||
|
||||
dialogue_label.visible_characters = i + 1
|
||||
await get_tree().create_timer(char_delay, true, false, true).timeout
|
||||
|
||||
dialogue_label.visible_characters = -1
|
||||
await _wait_for_input()
|
||||
|
||||
func _wait_for_input() -> void:
|
||||
skip_requested = false
|
||||
while not skip_requested:
|
||||
await get_tree().process_frame
|
||||
|
||||
func _finish_dialogue() -> void:
|
||||
dialogue_label.visible_characters = 0
|
||||
dialogue_label.text = ""
|
||||
visible = false
|
||||
is_printing = false
|
||||
get_tree().paused = false
|
||||
EventBus.dialogue_finished.emit()
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("ui_accept") or (event is InputEventMouseButton and event.pressed):
|
||||
skip_requested = true
|
||||
1
ui/dialogue.gd.uid
Normal file
1
ui/dialogue.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bimyryljv4hs2
|
||||
12
ui/texture_container.tscn
Normal file
12
ui/texture_container.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bvp37ljy8eaba"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ccp8bbvjf3ly0" path="res://ui/container_bg.png" id="1_1qqo0"]
|
||||
|
||||
[node name="TextureContainer" type="NinePatchRect"]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = ExtResource("1_1qqo0")
|
||||
patch_margin_left = 10
|
||||
patch_margin_top = 10
|
||||
patch_margin_right = 10
|
||||
patch_margin_bottom = 10
|
||||
231
ui/ui_layer.tscn
Normal file
231
ui/ui_layer.tscn
Normal file
|
|
@ -0,0 +1,231 @@
|
|||
[gd_scene load_steps=13 format=3 uid="uid://bq8ig7s8gxia4"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://d3iyu7ukwsn1p" path="res://ui/default_theme.tres" id="1_1evs6"]
|
||||
[ext_resource type="PackedScene" uid="uid://bvp37ljy8eaba" path="res://ui/texture_container.tscn" id="3_nsgok"]
|
||||
[ext_resource type="Script" uid="uid://c62xd44e27oki" path="res://scripts/settings_menu.gd" id="4_f4m0o"]
|
||||
[ext_resource type="Script" uid="uid://da2hsusvv3rxg" path="res://scripts/debug_ui.gd" id="5_h6use"]
|
||||
[ext_resource type="Script" uid="uid://bimyryljv4hs2" path="res://ui/dialogue.gd" id="6_kes38"]
|
||||
[ext_resource type="Texture2D" uid="uid://bng412si6gw5w" path="res://assets/healt_bar.png" id="7_np4cb"]
|
||||
[ext_resource type="Script" uid="uid://cj6pb1828dcfr" path="res://scripts/health_bar.gd" id="8_8fqmc"]
|
||||
[ext_resource type="Texture2D" uid="uid://03jo0w8b3r0j" path="res://ui/bar_under.png" id="9_fl7ai"]
|
||||
[ext_resource type="Texture2D" uid="uid://do36o00w1kfgm" path="res://ui/bar_progress.png" id="10_iwd8l"]
|
||||
[ext_resource type="Script" uid="uid://cqrqqn2p0h0kb" path="res://scripts/mask_bar.gd" id="11_01h74"]
|
||||
[ext_resource type="Script" uid="uid://llka3aa044jo" path="res://click.gd" id="12_14s75"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dhpj7"]
|
||||
atlas = ExtResource("7_np4cb")
|
||||
region = Rect2(0, 0, 0, 32)
|
||||
|
||||
[node name="UILayer" type="CanvasLayer"]
|
||||
scale = Vector2(4, 4)
|
||||
transform = Transform2D(4, 0, 0, 4, 0, 0)
|
||||
|
||||
[node name="UI" type="Control" parent="."]
|
||||
process_mode = 3
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 480.0
|
||||
offset_bottom = 270.0
|
||||
size_flags_horizontal = 0
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("1_1evs6")
|
||||
|
||||
[node name="Debug" type="Control" parent="UI"]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -40.0
|
||||
offset_bottom = 40.0
|
||||
grow_horizontal = 0
|
||||
mouse_filter = 2
|
||||
script = ExtResource("5_h6use")
|
||||
|
||||
[node name="Label" type="Label" parent="UI/Debug"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -40.0
|
||||
offset_bottom = 23.0
|
||||
grow_horizontal = 0
|
||||
text = "Dbue
|
||||
g
|
||||
g
|
||||
g
|
||||
g
|
||||
g
|
||||
g
|
||||
g
|
||||
g
|
||||
g
|
||||
g
|
||||
g
|
||||
"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="DialogueBox" parent="UI" node_paths=PackedStringArray("dialogue_label") instance=ExtResource("3_nsgok")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -172.61873
|
||||
offset_top = -71.0
|
||||
offset_right = 172.61873
|
||||
offset_bottom = 0.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
script = ExtResource("6_kes38")
|
||||
dialogue_label = NodePath("MarginContainer/DialogueLabel")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="UI/DialogueBox"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="DialogueLabel" type="RichTextLabel" parent="UI/DialogueBox/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_1evs6")
|
||||
text = "This is example dialogue!!"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="UI"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -83.5
|
||||
offset_top = -63.0
|
||||
offset_right = 83.5
|
||||
offset_bottom = -23.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="TextureProgressBar" type="TextureProgressBar" parent="UI/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
max_value = 1.0
|
||||
step = 0.01
|
||||
value = 1.0
|
||||
texture_under = ExtResource("9_fl7ai")
|
||||
texture_progress = ExtResource("10_iwd8l")
|
||||
script = ExtResource("11_01h74")
|
||||
|
||||
[node name="HealthBar" type="TextureRect" parent="UI/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
texture = SubResource("AtlasTexture_dhpj7")
|
||||
script = ExtResource("8_8fqmc")
|
||||
|
||||
[node name="SettingsMenu" parent="UI" node_paths=PackedStringArray("volume_slider", "fullscreen_check", "vsync_check") instance=ExtResource("3_nsgok")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -100.5625
|
||||
offset_top = -100.5625
|
||||
offset_right = 100.5625
|
||||
offset_bottom = 100.5625
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_1evs6")
|
||||
axis_stretch_horizontal = 1
|
||||
axis_stretch_vertical = 1
|
||||
script = ExtResource("4_f4m0o")
|
||||
volume_slider = NodePath("MarginContainer/VBoxContainer/HBoxContainer/Volume")
|
||||
fullscreen_check = NodePath("MarginContainer/VBoxContainer/Fullscreen/CheckBox")
|
||||
vsync_check = NodePath("MarginContainer/VBoxContainer/Vsync/CheckBox")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="UI/SettingsMenu"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_1evs6")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="UI/SettingsMenu/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_1evs6")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="UI/SettingsMenu/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="UI/SettingsMenu/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Volume"
|
||||
|
||||
[node name="Volume" type="HSlider" parent="UI/SettingsMenu/MarginContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme = ExtResource("1_1evs6")
|
||||
max_value = 1.0
|
||||
step = 0.01
|
||||
tick_count = 5
|
||||
ticks_on_borders = true
|
||||
ticks_position = 3
|
||||
|
||||
[node name="Fullscreen" type="HBoxContainer" parent="UI/SettingsMenu/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="UI/SettingsMenu/MarginContainer/VBoxContainer/Fullscreen"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Fullscreen"
|
||||
|
||||
[node name="CheckBox" type="CheckBox" parent="UI/SettingsMenu/MarginContainer/VBoxContainer/Fullscreen"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 10
|
||||
|
||||
[node name="Vsync" type="HBoxContainer" parent="UI/SettingsMenu/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="UI/SettingsMenu/MarginContainer/VBoxContainer/Vsync"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Vsync"
|
||||
|
||||
[node name="CheckBox" type="CheckBox" parent="UI/SettingsMenu/MarginContainer/VBoxContainer/Vsync"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 10
|
||||
|
||||
[node name="Buttons" type="MarginContainer" parent="UI/SettingsMenu/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 10
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="UI/SettingsMenu/MarginContainer/VBoxContainer/Buttons"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 10
|
||||
|
||||
[node name="ExitButton" type="Button" parent="UI/SettingsMenu/MarginContainer/VBoxContainer/Buttons/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Exit"
|
||||
script = ExtResource("12_14s75")
|
||||
|
||||
[node name="ContinueButton" type="Button" parent="UI/SettingsMenu/MarginContainer/VBoxContainer/Buttons/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 10
|
||||
text = "Continue"
|
||||
script = ExtResource("12_14s75")
|
||||
|
||||
[connection signal="value_changed" from="UI/SettingsMenu/MarginContainer/VBoxContainer/HBoxContainer/Volume" to="UI/SettingsMenu" method="_on_volume_changed"]
|
||||
[connection signal="toggled" from="UI/SettingsMenu/MarginContainer/VBoxContainer/Fullscreen/CheckBox" to="UI/SettingsMenu" method="_on_fullscreen_toggled"]
|
||||
[connection signal="toggled" from="UI/SettingsMenu/MarginContainer/VBoxContainer/Vsync/CheckBox" to="UI/SettingsMenu" method="_on_vsync_toggled"]
|
||||
[connection signal="pressed" from="UI/SettingsMenu/MarginContainer/VBoxContainer/Buttons/HBoxContainer2/ExitButton" to="UI/SettingsMenu" method="_on_exit_button_pressed"]
|
||||
[connection signal="pressed" from="UI/SettingsMenu/MarginContainer/VBoxContainer/Buttons/HBoxContainer2/ContinueButton" to="UI/SettingsMenu" method="_on_continue_button_pressed"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue