diff --git a/Actors/Objects/Computer/Computer.gd b/Actors/Objects/Computer/Computer.gd index d60d9fe..18b24b9 100644 --- a/Actors/Objects/Computer/Computer.gd +++ b/Actors/Objects/Computer/Computer.gd @@ -13,6 +13,10 @@ var open = false onready var activationRange = $ActivationRange as ActivationRange +func _ready(): + if not Engine.editor_hint: + activationRange.visible = true + func set_type(val): computer_type = val match computer_type: diff --git a/Actors/Objects/Computer/Computer.tscn b/Actors/Objects/Computer/Computer.tscn index 58227e0..4a1404a 100644 --- a/Actors/Objects/Computer/Computer.tscn +++ b/Actors/Objects/Computer/Computer.tscn @@ -146,6 +146,7 @@ margin_bottom = 59.6092 rect_scale = Vector2( 0.5, 0.5 ) [node name="ActivationRange" type="Area2D" parent="."] +visible = false script = ExtResource( 6 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="ActivationRange"] diff --git a/Actors/Objects/Door/Door.gd b/Actors/Objects/Door/Door.gd index cdda257..feb9c64 100644 --- a/Actors/Objects/Door/Door.gd +++ b/Actors/Objects/Door/Door.gd @@ -5,7 +5,8 @@ onready var activationRange = $ActivationRange as ActivationRange signal changed(open) func _ready(): - activationRange.visible = true + if not Engine.editor_hint: + activationRange.visible = true func set_open(open: bool): if open: diff --git a/Actors/Objects/Lightbulb/Lightbulb.gd b/Actors/Objects/Lightbulb/Lightbulb.gd index 0702c99..3244c82 100644 --- a/Actors/Objects/Lightbulb/Lightbulb.gd +++ b/Actors/Objects/Lightbulb/Lightbulb.gd @@ -10,7 +10,8 @@ export var lit = true setget set_lit onready var activationRange = $ActivationRange as ActivationRange func _ready(): - $Light2D.set_meta("_edit_lock_", true) + if not Engine.editor_hint: + activationRange.visible = true func set_direction(dir): direction = dir diff --git a/Actors/Objects/Lightbulb/Lightbulb.tscn b/Actors/Objects/Lightbulb/Lightbulb.tscn index da111d1..a46b2a1 100644 --- a/Actors/Objects/Lightbulb/Lightbulb.tscn +++ b/Actors/Objects/Lightbulb/Lightbulb.tscn @@ -38,6 +38,7 @@ __meta__ = { shape = SubResource( 1 ) [node name="ActivationRange" type="Area2D" parent="."] +visible = false script = ExtResource( 4 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="ActivationRange"] diff --git a/Scenes/Map.gd b/Scenes/Map.gd old mode 100755 new mode 100644 index 03fef67..926393c --- a/Scenes/Map.gd +++ b/Scenes/Map.gd @@ -1,3 +1,4 @@ +tool extends Node2D class_name Map @@ -15,7 +16,23 @@ const EPSILON = 0.01 export(NodePath) var tilemap_path onready var tilemap = get_node(tilemap_path) as MapTiles +export var unlit = false setget set_unlit +onready var darkness = $darkness + +func _ready(): + set_unlit(false) + if not Engine.editor_hint: + $editorDarkness.queue_free() + +func set_unlit(val): + unlit = val + if darkness: + darkness.visible = not val + func _process(delta): + if Engine.editor_hint: + return + if abs(ship_direction - current_ship_direction) < EPSILON: current_ship_direction = ship_direction else: diff --git a/Scenes/Maps/odyssey.tscn b/Scenes/Maps/odyssey.tscn index ad49ded..f6f2243 100644 --- a/Scenes/Maps/odyssey.tscn +++ b/Scenes/Maps/odyssey.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://Graphics/tgstation/2x2.tres" type="TileSet" id=1] [ext_resource path="res://Graphics/tgstation/1x1.tres" type="TileSet" id=2] @@ -8,6 +8,7 @@ [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://Actors/Objects/Lightbulb/Lightbulb.tscn" type="PackedScene" id=8] +[ext_resource path="res://Graphics/white.png" type="Texture" id=9] [sub_resource type="CanvasItemMaterial" id=1] light_mode = 1 @@ -15,13 +16,20 @@ light_mode = 1 [node name="map" type="Node2D"] script = ExtResource( 5 ) tilemap_path = NodePath("2x2") +unlit = true -[node name="CanvasModulate" type="CanvasModulate" parent="."] +[node name="editorDarkness" type="CanvasModulate" parent="."] +visible = false color = Color( 0, 0, 0, 1 ) -__meta__ = { -"_edit_group_": true, -"_edit_lock_": true -} + +[node name="darkness" type="Node2D" parent="."] +visible = false + +[node name="Light2D" type="Light2D" parent="darkness"] +position = Vector2( 208, 256 ) +scale = Vector2( 27, 10 ) +texture = ExtResource( 9 ) +mode = 1 [node name="deepspace" type="Sprite" parent="."] material = SubResource( 1 ) @@ -68,7 +76,6 @@ position = Vector2( 192, 384 ) [node name="ControlComp" parent="objects" instance=ExtResource( 6 )] position = Vector2( 576, 256 ) direction = 0 -computer_type = 0 [node name="CommsComp" parent="objects" instance=ExtResource( 6 )] position = Vector2( 576, 224 )