Add Scanner and powerstorage ui
This commit is contained in:
parent
6e8d2e972c
commit
6b25359a38
17 changed files with 304 additions and 55 deletions
|
@ -90,7 +90,6 @@ func _ui_fade_completed(anim_name):
|
||||||
if anim_name == "fadeout":
|
if anim_name == "fadeout":
|
||||||
manage_controls(false)
|
manage_controls(false)
|
||||||
|
|
||||||
|
|
||||||
func _force_close_ui():
|
func _force_close_ui():
|
||||||
if open:
|
if open:
|
||||||
open = false
|
open = false
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
[ext_resource path="res://Graphics/light_shadow_light.png" type="Texture" id=5]
|
[ext_resource path="res://Graphics/light_shadow_light.png" type="Texture" id=5]
|
||||||
[ext_resource path="res://Actors/Components/ActivationRange.gd" type="Script" id=6]
|
[ext_resource path="res://Actors/Components/ActivationRange.gd" type="Script" id=6]
|
||||||
|
|
||||||
[sub_resource type="CanvasItemMaterial" id=1]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
blend_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=2]
|
|
||||||
extents = Vector2( 16, 16 )
|
extents = Vector2( 16, 16 )
|
||||||
|
|
||||||
|
[sub_resource type="CanvasItemMaterial" id=2]
|
||||||
|
blend_mode = 1
|
||||||
|
|
||||||
[sub_resource type="Animation" id=3]
|
[sub_resource type="Animation" id=3]
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/path = NodePath("computer/screen:modulate")
|
tracks/0/path = NodePath("computer/screen:modulate")
|
||||||
|
@ -48,7 +48,7 @@ tracks/0/keys = {
|
||||||
length = 0.2
|
length = 0.2
|
||||||
step = 0.05
|
step = 0.05
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/path = NodePath("Control:modulate")
|
tracks/0/path = NodePath("../Control:modulate")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
|
@ -60,7 +60,7 @@ tracks/0/keys = {
|
||||||
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||||||
}
|
}
|
||||||
tracks/1/type = "bezier"
|
tracks/1/type = "bezier"
|
||||||
tracks/1/path = NodePath("Control:position:y")
|
tracks/1/path = NodePath("../Control:position:y")
|
||||||
tracks/1/interp = 1
|
tracks/1/interp = 1
|
||||||
tracks/1/loop_wrap = true
|
tracks/1/loop_wrap = true
|
||||||
tracks/1/imported = false
|
tracks/1/imported = false
|
||||||
|
@ -73,7 +73,7 @@ tracks/1/keys = {
|
||||||
[sub_resource type="Animation" id=6]
|
[sub_resource type="Animation" id=6]
|
||||||
length = 0.2
|
length = 0.2
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/path = NodePath("Control:modulate")
|
tracks/0/path = NodePath("../Control:modulate")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
|
@ -85,7 +85,7 @@ tracks/0/keys = {
|
||||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||||
}
|
}
|
||||||
tracks/1/type = "bezier"
|
tracks/1/type = "bezier"
|
||||||
tracks/1/path = NodePath("Control:position:y")
|
tracks/1/path = NodePath("../Control:position:y")
|
||||||
tracks/1/interp = 1
|
tracks/1/interp = 1
|
||||||
tracks/1/loop_wrap = true
|
tracks/1/loop_wrap = true
|
||||||
tracks/1/imported = false
|
tracks/1/imported = false
|
||||||
|
@ -102,6 +102,10 @@ extents = Vector2( 48, 48 )
|
||||||
input_pickable = true
|
input_pickable = true
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 16, 16 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="computer" type="Sprite" parent="."]
|
[node name="computer" type="Sprite" parent="."]
|
||||||
texture = ExtResource( 2 )
|
texture = ExtResource( 2 )
|
||||||
centered = false
|
centered = false
|
||||||
|
@ -109,7 +113,7 @@ region_enabled = true
|
||||||
region_rect = Rect2( 0, 0, 32, 32 )
|
region_rect = Rect2( 0, 0, 32, 32 )
|
||||||
|
|
||||||
[node name="screen" type="Sprite" parent="computer"]
|
[node name="screen" type="Sprite" parent="computer"]
|
||||||
material = SubResource( 1 )
|
material = SubResource( 2 )
|
||||||
texture = ExtResource( 1 )
|
texture = ExtResource( 1 )
|
||||||
centered = false
|
centered = false
|
||||||
region_enabled = true
|
region_enabled = true
|
||||||
|
@ -121,10 +125,6 @@ texture = ExtResource( 5 )
|
||||||
texture_scale = 0.5
|
texture_scale = 0.5
|
||||||
energy = 0.5
|
energy = 0.5
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
||||||
position = Vector2( 16, 16 )
|
|
||||||
shape = SubResource( 2 )
|
|
||||||
|
|
||||||
[node name="ScreenAnimation" type="AnimationPlayer" parent="."]
|
[node name="ScreenAnimation" type="AnimationPlayer" parent="."]
|
||||||
autoplay = "on"
|
autoplay = "on"
|
||||||
anims/off = SubResource( 3 )
|
anims/off = SubResource( 3 )
|
||||||
|
|
|
@ -2,10 +2,7 @@ extends Control
|
||||||
|
|
||||||
onready var scene = $"/root/scene" as GameInstance
|
onready var scene = $"/root/scene" as GameInstance
|
||||||
|
|
||||||
func _ready():
|
func _physics_process(_delta):
|
||||||
pass
|
|
||||||
|
|
||||||
func _physics_process(delta):
|
|
||||||
var speed_str = "(" + str(round(scene.world.map.current_ship_speed)) + " u/s)"
|
var speed_str = "(" + str(round(scene.world.map.current_ship_speed)) + " u/s)"
|
||||||
$Container/VelocityBox/HBoxContainer/CurrentSpeed.text = speed_str
|
$Container/VelocityBox/HBoxContainer/CurrentSpeed.text = speed_str
|
||||||
var dir_str = "(" + str(round(rad2deg(scene.world.map.current_ship_direction))) + " deg)"
|
var dir_str = "(" + str(round(rad2deg(scene.world.map.current_ship_direction))) + " deg)"
|
||||||
|
|
|
@ -4,42 +4,42 @@
|
||||||
[ext_resource path="res://Graphics/tgstation/opening-sheet.png" type="Texture" id=2]
|
[ext_resource path="res://Graphics/tgstation/opening-sheet.png" type="Texture" id=2]
|
||||||
[ext_resource path="res://Actors/Components/ActivationRange.gd" type="Script" id=3]
|
[ext_resource path="res://Actors/Components/ActivationRange.gd" type="Script" id=3]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=1]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
atlas = ExtResource( 2 )
|
extents = Vector2( 16, 16 )
|
||||||
region = Rect2( 0, 64, 32, 32 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=2]
|
[sub_resource type="AtlasTexture" id=2]
|
||||||
atlas = ExtResource( 2 )
|
atlas = ExtResource( 2 )
|
||||||
region = Rect2( 32, 32, 32, 32 )
|
region = Rect2( 0, 64, 32, 32 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=3]
|
[sub_resource type="AtlasTexture" id=3]
|
||||||
atlas = ExtResource( 2 )
|
atlas = ExtResource( 2 )
|
||||||
region = Rect2( 0, 32, 32, 32 )
|
region = Rect2( 32, 32, 32, 32 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=4]
|
[sub_resource type="AtlasTexture" id=4]
|
||||||
atlas = ExtResource( 2 )
|
atlas = ExtResource( 2 )
|
||||||
region = Rect2( 32, 0, 32, 32 )
|
region = Rect2( 0, 32, 32, 32 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=5]
|
[sub_resource type="AtlasTexture" id=5]
|
||||||
atlas = ExtResource( 2 )
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 32, 0, 32, 32 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=6]
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
region = Rect2( 0, 0, 32, 32 )
|
region = Rect2( 0, 0, 32, 32 )
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=6]
|
[sub_resource type="SpriteFrames" id=7]
|
||||||
animations = [ {
|
animations = [ {
|
||||||
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
|
"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "close",
|
"name": "close",
|
||||||
"speed": 20.0
|
"speed": 20.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 5 ), SubResource( 4 ), SubResource( 3 ), SubResource( 2 ), SubResource( 1 ) ],
|
"frames": [ SubResource( 6 ), SubResource( 5 ), SubResource( 4 ), SubResource( 3 ), SubResource( 2 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "open",
|
"name": "open",
|
||||||
"speed": 20.0
|
"speed": 20.0
|
||||||
} ]
|
} ]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=7]
|
|
||||||
extents = Vector2( 16, 16 )
|
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id=8]
|
[sub_resource type="CircleShape2D" id=8]
|
||||||
radius = 64.0
|
radius = 64.0
|
||||||
|
|
||||||
|
@ -47,17 +47,17 @@ radius = 64.0
|
||||||
input_pickable = true
|
input_pickable = true
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 16, 16 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="Sprite" type="AnimatedSprite" parent="."]
|
[node name="Sprite" type="AnimatedSprite" parent="."]
|
||||||
frames = SubResource( 6 )
|
frames = SubResource( 7 )
|
||||||
animation = "close"
|
animation = "close"
|
||||||
frame = 4
|
frame = 4
|
||||||
playing = true
|
playing = true
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
||||||
position = Vector2( 16, 16 )
|
|
||||||
shape = SubResource( 7 )
|
|
||||||
|
|
||||||
[node name="Timer" type="Timer" parent="."]
|
[node name="Timer" type="Timer" parent="."]
|
||||||
wait_time = 5.0
|
wait_time = 5.0
|
||||||
one_shot = true
|
one_shot = true
|
||||||
|
|
|
@ -5,25 +5,25 @@
|
||||||
[ext_resource path="res://Graphics/tgstation/engine-big.png" type="Texture" id=3]
|
[ext_resource path="res://Graphics/tgstation/engine-big.png" type="Texture" id=3]
|
||||||
[ext_resource path="res://Graphics/light_shadow_light.png" type="Texture" id=4]
|
[ext_resource path="res://Graphics/light_shadow_light.png" type="Texture" id=4]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=2]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
extents = Vector2( 48, 48 )
|
extents = Vector2( 48, 48 )
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=1]
|
[sub_resource type="RectangleShape2D" id=2]
|
||||||
extents = Vector2( 72, 72 )
|
extents = Vector2( 72, 72 )
|
||||||
|
|
||||||
[node name="Engine" type="StaticBody2D"]
|
[node name="Engine" type="StaticBody2D"]
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 48, 48 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="engine" type="Sprite" parent="."]
|
[node name="engine" type="Sprite" parent="."]
|
||||||
texture = ExtResource( 3 )
|
texture = ExtResource( 3 )
|
||||||
centered = false
|
centered = false
|
||||||
region_enabled = true
|
region_enabled = true
|
||||||
region_rect = Rect2( 0, 0, 96, 96 )
|
region_rect = Rect2( 0, 0, 96, 96 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
||||||
position = Vector2( 48, 48 )
|
|
||||||
shape = SubResource( 2 )
|
|
||||||
|
|
||||||
[node name="Light2D" type="Light2D" parent="."]
|
[node name="Light2D" type="Light2D" parent="."]
|
||||||
position = Vector2( 48, 48 )
|
position = Vector2( 48, 48 )
|
||||||
texture = ExtResource( 4 )
|
texture = ExtResource( 4 )
|
||||||
|
@ -37,4 +37,4 @@ script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="ActivationRange"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="ActivationRange"]
|
||||||
position = Vector2( 48, 56 )
|
position = Vector2( 48, 56 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 2 )
|
||||||
|
|
|
@ -14,6 +14,9 @@ extents = Vector2( 48, 32 )
|
||||||
[node name="Lighttube" type="Area2D"]
|
[node name="Lighttube" type="Area2D"]
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="light" type="Sprite" parent="."]
|
[node name="light" type="Sprite" parent="."]
|
||||||
texture = ExtResource( 2 )
|
texture = ExtResource( 2 )
|
||||||
region_enabled = true
|
region_enabled = true
|
||||||
|
@ -31,9 +34,6 @@ __meta__ = {
|
||||||
"_edit_lock_": true
|
"_edit_lock_": true
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
||||||
shape = SubResource( 1 )
|
|
||||||
|
|
||||||
[node name="ActivationRange" type="Area2D" parent="."]
|
[node name="ActivationRange" type="Area2D" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
|
|
|
@ -1,3 +1,38 @@
|
||||||
extends StaticBody2D
|
extends StaticBody2D
|
||||||
|
|
||||||
class_name GameObjectPowerStorage
|
class_name GameObjectPowerStorage
|
||||||
|
|
||||||
|
var open = false
|
||||||
|
onready var activationRange = $ActivationRange as ActivationRange
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
if not Engine.editor_hint:
|
||||||
|
activationRange.visible = true
|
||||||
|
|
||||||
|
func _input(event):
|
||||||
|
if event is InputEventMouseButton and event.pressed and not is_inside and open:
|
||||||
|
open = false
|
||||||
|
$UIAnimation.play("fadeout")
|
||||||
|
|
||||||
|
func _input_event(_viewport, event, _shape_idx):
|
||||||
|
if Engine.editor_hint:
|
||||||
|
return
|
||||||
|
if event is InputEventMouseButton and event.pressed and not open:
|
||||||
|
# Must be in range
|
||||||
|
if activationRange.in_range():
|
||||||
|
open = true
|
||||||
|
$Control/PowerUI.visible = true
|
||||||
|
$UIAnimation.play("fadein")
|
||||||
|
|
||||||
|
var is_inside = false
|
||||||
|
func _ui_focus_changed(entered):
|
||||||
|
is_inside = entered
|
||||||
|
|
||||||
|
func _ui_fade_completed(anim_name):
|
||||||
|
if anim_name == "fadeout":
|
||||||
|
$Control/PowerUI.visible = false
|
||||||
|
|
||||||
|
func _force_close_ui():
|
||||||
|
if open:
|
||||||
|
open = false
|
||||||
|
$UIAnimation.play("fadeout")
|
||||||
|
|
|
@ -1,18 +1,102 @@
|
||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=9 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Actors/Objects/PowerStorage/PowerStorage.gd" type="Script" id=1]
|
[ext_resource path="res://Actors/Objects/PowerStorage/PowerStorage.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Graphics/tgstation/smes.png" type="Texture" id=2]
|
[ext_resource path="res://Graphics/tgstation/smes.png" type="Texture" id=2]
|
||||||
|
[ext_resource path="res://Actors/Components/ActivationRange.gd" type="Script" id=3]
|
||||||
|
[ext_resource path="res://Actors/Objects/PowerStorage/UI/PowerUI.tscn" type="PackedScene" id=4]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=1]
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
extents = Vector2( 16, 16 )
|
extents = Vector2( 16, 16 )
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=2]
|
||||||
|
length = 0.2
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/path = NodePath("Control:modulate")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PoolRealArray( 0, 0.2 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||||||
|
}
|
||||||
|
tracks/1/type = "bezier"
|
||||||
|
tracks/1/path = NodePath("Control:position:y")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"points": PoolRealArray( 10, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0 ),
|
||||||
|
"times": PoolRealArray( 0, 0.2 )
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=3]
|
||||||
|
length = 0.2
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/path = NodePath("Control:modulate")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PoolRealArray( 0, 0.2 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
|
"update": 0,
|
||||||
|
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||||
|
}
|
||||||
|
tracks/1/type = "bezier"
|
||||||
|
tracks/1/path = NodePath("Control:position:y")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 10, -0.25, 0, 0.25, 0 ),
|
||||||
|
"times": PoolRealArray( 0, 0.2 )
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id=4]
|
||||||
|
radius = 56.0
|
||||||
|
|
||||||
[node name="StaticBody2D" type="StaticBody2D"]
|
[node name="StaticBody2D" type="StaticBody2D"]
|
||||||
|
input_pickable = true
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 16, 16 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="smes" type="Sprite" parent="."]
|
[node name="smes" type="Sprite" parent="."]
|
||||||
texture = ExtResource( 2 )
|
texture = ExtResource( 2 )
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="UIAnimation" type="AnimationPlayer" parent="."]
|
||||||
|
anims/fadein = SubResource( 2 )
|
||||||
|
anims/fadeout = SubResource( 3 )
|
||||||
|
|
||||||
|
[node name="Control" type="Node2D" parent="."]
|
||||||
|
position = Vector2( 16, 0 )
|
||||||
|
z_index = 999
|
||||||
|
|
||||||
|
[node name="PowerUI" parent="Control" instance=ExtResource( 4 )]
|
||||||
|
visible = false
|
||||||
|
margin_left = -50.0
|
||||||
|
margin_top = -73.0
|
||||||
|
margin_right = 150.0
|
||||||
|
margin_bottom = 57.0
|
||||||
|
rect_scale = Vector2( 0.5, 0.5 )
|
||||||
|
|
||||||
|
[node name="ActivationRange" type="Area2D" parent="."]
|
||||||
|
visible = false
|
||||||
position = Vector2( 16, 16 )
|
position = Vector2( 16, 16 )
|
||||||
shape = SubResource( 1 )
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="ActivationRange"]
|
||||||
|
shape = SubResource( 4 )
|
||||||
|
[connection signal="mouse_entered" from="Control/PowerUI" to="." method="_ui_focus_changed" binds= [ true ]]
|
||||||
|
[connection signal="mouse_exited" from="Control/PowerUI" to="." method="_ui_focus_changed" binds= [ false ]]
|
||||||
|
[connection signal="player_left" from="ActivationRange" to="." method="_force_close_ui"]
|
||||||
|
|
6
Actors/Objects/PowerStorage/UI/PowerUI.gd
Normal file
6
Actors/Objects/PowerStorage/UI/PowerUI.gd
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
onready var scene = $"/root/scene" as GameInstance
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
pass
|
61
Actors/Objects/PowerStorage/UI/PowerUI.tscn
Normal file
61
Actors/Objects/PowerStorage/UI/PowerUI.tscn
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Actors/Objects/PowerStorage/UI/PowerUI.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://Graphics/UI/ui-popup-panel.png" type="Texture" id=2]
|
||||||
|
[ext_resource path="res://Graphics/unshaded_mat.tres" type="Material" id=4]
|
||||||
|
|
||||||
|
[node name="PowerUI" type="Control"]
|
||||||
|
material = ExtResource( 4 )
|
||||||
|
margin_left = -100.0
|
||||||
|
margin_top = -150.0
|
||||||
|
margin_right = 100.0
|
||||||
|
margin_bottom = -20.0
|
||||||
|
mouse_filter = 1
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="."]
|
||||||
|
material = ExtResource( 4 )
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
margin_left = -8.0
|
||||||
|
margin_top = 111.826
|
||||||
|
margin_right = 8.27014
|
||||||
|
margin_bottom = 143.855
|
||||||
|
texture = ExtResource( 2 )
|
||||||
|
stretch_mode = 3
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="NinePatchRect" type="NinePatchRect" parent="."]
|
||||||
|
material = ExtResource( 4 )
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
texture = ExtResource( 2 )
|
||||||
|
region_rect = Rect2( 0, 0, 16, 16 )
|
||||||
|
patch_margin_left = 4
|
||||||
|
patch_margin_top = 4
|
||||||
|
patch_margin_right = 4
|
||||||
|
patch_margin_bottom = 5
|
||||||
|
axis_stretch_horizontal = 1
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="Container" type="VBoxContainer" parent="."]
|
||||||
|
material = ExtResource( 4 )
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 10.0
|
||||||
|
margin_top = 10.0
|
||||||
|
margin_right = -10.0
|
||||||
|
margin_bottom = -10.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
custom_constants/separation = 20
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
4
Actors/Objects/Scanner/Scanner.gd
Normal file
4
Actors/Objects/Scanner/Scanner.gd
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
extends StaticBody2D
|
||||||
|
|
||||||
|
class_name GameObjectScanner
|
||||||
|
|
19
Actors/Objects/Scanner/Scanner.tscn
Normal file
19
Actors/Objects/Scanner/Scanner.tscn
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Graphics/tgstation/scanner.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://Actors/Objects/Scanner/Scanner.gd" type="Script" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
|
extents = Vector2( 16, 16 )
|
||||||
|
|
||||||
|
[node name="StaticBody2D" type="StaticBody2D"]
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 16, 16 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="scanner" type="Sprite" parent="."]
|
||||||
|
position = Vector2( -1, 0 )
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
centered = false
|
|
@ -10,7 +10,7 @@
|
||||||
0/region = Rect2( 0, 0, 256, 256 )
|
0/region = Rect2( 0, 0, 256, 256 )
|
||||||
0/tile_mode = 1
|
0/tile_mode = 1
|
||||||
0/autotile/bitmask_mode = 1
|
0/autotile/bitmask_mode = 1
|
||||||
0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 24, Vector2( 0, 1 ), 56, Vector2( 0, 2 ), 48, Vector2( 0, 3 ), 152, Vector2( 0, 4 ), 24, Vector2( 0, 6 ), 304, Vector2( 0, 7 ), 216, Vector2( 1, 0 ), 184, Vector2( 1, 1 ), 176, Vector2( 1, 2 ), 144, Vector2( 1, 3 ), 16, Vector2( 1, 4 ), 504, Vector2( 1, 5 ), 432, Vector2( 1, 6 ), 208, Vector2( 2, 0 ), 58, Vector2( 2, 1 ), 50, Vector2( 2, 2 ), 154, Vector2( 2, 3 ), 186, Vector2( 2, 4 ), 63, Vector2( 2, 5 ), 54, Vector2( 2, 6 ), 219, Vector2( 2, 7 ), 511, Vector2( 3, 0 ), 178, Vector2( 3, 1 ), 146, Vector2( 3, 2 ), 18, Vector2( 3, 3 ), 26, Vector2( 3, 4 ), 438, Vector2( 3, 7 ), 27, Vector2( 6, 3 ), 446, Vector2( 6, 7 ), 251 ]
|
0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 24, Vector2( 0, 1 ), 56, Vector2( 0, 2 ), 48, Vector2( 0, 3 ), 152, Vector2( 0, 4 ), 24, Vector2( 0, 6 ), 304, Vector2( 0, 7 ), 216, Vector2( 1, 0 ), 184, Vector2( 1, 1 ), 176, Vector2( 1, 2 ), 144, Vector2( 1, 3 ), 16, Vector2( 1, 4 ), 504, Vector2( 1, 5 ), 432, Vector2( 1, 6 ), 208, Vector2( 2, 0 ), 58, Vector2( 2, 1 ), 50, Vector2( 2, 2 ), 154, Vector2( 2, 3 ), 186, Vector2( 2, 4 ), 63, Vector2( 2, 5 ), 54, Vector2( 2, 6 ), 219, Vector2( 2, 7 ), 511, Vector2( 3, 0 ), 178, Vector2( 3, 1 ), 146, Vector2( 3, 2 ), 18, Vector2( 3, 3 ), 26, Vector2( 3, 4 ), 438, Vector2( 3, 7 ), 27, Vector2( 5, 0 ), 248, Vector2( 5, 4 ), 440, Vector2( 6, 0 ), 59, Vector2( 6, 2 ), 218, Vector2( 6, 3 ), 446, Vector2( 6, 4 ), 62, Vector2( 6, 6 ), 155, Vector2( 6, 7 ), 251, Vector2( 7, 0 ), 434, Vector2( 7, 4 ), 182 ]
|
||||||
0/autotile/icon_coordinate = Vector2( 2, 7 )
|
0/autotile/icon_coordinate = Vector2( 2, 7 )
|
||||||
0/autotile/tile_size = Vector2( 32, 32 )
|
0/autotile/tile_size = Vector2( 32, 32 )
|
||||||
0/autotile/spacing = 0
|
0/autotile/spacing = 0
|
||||||
|
|
BIN
Graphics/tgstation/scanner.png
Normal file
BIN
Graphics/tgstation/scanner.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
34
Graphics/tgstation/scanner.png.import
Normal file
34
Graphics/tgstation/scanner.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/scanner.png-e94cdbfaff239713a37ac3a20882f2e0.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Graphics/tgstation/scanner.png"
|
||||||
|
dest_files=[ "res://.import/scanner.png-e94cdbfaff239713a37ac3a20882f2e0.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=13 format=2]
|
[gd_scene load_steps=14 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Graphics/tgstation/walls.tres" type="TileSet" id=1]
|
[ext_resource path="res://Graphics/tgstation/walls.tres" type="TileSet" id=1]
|
||||||
[ext_resource path="res://Graphics/tgstation/1x1.tres" type="TileSet" id=2]
|
[ext_resource path="res://Graphics/tgstation/1x1.tres" type="TileSet" id=2]
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
[ext_resource path="res://Scenes/Maps/runtime.gd" type="Script" id=5]
|
[ext_resource path="res://Scenes/Maps/runtime.gd" type="Script" id=5]
|
||||||
[ext_resource path="res://Actors/Objects/Computer/Computer.tscn" type="PackedScene" id=6]
|
[ext_resource path="res://Actors/Objects/Computer/Computer.tscn" type="PackedScene" id=6]
|
||||||
[ext_resource path="res://Graphics/space.png" type="Texture" id=7]
|
[ext_resource path="res://Graphics/space.png" type="Texture" id=7]
|
||||||
|
[ext_resource path="res://Actors/Objects/Scanner/Scanner.tscn" type="PackedScene" id=8]
|
||||||
[ext_resource path="res://Graphics/tgstation/floor.tres" type="TileSet" id=9]
|
[ext_resource path="res://Graphics/tgstation/floor.tres" type="TileSet" id=9]
|
||||||
[ext_resource path="res://Actors/Objects/Engine/Engine.tscn" type="PackedScene" id=10]
|
[ext_resource path="res://Actors/Objects/Engine/Engine.tscn" type="PackedScene" id=10]
|
||||||
[ext_resource path="res://Graphics/tgstation/base.tres" type="TileSet" id=11]
|
[ext_resource path="res://Graphics/tgstation/base.tres" type="TileSet" id=11]
|
||||||
|
@ -16,6 +17,7 @@
|
||||||
light_mode = 1
|
light_mode = 1
|
||||||
|
|
||||||
[node name="map" type="Node2D"]
|
[node name="map" type="Node2D"]
|
||||||
|
position = Vector2( -1, 0 )
|
||||||
script = ExtResource( 5 )
|
script = ExtResource( 5 )
|
||||||
|
|
||||||
[node name="darkness" type="CanvasModulate" parent="."]
|
[node name="darkness" type="CanvasModulate" parent="."]
|
||||||
|
@ -45,11 +47,13 @@ script = ExtResource( 3 )
|
||||||
extended_tilemap_node = NodePath("../1x1")
|
extended_tilemap_node = NodePath("../1x1")
|
||||||
|
|
||||||
[node name="cables" type="TileMap" parent="."]
|
[node name="cables" type="TileMap" parent="."]
|
||||||
|
position = Vector2( -3, 0 )
|
||||||
tile_set = ExtResource( 4 )
|
tile_set = ExtResource( 4 )
|
||||||
cell_size = Vector2( 32, 32 )
|
cell_size = Vector2( 32, 32 )
|
||||||
cell_quadrant_size = 32
|
cell_quadrant_size = 32
|
||||||
occluder_light_mask = -2147483647
|
occluder_light_mask = -2147483647
|
||||||
format = 1
|
format = 1
|
||||||
|
tile_data = PoolIntArray( 524286, 0, 131072, 524287, 0, 65536, 458752, 0, 65536, 458753, 0, 65536, 458754, 0, 65536, 458755, 0, 196608, 524291, 0, 65539, 655355, 0, 131073, 589827, 0, 65539, 720891, 0, 65539, 655363, 0, 131075, 786427, 0, 65538, 786428, 0, 65536, 786429, 0, 262144 )
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
extended_tilemap_node = NodePath("../1x1")
|
extended_tilemap_node = NodePath("../1x1")
|
||||||
|
|
||||||
|
@ -87,17 +91,14 @@ __meta__ = {
|
||||||
[node name="Engine" parent="engines" instance=ExtResource( 10 )]
|
[node name="Engine" parent="engines" instance=ExtResource( 10 )]
|
||||||
position = Vector2( -320, 321 )
|
position = Vector2( -320, 321 )
|
||||||
direction = 0
|
direction = 0
|
||||||
strength = 1.0
|
|
||||||
|
|
||||||
[node name="Engine2" parent="engines" instance=ExtResource( 10 )]
|
[node name="Engine2" parent="engines" instance=ExtResource( 10 )]
|
||||||
position = Vector2( -320, 208 )
|
position = Vector2( -320, 208 )
|
||||||
direction = 0
|
direction = 0
|
||||||
strength = 1.0
|
|
||||||
|
|
||||||
[node name="Engine3" parent="engines" instance=ExtResource( 10 )]
|
[node name="Engine3" parent="engines" instance=ExtResource( 10 )]
|
||||||
position = Vector2( -320, 96 )
|
position = Vector2( -320, 96 )
|
||||||
direction = 0
|
direction = 0
|
||||||
strength = 1.0
|
|
||||||
|
|
||||||
[node name="objects" type="Node2D" parent="."]
|
[node name="objects" type="Node2D" parent="."]
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
|
@ -132,10 +133,10 @@ position = Vector2( 96, 224 )
|
||||||
computer_type = 6
|
computer_type = 6
|
||||||
|
|
||||||
[node name="StaticBody2D" parent="objects/Computer7" instance=ExtResource( 12 )]
|
[node name="StaticBody2D" parent="objects/Computer7" instance=ExtResource( 12 )]
|
||||||
position = Vector2( -256, 96 )
|
position = Vector2( -255, 64 )
|
||||||
|
|
||||||
[node name="StaticBody2D2" parent="objects/Computer7" instance=ExtResource( 12 )]
|
[node name="StaticBody2D2" parent="objects/Computer7" instance=ExtResource( 12 )]
|
||||||
position = Vector2( -64, 96 )
|
position = Vector2( 1, 96 )
|
||||||
|
|
||||||
[node name="lights" type="Node2D" parent="."]
|
[node name="lights" type="Node2D" parent="."]
|
||||||
modulate = Color( 0.980392, 0.980392, 0.980392, 1 )
|
modulate = Color( 0.980392, 0.980392, 0.980392, 1 )
|
||||||
|
@ -143,3 +144,6 @@ __meta__ = {
|
||||||
"_edit_group_": true,
|
"_edit_group_": true,
|
||||||
"_edit_lock_": true
|
"_edit_lock_": true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="StaticBody2D" parent="." instance=ExtResource( 8 )]
|
||||||
|
position = Vector2( -95, 352 )
|
||||||
|
|
|
@ -49,6 +49,11 @@ _global_script_classes=[ {
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
"path": "res://Actors/Objects/PowerStorage/PowerStorage.gd"
|
"path": "res://Actors/Objects/PowerStorage/PowerStorage.gd"
|
||||||
}, {
|
}, {
|
||||||
|
"base": "StaticBody2D",
|
||||||
|
"class": "GameObjectScanner",
|
||||||
|
"language": "GDScript",
|
||||||
|
"path": "res://Actors/Objects/Scanner/Scanner.gd"
|
||||||
|
}, {
|
||||||
"base": "Control",
|
"base": "Control",
|
||||||
"class": "GameUI",
|
"class": "GameUI",
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
|
@ -83,6 +88,7 @@ _global_script_class_icons={
|
||||||
"GameObjectEngine": "",
|
"GameObjectEngine": "",
|
||||||
"GameObjectLightbulb": "",
|
"GameObjectLightbulb": "",
|
||||||
"GameObjectPowerStorage": "",
|
"GameObjectPowerStorage": "",
|
||||||
|
"GameObjectScanner": "",
|
||||||
"GameUI": "",
|
"GameUI": "",
|
||||||
"GameWorld": "",
|
"GameWorld": "",
|
||||||
"MapTiles": "",
|
"MapTiles": "",
|
||||||
|
|
Reference in a new issue