#44 changement de la méthode d'interaction et d'utilisation du joueur pour une plus grande liberté de la souris
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=21 format=3 uid="uid://12nak7amd1uq"]
|
||||
[gd_scene load_steps=22 format=3 uid="uid://12nak7amd1uq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cqao7n800qy40" path="res://gui/game/scripts/game_gui.gd" id="1_udau0"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/game/ressources/default_theme.tres" id="2_nq5i2"]
|
||||
@@ -136,6 +136,34 @@ tracks/2/keys = {
|
||||
"values": [Color(0.866667, 0.152941, 0.337255, 0), Color(0.866667, 0.152941, 0.337255, 0.392157), Color(0.866667, 0.152941, 0.337255, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_id0t5"]
|
||||
resource_name = "not_permitted"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Effect:visible")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [true, false]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Effect:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.266667),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(0.866667, 0.152941, 0.337255, 0), Color(0.866667, 0.152941, 0.337255, 0.392157), Color(0.866667, 0.152941, 0.337255, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_k4juk"]
|
||||
resource_name = "recharge_fade_in"
|
||||
tracks/0/type = "value"
|
||||
@@ -234,6 +262,7 @@ tracks/2/keys = {
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_iyvkh"),
|
||||
&"no_energy_left": SubResource("Animation_n4kem"),
|
||||
&"not_permitted": SubResource("Animation_id0t5"),
|
||||
&"recharge_fade_in": SubResource("Animation_k4juk"),
|
||||
&"recharge_fade_out": SubResource("Animation_fovlv"),
|
||||
&"upgrade": SubResource("Animation_2wykm")
|
||||
@@ -260,15 +289,6 @@ size_flags_vertical = 3
|
||||
mouse_filter = 1
|
||||
script = ExtResource("1_udau0")
|
||||
|
||||
[node name="GameAction" type="TextureButton" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
@@ -401,43 +421,6 @@ label_settings = SubResource("LabelSettings_n4kem")
|
||||
autowrap_mode = 3
|
||||
clip_text = true
|
||||
|
||||
[node name="AvailableActions" type="HBoxContainer" parent="MarginContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 8
|
||||
theme = ExtResource("2_nq5i2")
|
||||
|
||||
[node name="Plant" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Space/Click - Plant Seed"
|
||||
|
||||
[node name="Interact" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "E - Interact"
|
||||
|
||||
[node name="GetItem" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "E - Take Item"
|
||||
|
||||
[node name="SwapItem" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "E - Swap Item"
|
||||
|
||||
[node name="DropItem" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "W - Drop Item"
|
||||
|
||||
[node name="UseItem" type="Label" parent="MarginContainer/AvailableActions"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Space/Click - Use Item"
|
||||
|
||||
[node name="TopRightContent" type="HBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
@@ -493,6 +476,5 @@ grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
texture = SubResource("GradientTexture2D_id0t5")
|
||||
|
||||
[connection signal="button_down" from="GameAction" to="." method="_on_game_action_button_down"]
|
||||
[connection signal="pressed" from="MarginContainer/DayPass" to="." method="_on_day_pass_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/TopRightContent/Pause" to="." method="_on_pause_pressed"]
|
||||
|
||||
@@ -76,8 +76,8 @@ horizontal_alignment = 1
|
||||
[node name="ControlsText" type="Label" parent="Tutorial/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "QWERTY/AZERTY/Directional Arrows : Move
|
||||
E : Interact/Pickup Items
|
||||
Space/Click : Use Item
|
||||
Left Click : Interact/Pickup Items
|
||||
Right Click/Space : Use Item
|
||||
W : Drop Item
|
||||
"
|
||||
horizontal_alignment = 1
|
||||
|
||||
@@ -11,14 +11,6 @@ func _on_player_updated(player:Player):
|
||||
%EnergyCount.text = str(player.energy) + "/" + str(player.max_energy)
|
||||
%EnergyInfo.modulate = Color.WHITE if player.energy > 0 else Color.RED
|
||||
|
||||
%AvailableActions/GetItem.visible = player.closest_interactable is ItemObject and player.inventory.get_item() == null
|
||||
%AvailableActions/Interact.visible = not player.closest_interactable is ItemObject and player.can_interact
|
||||
%AvailableActions/SwapItem.visible = player.closest_interactable is ItemObject and player.inventory.get_item() != null
|
||||
%AvailableActions/DropItem.visible = player.inventory.get_item() != null
|
||||
%AvailableActions/UseItem.visible = player.inventory.get_item() and player.can_use_item and not player.inventory.get_item() is Seed
|
||||
%AvailableActions/Plant.visible = player.inventory.get_item() and player.can_use_item and player.inventory.get_item() is Seed
|
||||
|
||||
|
||||
%ItemInfo.visible = player.inventory.get_item() != null
|
||||
if player.inventory.get_item():
|
||||
var item : Item = player.inventory.get_item()
|
||||
@@ -53,3 +45,7 @@ func _on_pause_pressed():
|
||||
|
||||
func _on_player_upgraded():
|
||||
$AnimationPlayer.play("upgrade")
|
||||
|
||||
|
||||
func _on_player_action_not_permitted():
|
||||
$AnimationPlayer.play("not_permitted")
|
||||
|
||||
Reference in New Issue
Block a user