Fix when ESCPlayer is not selectable or interactive manage click through

This commit is contained in:
Julian Murgia
2022-11-21 13:58:27 +01:00
parent 23b5de6ac2
commit a131efcfc2
21 changed files with 958 additions and 363 deletions

View File

@@ -93,6 +93,7 @@ esc_script = "res://game/rooms/room01/esc/right_exit.esc"
is_exit = true
tooltip_name = "Exit to room 2"
default_action = "walk"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null
@@ -110,6 +111,7 @@ global_id = "r1_wall_item1"
esc_script = "res://game/rooms/room01/esc/wall_item.esc"
tooltip_name = "Artwork"
default_action = "look"
combine_when_selected_action_is_in = [ ]
inventory_texture = ExtResource( 10 )
dialog_color = Color( 1, 1, 1, 1 )
animations = null
@@ -146,6 +148,7 @@ global_id = "r1_wall_item2"
esc_script = "res://game/rooms/room01/esc/wall_item_popupdialog.esc"
tooltip_name = "Artwork 2"
default_action = "look"
combine_when_selected_action_is_in = [ ]
inventory_texture = ExtResource( 9 )
dialog_color = Color( 1, 1, 1, 1 )
animations = null
@@ -182,6 +185,7 @@ global_id = "trigger_talk"
esc_script = "res://game/rooms/room01/esc/trigger.esc"
is_trigger = true
player_orients_on_arrival = false
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null

View File

@@ -63,6 +63,13 @@ esc_script = "res://game/rooms/room06/esc/room06.esc"
player_scene = ExtResource( 4 )
camera_limits = [ Rect2( 0, 0, 1280, 555 ) ]
[node name="ESCBackground" type="TextureRect" parent="."]
margin_right = 1280.0
margin_bottom = 550.0
mouse_filter = 2
texture = ExtResource( 12 )
script = ExtResource( 2 )
[node name="walkable_area" type="Navigation2D" parent="."]
script = ExtResource( 1 )
scale_min = 0.7
@@ -186,13 +193,6 @@ position = Vector2( 640, 427 )
z_index = 400
texture = ExtResource( 11 )
[node name="ESCBackground" type="TextureRect" parent="."]
margin_right = 1280.0
margin_bottom = 550.0
mouse_filter = 2
texture = ExtResource( 12 )
script = ExtResource( 2 )
[node name="Text" type="Node2D" parent="."]
[node name="Polygon2D" type="Polygon2D" parent="Text"]

View File

@@ -0,0 +1,4 @@
:use
set_interactive middle_item false
set_state middle_item folded

View File

@@ -0,0 +1,4 @@
:use
set_interactive upper_item false
set_state upper_item folded

View File

@@ -0,0 +1,135 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=1]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=3]
[sub_resource type="Animation" id=3]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ) ]
}
[sub_resource type="Animation" id=4]
resource_name = "folded"
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ), PoolVector2Array( 950, 337, 988, 484, 962, 639, 1002, 667, 1020, 517, 986, 258, 967, 277 ) ]
}
[sub_resource type="Animation" id=1]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ) ]
}
[sub_resource type="Animation" id=2]
resource_name = "folded"
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ), PoolVector2Array( 191, 80, 159, 753, 213, 755, 203, 570, 222, 489, 272, 223, 246, 99 ) ]
}
[node name="room18" type="Node2D"]
script = ExtResource( 1 )
global_id = "room18"
[node name="ESCBackground" type="TextureRect" parent="."]
mouse_filter = 2
script = ExtResource( 2 )
[node name="items" type="Node2D" parent="."]
[node name="bottom_item" type="Area2D" parent="items"]
pause_mode = 1
script = ExtResource( 3 )
global_id = "bottom_item"
tooltip_name = "Bottom item"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="items/bottom_item"]
color = Color( 0.552941, 0, 0, 1 )
polygon = PoolVector2Array( 460, 418, 413, 568, 672, 693, 906, 484, 679, 346 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/bottom_item"]
polygon = PoolVector2Array( 466, 424, 418, 570, 679, 701, 904, 485, 682, 347 )
[node name="middle_item" type="Area2D" parent="items"]
pause_mode = 1
z_index = 2
script = ExtResource( 3 )
global_id = "middle_item"
esc_script = "res://game/rooms/room18/esc/middle_item.esc"
tooltip_name = "Middle item"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="items/middle_item"]
color = Color( 0.254902, 0.388235, 0, 1 )
polygon = PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/middle_item"]
polygon = PoolVector2Array( 396, 336, 239, 565, 466, 680, 948, 592, 1024, 514, 802, 282, 603, 246 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="items/middle_item"]
anims/RESET = SubResource( 3 )
anims/folded = SubResource( 4 )
[node name="upper_item" type="Area2D" parent="items"]
pause_mode = 1
z_index = 4
script = ExtResource( 3 )
global_id = "upper_item"
esc_script = "res://game/rooms/room18/esc/upper_item.esc"
tooltip_name = "Upper item"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="items/upper_item"]
color = Color( 0.0666667, 0, 0.541176, 1 )
polygon = PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/upper_item"]
polygon = PoolVector2Array( 190, 73, 156, 763, 420, 751, 1064, 818, 1144, 630, 1177, 318, 833, 123 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="items/upper_item"]
anims/RESET = SubResource( 1 )
anims/folded = SubResource( 2 )

View File

@@ -0,0 +1,4 @@
:use
set_interactive bottom_item false
set_state bottom_item folded

View File

@@ -0,0 +1,4 @@
:use
set_interactive middle_item false
set_state middle_item folded

View File

@@ -0,0 +1,4 @@
:use
set_interactive upper_item false
set_state upper_item folded

View File

@@ -0,0 +1,173 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=1]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=3]
[sub_resource type="Animation" id=1]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ) ]
}
[sub_resource type="Animation" id=2]
resource_name = "folded"
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ), PoolVector2Array( 191, 80, 159, 753, 213, 755, 203, 570, 222, 489, 272, 223, 246, 99 ) ]
}
[sub_resource type="Animation" id=3]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ) ]
}
[sub_resource type="Animation" id=4]
resource_name = "folded"
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ), PoolVector2Array( 950, 337, 988, 484, 962, 639, 1002, 667, 1020, 517, 986, 258, 967, 277 ) ]
}
[sub_resource type="Animation" id=5]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ PoolVector2Array( 460, 418, 413, 568, 672, 693, 906, 484, 679, 346 ) ]
}
[sub_resource type="Animation" id=6]
resource_name = "folded"
tracks/0/type = "value"
tracks/0/path = NodePath("Polygon2D:polygon")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ PoolVector2Array( 460, 418, 413, 568, 672, 693, 906, 484, 679, 346 ), PoolVector2Array( 646, 366, 665, 382, 684, 377, 697, 367, 679, 346 ) ]
}
[node name="room19" type="Node2D"]
script = ExtResource( 1 )
global_id = "room19"
[node name="ESCBackground" type="TextureRect" parent="."]
mouse_filter = 2
script = ExtResource( 2 )
[node name="items" type="Node2D" parent="."]
[node name="bottom_item" type="Area2D" parent="items"]
pause_mode = 1
script = ExtResource( 3 )
global_id = "bottom_item"
esc_script = "res://game/rooms/room19/esc/bottom_item.esc"
tooltip_name = "Bottom item"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="items/bottom_item"]
color = Color( 0.0666667, 0, 0.541176, 1 )
polygon = PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/bottom_item"]
polygon = PoolVector2Array( 190, 73, 156, 763, 420, 751, 1064, 818, 1144, 630, 1177, 318, 833, 123 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="items/bottom_item"]
anims/RESET = SubResource( 1 )
anims/folded = SubResource( 2 )
[node name="middle_item" type="Area2D" parent="items"]
pause_mode = 1
z_index = 2
script = ExtResource( 3 )
global_id = "middle_item"
esc_script = "res://game/rooms/room19/esc/middle_item.esc"
tooltip_name = "Middle item"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="items/middle_item"]
color = Color( 0.254902, 0.388235, 0, 1 )
polygon = PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/middle_item"]
polygon = PoolVector2Array( 396, 336, 239, 565, 466, 680, 948, 592, 1024, 514, 802, 282, 603, 246 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="items/middle_item"]
anims/RESET = SubResource( 3 )
anims/folded = SubResource( 4 )
[node name="upper_item" type="Area2D" parent="items"]
pause_mode = 1
z_index = 3
script = ExtResource( 3 )
global_id = "upper_item"
esc_script = "res://game/rooms/room19/esc/upper_item.esc"
tooltip_name = "Upper item"
default_action = "use"
combine_when_selected_action_is_in = [ ]
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="items/upper_item"]
color = Color( 0.552941, 0, 0, 1 )
polygon = PoolVector2Array( 460, 418, 413, 568, 672, 693, 906, 484, 679, 346 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/upper_item"]
polygon = PoolVector2Array( 466, 424, 418, 570, 679, 701, 904, 485, 682, 347 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="items/upper_item"]
anims/RESET = SubResource( 5 )
anims/folded = SubResource( 6 )