modification de la scène de cockpit et ajout de lien entre les scènes

This commit is contained in:
2026-02-19 22:15:38 +01:00
parent fadf0cb769
commit dc1a6686bc
130 changed files with 4131 additions and 1286 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://fnv0qhkh40mv"]
[gd_scene format=3 uid="uid://fnv0qhkh40mv"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_0ssee"]
[ext_resource type="Script" uid="uid://bvb4v66bqteuc" path="res://gui/game/announce/scripts/announce.gd" id="1_4evne"]
@@ -104,7 +104,7 @@ _data = {
&"pass": SubResource("Animation_871vo")
}
[node name="Announce" type="Control"]
[node name="Announce" type="Control" unique_id=509404832]
visible = false
clip_contents = true
layout_mode = 3
@@ -116,7 +116,7 @@ grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_4evne")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1385456888]
modulate = Color(1, 1, 1, 0)
clip_contents = true
layout_mode = 1
@@ -132,14 +132,14 @@ mouse_filter = 2
theme = ExtResource("1_0ssee")
alignment = 1
[node name="AnnounceTitle" type="Label" parent="VBoxContainer"]
[node name="AnnounceTitle" type="Label" parent="VBoxContainer" unique_id=2048669092]
unique_name_in_owner = true
layout_mode = 2
text = "New Quota"
label_settings = SubResource("LabelSettings_vbart")
horizontal_alignment = 1
[node name="AnnounceTexture" type="TextureRect" parent="VBoxContainer"]
[node name="AnnounceTexture" type="TextureRect" parent="VBoxContainer" unique_id=1523197516]
unique_name_in_owner = true
modulate = Color(0.886275, 0.623529, 0.196078, 1)
layout_mode = 2
@@ -148,15 +148,13 @@ texture = SubResource("GradientTexture2D_mnweq")
expand_mode = 1
stretch_mode = 1
[node name="AnnounceText" type="Label" parent="VBoxContainer"]
[node name="AnnounceText" type="Label" parent="VBoxContainer" unique_id=147253395]
unique_name_in_owner = true
layout_mode = 2
text = "Decontaminate 50 unit in 10 days"
label_settings = ExtResource("3_7nrno")
horizontal_alignment = 1
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=357490739]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_dvva5")
}
libraries/ = SubResource("AnimationLibrary_dvva5")

View File

@@ -5,11 +5,117 @@
[ext_resource type="PackedScene" uid="uid://brfsapvj2quxm" path="res://gui/game/energy_info/energy_info.tscn" id="4_2wykm"]
[ext_resource type="PackedScene" uid="uid://fnv0qhkh40mv" path="res://gui/game/announce/announce.tscn" id="4_h6540"]
[ext_resource type="PackedScene" uid="uid://df0eop555wfj5" path="res://gui/game/objective_progress_bar/objective_progress_bar.tscn" id="6_dr1y2"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="6_h6540"]
[ext_resource type="Texture2D" uid="uid://b43thuq8piv18" path="res://common/icons/skull.svg" id="7_dr1y2"]
[ext_resource type="PackedScene" uid="uid://clicjf8ts51h8" path="res://gui/game/inventory_gui/inventory_gui.tscn" id="9_id0t5"]
[sub_resource type="Gradient" id="Gradient_id0t5"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.115169, 0.41573, 0.620786, 0.924157)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_j7f85"]
gradient = SubResource("Gradient_id0t5")
fill_to = Vector2(1, 1)
repeat = 1
[sub_resource type="Animation" id="Animation_2wykm"]
resource_name = "NoRechargeAppear"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MarginContainer/GiveUpButton:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.03333333),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MarginContainer/GiveUpButton:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("NoRechargeLeftBaneer:custom_minimum_size")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(0, 50)]
}
[sub_resource type="Animation" id="Animation_id0t5"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("MarginContainer/GiveUpButton:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("MarginContainer/GiveUpButton:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("NoRechargeLeftBaneer:custom_minimum_size")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ykapk"]
_data = {
&"NoRechargeAppear": SubResource("Animation_2wykm"),
&"RESET": SubResource("Animation_id0t5")
}
[node name="GameGui" type="CanvasLayer" unique_id=274698556]
script = ExtResource("1_udau0")
[node name="NoRechargeLeftBaneer" type="TextureRect" parent="." unique_id=827897082]
self_modulate = Color(1, 0.6509804, 0.09019608, 1)
anchors_preset = 10
anchor_right = 1.0
grow_horizontal = 2
texture = SubResource("GradientTexture2D_j7f85")
expand_mode = 1
stretch_mode = 1
[node name="ScoreParticles" type="Control" parent="." unique_id=842190807]
unique_name_in_owner = true
layout_mode = 3
@@ -41,16 +147,36 @@ mouse_filter = 2
layout_mode = 2
size_flags_horizontal = 4
mouse_filter = 2
theme_override_constants/separation = 0
[node name="ObjectiveProgressBar" parent="MarginContainer/VBoxContainer" unique_id=2043451865 instance=ExtResource("6_dr1y2")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
progress = null
[node name="RechargesLeftLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=1961035876]
unique_name_in_owner = true
layout_mode = 2
text = "9 charges left"
label_settings = ExtResource("6_h6540")
horizontal_alignment = 1
[node name="Inventory" parent="MarginContainer" unique_id=1407862321 instance=ExtResource("9_id0t5")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
[node name="GiveUpButton" type="Button" parent="MarginContainer" unique_id=1128310884]
unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
text = "GIVE_UP"
icon = ExtResource("7_dr1y2")
[node name="NoRechargeAnimationPlayer" type="AnimationPlayer" parent="." unique_id=969107428]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_ykapk")

View File

@@ -0,0 +1,44 @@
[gd_scene format=3 uid="uid://by45bbbnf0k13"]
[ext_resource type="Script" uid="uid://cbf2005eqe2aj" path="res://gui/game/objective_progress_bar/scripts/gauge_3d.gd" id="1_d3qsk"]
[ext_resource type="PackedScene" uid="uid://cam5igcebfvsd" path="res://gui/game/objective_progress_bar/assets/3d/gauge.blend" id="2_74wpt"]
[sub_resource type="Gradient" id="Gradient_vk2vv"]
colors = PackedColorArray(1, 0, 0.43137255, 1, 1, 0.6509804, 0.09019608, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_7sip7"]
gradient = SubResource("Gradient_vk2vv")
[sub_resource type="CylinderMesh" id="CylinderMesh_d3qsk"]
height = 4.8
[sub_resource type="Gradient" id="Gradient_74wpt"]
offsets = PackedFloat32Array(0, 0.38308457, 1)
colors = PackedColorArray(1, 0.6509804, 0.09019608, 1, 1, 0.40159988, 0.22089553, 1, 1, 0, 0.43137255, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_figjt"]
gradient = SubResource("Gradient_74wpt")
fill_to = Vector2(0, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_fjj83"]
shading_mode = 0
albedo_texture = SubResource("GradientTexture2D_figjt")
[node name="Gauge3D" type="Node3D" unique_id=232507348]
script = ExtResource("1_d3qsk")
progress = 1.675
[node name="Model" parent="." unique_id=1195456570 instance=ExtResource("2_74wpt")]
[node name="ProgressBar" type="Sprite3D" parent="." unique_id=159202262]
unique_name_in_owner = true
transform = Transform3D(-1.13321775e-07, 0, 0.989, 0, 200, 0, -2.5925, 0, -4.3230564e-08, 0.27917147, -1.0458755, 5.3935585)
visible = false
centered = false
texture = SubResource("GradientTexture1D_7sip7")
[node name="ProgressBar3D" type="MeshInstance3D" parent="." unique_id=1654530777]
unique_name_in_owner = true
transform = Transform3D(2, 0, 0, 0, -8.742278e-08, 2, 0, -2, -8.742278e-08, -0.14886618, 0, 0)
mesh = SubResource("CylinderMesh_d3qsk")
surface_material_override/0 = SubResource("StandardMaterial3D_fjj83")

View File

@@ -4,8 +4,8 @@
[ext_resource type="Script" uid="uid://brqgqwh5uwksh" path="res://gui/game/objective_progress_bar/scripts/objective_progress_bar.gd" id="1_wl86c"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="2_vk2vv"]
[ext_resource type="Environment" uid="uid://bxyp24f85p0xf" path="res://gui/game/assets/gui_3d_environment.tres" id="2_wl86c"]
[ext_resource type="PackedScene" uid="uid://cam5igcebfvsd" path="res://gui/game/objective_progress_bar/assets/3d/gauge.blend" id="3_3aubw"]
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="3_7sip7"]
[ext_resource type="PackedScene" uid="uid://by45bbbnf0k13" path="res://gui/game/objective_progress_bar/gauge_3d.tscn" id="6_vk2vv"]
[sub_resource type="ViewportTexture" id="ViewportTexture_3aubw"]
viewport_path = NodePath("ProgressBarViewPort")
@@ -13,12 +13,6 @@ viewport_path = NodePath("ProgressBarViewPort")
[sub_resource type="QuadMesh" id="QuadMesh_vk2vv"]
size = Vector2(2, 2)
[sub_resource type="Gradient" id="Gradient_vk2vv"]
colors = PackedColorArray(1, 0, 0.43137255, 1, 1, 0.6509804, 0.09019608, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_7sip7"]
gradient = SubResource("Gradient_vk2vv")
[node name="ObjectiveProgressBar" type="MarginContainer" unique_id=2043451865]
offset_right = 300.0
offset_bottom = 75.0
@@ -29,7 +23,7 @@ theme_override_constants/margin_top = 0
theme_override_constants/margin_right = 0
theme_override_constants/margin_bottom = 0
script = ExtResource("1_wl86c")
progress = 0.815
progress = -1.35
text = "0/5"
[node name="TextureRect" type="TextureRect" parent="." unique_id=1998625871]
@@ -65,7 +59,6 @@ expand_mode = 1
stretch_mode = 5
[node name="ProgressBarViewPort" type="SubViewport" parent="." unique_id=459282221]
own_world_3d = true
transparent_bg = true
size = Vector2i(479, 117)
@@ -83,10 +76,6 @@ surface_material_override/0 = ExtResource("1_j2f28")
[node name="WorldEnvironment" type="WorldEnvironment" parent="ProgressBarViewPort" unique_id=1743124302]
environment = ExtResource("2_wl86c")
[node name="gauge" parent="ProgressBarViewPort" unique_id=1465667654 instance=ExtResource("3_3aubw")]
[node name="ProgressBar" type="Sprite3D" parent="ProgressBarViewPort" unique_id=1289085425]
[node name="Gauge3D" parent="ProgressBarViewPort" unique_id=232507348 instance=ExtResource("6_vk2vv")]
unique_name_in_owner = true
transform = Transform3D(-1.5140532e-07, 0, 0.989, 0, 200, 0, -3.46375, 0, -4.3230564e-08, 0.27917147, -1.0458755, 5.3935585)
centered = false
texture = SubResource("GradientTexture1D_7sip7")
progress = -1.35

View File

@@ -0,0 +1,22 @@
@tool
extends Node3D
class_name Gauge3D
const MAX_PROGRESS_BAR_SCALE = 4.25
const CYLINDER_HEIGHT = 4.8
@export var progress := 0. : set = set_progress
func _ready():
if progress != null:
%ProgressBar.scale.x = progress * MAX_PROGRESS_BAR_SCALE
func set_progress(_progress : float):
progress = _progress
if is_node_ready() and progress != null:
var capped_progress = max(0.,min(1., progress))
%ProgressBar3D.scale.y = capped_progress * %ProgressBar3D.scale.x
var bar_length = CYLINDER_HEIGHT
%ProgressBar3D.position.z = - bar_length * capped_progress + bar_length
# %ProgressBar.scale.x = max(0.,min(1., progress)) * MAX_PROGRESS_BAR_SCALE

View File

@@ -0,0 +1 @@
uid://cbf2005eqe2aj

View File

@@ -1,11 +1,12 @@
@tool
extends MarginContainer
class_name ObjectivProgressBar
class_name ObjectiveProgressBar
const MAX_PROGRESS_BAR_SCALE = 4.25
const PROGRESS_BAR_WEIGHT = 0.1
@export var progress := 0. : set = set_progress
@export var progress := 0. :
set(v):
progress = v
if is_node_ready():
%Gauge3D.progress = v
@export var text := "" :
set(v):
text = v
@@ -13,12 +14,5 @@ const PROGRESS_BAR_WEIGHT = 0.1
%ProgressText.text = v
func _ready():
if progress != null:
%ProgressBar.scale.x = progress * MAX_PROGRESS_BAR_SCALE
%ProgressText.text = text
func set_progress(_progress : float):
progress = _progress
if is_node_ready() and progress != null:
%ProgressBar.scale.x = min(1., progress) * MAX_PROGRESS_BAR_SCALE
%Gauge3D.progress = progress

View File

@@ -19,6 +19,7 @@ func _ready():
charge_update(GameInfo.game_data.current_region_data)
player_update(GameInfo.game_data.player_data, false)
%EnergyInfo.reset_size()
%GiveUpButton.pressed.connect(_on_give_up_pressed)
func _on_player_updated(player_data : PlayerData):
player_update(player_data)
@@ -33,9 +34,18 @@ func player_update(player_data : PlayerData, with_animation = true):
func _on_region_updated(region_data : RegionData):
charge_update(region_data)
func charge_update(_region_data : RegionData):
pass
# %ChargeCount.text = tr("%d_CHARGE_LEFT") % (region_data.charges)
func _on_give_up_pressed():
GameInfo.game_data.give_up()
SceneManager.change_to_scene_id('ASTRA')
func charge_update(region_data : RegionData):
%RechargesLeftLabel.text = tr("%d_CHARGE_LEFT") % (region_data.charges)
if region_data.charges == 0 and region_data.state != RegionData.State.SUCCEEDED:
if not %GiveUpButton.visible:
%NoRechargeAnimationPlayer.play("NoRechargeAppear")
else :
if %GiveUpButton.visible:
%NoRechargeAnimationPlayer.play_backward("NoRechargeAppear")
func score_update(with_animation = true):
var objective_progression : float