Sun, Shovel, Fastforward, GUI Improvements

This commit is contained in:
Фёдор Веселов 2024-09-16 09:57:11 +05:00
commit 63935d5978
28 changed files with 546 additions and 45 deletions

View file

@ -1,6 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://cgm7td1hgs0rr"]
[gd_scene load_steps=5 format=3 uid="uid://cgm7td1hgs0rr"]
[ext_resource type="Texture2D" uid="uid://bjsar1x67xk1t" path="res://assets/sprites/gui/FastForward1.tres" id="1_ta3h7"]
[ext_resource type="Script" path="res://scripts/components/gui/FastForwardButton.cs" id="2_wle4k"]
[ext_resource type="Texture2D" uid="uid://dfr5ofieigu5j" path="res://assets/sprites/gui/FastForward2.tres" id="3_fj838"]
[ext_resource type="Texture2D" uid="uid://qgmsoocd4p1o" path="res://assets/sprites/gui/FastForward3.tres" id="4_2wmv1"]
[node name="FastForwardButton" type="TextureButton"]
anchors_preset = -1
@ -10,3 +13,9 @@ size_flags_vertical = 4
mouse_default_cursor_shape = 2
texture_normal = ExtResource("1_ta3h7")
stretch_mode = 0
script = ExtResource("2_wle4k")
firstSpeed = ExtResource("1_ta3h7")
secondSpeed = ExtResource("3_fj838")
thirdSpeed = ExtResource("4_2wmv1")
[connection signal="pressed" from="." to="." method="OnPressed"]

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=9 format=3 uid="uid://c8qru1yhnbbkl"]
[gd_scene load_steps=10 format=3 uid="uid://c8qru1yhnbbkl"]
[ext_resource type="Texture2D" uid="uid://cabpf23ndlvx0" path="res://assets/sprites/gui/Selection.tres" id="2_5mpv8"]
[ext_resource type="Texture2D" uid="uid://cxlr34yh0bqch" path="res://assets/sprites/gui/DisabledEmptyCard.png" id="2_odd6g"]
[ext_resource type="Script" path="res://scripts/components/gui/PlantSlot.cs" id="3_eer7n"]
[ext_resource type="Shader" path="res://assets/shaders/gui_masking.gdshader" id="4_bryew"]
[ext_resource type="Texture2D" uid="uid://dxyf557m4mq1p" path="res://assets/sprites/gui/EmptyPlantCard.png" id="5_2k0xq"]
@ -22,6 +23,7 @@ anchor_bottom = 0.28
offset_right = -0.200005
mouse_default_cursor_shape = 2
texture_normal = ExtResource("5_2k0xq")
texture_disabled = ExtResource("2_odd6g")
texture_focused = ExtResource("2_5mpv8")
stretch_mode = 0
script = ExtResource("3_eer7n")

View file

@ -25,6 +25,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme = ExtResource("1_xf6ra")
[node name="Hotbar" type="HBoxContainer" parent="."]
@ -34,7 +35,7 @@ anchor_right = 1.0
anchor_bottom = 0.14
offset_bottom = -29.0
grow_horizontal = 2
metadata/_edit_use_anchors_ = true
mouse_filter = 2
[node name="SunCounter" parent="Hotbar" instance=ExtResource("1_le3od")]
layout_mode = 2
@ -45,6 +46,7 @@ theme_override_styles/panel = SubResource("StyleBoxTexture_ps2iw")
[node name="Seedpackets" type="HBoxContainer" parent="Hotbar/PanelContainer"]
layout_mode = 2
mouse_filter = 2
theme_override_constants/separation = 0
[node name="FirstSlot" parent="Hotbar/PanelContainer/Seedpackets" instance=ExtResource("2_cjtsw")]
@ -79,6 +81,8 @@ layout_mode = 2
[node name="ShovelButton" parent="Hotbar" instance=ExtResource("3_bheea")]
layout_mode = 2
size_flags_horizontal = 1
size_flags_vertical = 4
[node name="FastForwardButton" parent="Hotbar" instance=ExtResource("4_66uy4")]
layout_mode = 2

View file

@ -1,6 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://t0vpmycj6c8j"]
[gd_scene load_steps=4 format=3 uid="uid://t0vpmycj6c8j"]
[ext_resource type="Texture2D" uid="uid://cw73vihkrfenc" path="res://assets/sprites/gui/Shovel.tres" id="1_46afk"]
[ext_resource type="Texture2D" uid="uid://fd6drk2su0df" path="res://assets/sprites/gui/EmptyShovel.tres" id="2_pw2pj"]
[ext_resource type="Script" path="res://scripts/components/gui/ShovelButton.cs" id="3_u6gir"]
[node name="ShovelButton" type="TextureButton"]
anchors_preset = -1
@ -11,5 +13,18 @@ offset_bottom = -6.8
size_flags_horizontal = 4
size_flags_vertical = 0
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource("1_46afk")
texture_pressed = ExtResource("2_pw2pj")
stretch_mode = 0
script = ExtResource("3_u6gir")
[node name="RayCast2D" type="RayCast2D" parent="."]
enabled = false
target_position = Vector2(0, 0)
collision_mask = 2
hit_from_inside = true
collide_with_areas = true
collide_with_bodies = false
[connection signal="focus_exited" from="." to="." method="OnFocusExited"]

View file

@ -1,6 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://ky35veswaytr"]
[gd_scene load_steps=6 format=3 uid="uid://ky35veswaytr"]
[ext_resource type="Texture2D" uid="uid://bhp3vuvwf7lak" path="res://assets/sprites/gui/suncounter.tres" id="1_e5x4k"]
[ext_resource type="Theme" uid="uid://b8l285cjcgeyi" path="res://resources/GameStyle.tres" id="1_vhhcn"]
[ext_resource type="Texture2D" uid="uid://c47rflkf2wap0" path="res://assets/sprites/sun.tres" id="2_gugre"]
[ext_resource type="Script" path="res://scripts/components/gui/SunCounter.cs" id="3_qhmb8"]
@ -15,6 +16,7 @@ anchor_bottom = 0.067
offset_right = -0.200001
offset_bottom = 0.199999
size_flags_vertical = 0
theme = ExtResource("1_vhhcn")
texture = ExtResource("1_e5x4k")
[node name="Sun" type="TextureRect" parent="."]
@ -37,11 +39,11 @@ anchors_preset = -1
anchor_left = 0.122
anchor_top = 0.222
anchor_right = 0.878
anchor_bottom = 0.778
anchor_bottom = 0.815
offset_left = 0.0219994
offset_top = 0.00599957
offset_right = -0.0219994
offset_bottom = -0.00600243
offset_bottom = -0.00500107
label_settings = SubResource("LabelSettings_lxkq5")
horizontal_alignment = 1
vertical_alignment = 1