gros dev pre proto
* Changement de l'UI, ajouts de l'inspecteur par carte et changement de police * Ajout d'un semblant d'exploration * Ajout de la sauvegarde des entités * Restructuration mineure de l'arborescence * Fix divers et réécriture des textes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://0yr6b2jtuttm"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://0yr6b2jtuttm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vhumsfntpqcl" path="res://gui/pointer/scripts/pointer.gd" id="1_1pe2k"]
|
||||
[ext_resource type="Texture2D" uid="uid://bspffyprdywgc" path="res://gui/pointer/assets/cursors/pointer.svg" id="2_q4bvb"]
|
||||
@@ -6,6 +6,27 @@
|
||||
[ext_resource type="Texture2D" uid="uid://djb52fosgmv4j" path="res://common/icons/left_click.svg" id="3_pshoq"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="4_b4uwv"]
|
||||
[ext_resource type="Script" uid="uid://c60a1bjcuj4hd" path="res://common/vfx/circle/scripts/circle.gd" id="5_b4uwv"]
|
||||
[ext_resource type="PackedScene" uid="uid://3ss8pvhsackj" path="res://gui/game/card/card_visualiser.tscn" id="6_7j4mj"]
|
||||
[ext_resource type="Shader" uid="uid://bqjwmomh851lc" path="res://common/vfx/materials/shaders/skew.gdshader" id="7_wgcdp"]
|
||||
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="8_xb313"]
|
||||
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="9_s1ym6"]
|
||||
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="10_d4v46"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="11_s1ym6"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_s1ym6"]
|
||||
shader = ExtResource("7_wgcdp")
|
||||
shader_parameter/fov = 90.0
|
||||
shader_parameter/cull_back = true
|
||||
shader_parameter/y_rot = 8.409235e-36
|
||||
shader_parameter/x_rot = -9.785961e-36
|
||||
shader_parameter/inset = 0.0
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_xb313"]
|
||||
viewport_path = NodePath("SubViewport")
|
||||
|
||||
[sub_resource type="Resource" id="Resource_mrxa2"]
|
||||
script = ExtResource("8_xb313")
|
||||
metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
|
||||
|
||||
[node name="Pointer" type="Node"]
|
||||
process_mode = 3
|
||||
@@ -32,12 +53,6 @@ size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="InspectorText" type="Label" parent="CanvasLayer/Inspector/Container"]
|
||||
unique_name_in_owner = true
|
||||
z_index = 1
|
||||
layout_mode = 2
|
||||
text = "Item"
|
||||
|
||||
[node name="Action" type="HBoxContainer" parent="CanvasLayer/Inspector/Container"]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 1, 0.168627, 1)
|
||||
@@ -68,6 +83,46 @@ script = ExtResource("5_b4uwv")
|
||||
opacity = 0.4
|
||||
metadata/_custom_type_script = "uid://c60a1bjcuj4hd"
|
||||
|
||||
[node name="CardsCanvasLayer" type="CanvasLayer" parent="."]
|
||||
layer = 2
|
||||
|
||||
[node name="CardPosition" type="Control" parent="CardsCanvasLayer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 3
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="CardsCanvasLayer/CardPosition"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -175.0
|
||||
offset_top = -130.0
|
||||
offset_right = 175.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
mouse_filter = 2
|
||||
theme_override_constants/margin_bottom = 30
|
||||
|
||||
[node name="CardVisualiser" parent="CardsCanvasLayer/CardPosition/MarginContainer" instance=ExtResource("6_7j4mj")]
|
||||
unique_name_in_owner = true
|
||||
modulate = Color(1, 1, 1, 0.5003133)
|
||||
material = SubResource("ShaderMaterial_s1ym6")
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
mouse_filter = 0
|
||||
texture = SubResource("ViewportTexture_xb313")
|
||||
card_info = SubResource("Resource_mrxa2")
|
||||
|
||||
[node name="Audio" type="Node" parent="."]
|
||||
|
||||
[node name="Click" type="AudioStreamPlayer" parent="Audio"]
|
||||
|
||||
@@ -9,10 +9,13 @@ const ZONE_OPACITY = 0.4
|
||||
const ZONE_ACTIVATED_COLOR = Color.TURQUOISE
|
||||
const ZONE_DEACTIVATED_COLOR = Color.REBECCA_PURPLE
|
||||
|
||||
const CARD_VISUALISATION_TIME = 1.0
|
||||
|
||||
@export var default_cursor : Texture2D
|
||||
|
||||
var inspected : Node = null
|
||||
var inspected_info : Inspector.Info = null
|
||||
var last_inspected : Node = null
|
||||
var time_last_inspected : float = 0.
|
||||
var player : Player # renseigné par Player
|
||||
var can_interact : bool = false
|
||||
var current_selected_item : Item = null
|
||||
@@ -22,7 +25,6 @@ var can_use_item : bool = false
|
||||
|
||||
func _ready():
|
||||
Input.set_custom_mouse_cursor(default_cursor)
|
||||
%InspectorText.visible = false
|
||||
%Action.visible = false
|
||||
|
||||
func _input(_event):
|
||||
@@ -40,11 +42,12 @@ func _input(_event):
|
||||
player.try_interact(interactable)
|
||||
elif can_use_item:
|
||||
player.try_use_item(
|
||||
player.inventory.get_item(),
|
||||
player.data.inventory.get_item(),
|
||||
player.get_global_mouse_position()
|
||||
)
|
||||
|
||||
func _process(_delta):
|
||||
func _process(delta):
|
||||
time_last_inspected += delta
|
||||
%Inspector.position = get_viewport().get_mouse_position()
|
||||
|
||||
if player:
|
||||
@@ -54,7 +57,7 @@ func _process(_delta):
|
||||
and player.can_interact(inspected)
|
||||
)
|
||||
|
||||
current_selected_item = player.inventory.get_item()
|
||||
current_selected_item = player.data.inventory.get_item()
|
||||
|
||||
could_use_item = (
|
||||
current_selected_item
|
||||
@@ -76,22 +79,37 @@ func _process(_delta):
|
||||
|
||||
%ActionZone.queue_redraw()
|
||||
|
||||
update_card()
|
||||
|
||||
update_inspector()
|
||||
|
||||
func inspect(node : Node, info : Inspector.Info):
|
||||
func inspect(node : Node):
|
||||
if inspected and inspected != node and inspected.has_method("inspect"):
|
||||
inspected.inspect(false)
|
||||
inspected_info = info
|
||||
inspected = node
|
||||
inspected_changed.emit(inspected_info)
|
||||
last_inspected = node
|
||||
time_last_inspected = 0
|
||||
if inspected.has_method("inspect"):
|
||||
inspected.inspect(true)
|
||||
update_inspector()
|
||||
|
||||
func update_card():
|
||||
if not last_inspected or time_last_inspected > CARD_VISUALISATION_TIME:
|
||||
%CardVisualiser.hide()
|
||||
|
||||
elif last_inspected != null and last_inspected is InspectableEntity:
|
||||
%CardVisualiser.card_info = last_inspected.card_info()
|
||||
%CardVisualiser.show()
|
||||
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
%CardPosition.position = last_inspected.global_position - camera.global_position + screen_size / 2
|
||||
|
||||
if %CardVisualiser.is_mouse_over():
|
||||
time_last_inspected = 0.
|
||||
|
||||
|
||||
func update_inspector():
|
||||
%InspectorText.visible = inspected != null
|
||||
if inspected and inspected is InspectableEntity:
|
||||
%InspectorText.text = inspected.pointer_text()
|
||||
|
||||
if player:
|
||||
if can_interact and inspected and inspected is Interactable:
|
||||
@@ -118,6 +136,4 @@ func stop_inspect(node : Node):
|
||||
node.inspect(false)
|
||||
if inspected == node:
|
||||
inspected = null
|
||||
inspected_info = null
|
||||
inspected_changed.emit(inspected_info)
|
||||
update_inspector()
|
||||
|
||||
Reference in New Issue
Block a user