Add crew monitor computer type

This commit is contained in:
Hamcha 2020-07-16 14:37:56 +02:00
parent bcbac84049
commit 92edab98c6
Signed by: hamcha
GPG key ID: 41467804B19A3315
2 changed files with 8 additions and 1 deletions

View file

@ -5,7 +5,7 @@ extends StaticBody2D
class_name GameObjectComputer class_name GameObjectComputer
enum Direction { LEFT, RIGHT, UP, DOWN } enum Direction { LEFT, RIGHT, UP, DOWN }
enum ComputerType { ShipCommand, Comms, Medical, Research, Energy, ShipEngine, Atmos } enum ComputerType { ShipCommand, Comms, Medical, Research, Energy, ShipEngine, Atmos, Monitoring }
export(Direction) var direction = Direction.DOWN setget set_direction export(Direction) var direction = Direction.DOWN setget set_direction
export(ComputerType) var computer_type = ComputerType.ShipCommand setget set_type export(ComputerType) var computer_type = ComputerType.ShipCommand setget set_type
@ -37,6 +37,8 @@ func set_type(val):
screen_region_offset = Vector2(128, 192) screen_region_offset = Vector2(128, 192)
ComputerType.ShipEngine: ComputerType.ShipEngine:
screen_region_offset = Vector2(0, 256) screen_region_offset = Vector2(0, 256)
ComputerType.Monitoring:
screen_region_offset = Vector2(128, 32)
refresh_sprite() refresh_sprite()
@ -100,6 +102,7 @@ func _force_close_ui():
$Control/ControlComp.force_close() $Control/ControlComp.force_close()
func _power_status_changed(powered: bool) -> void: func _power_status_changed(powered: bool) -> void:
print(name, " is ", powered)
activationRange.visible = powered activationRange.visible = powered
if powered: if powered:
$ScreenAnimation.play("on") $ScreenAnimation.play("on")

View file

@ -139,6 +139,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"]
modulate = Color( 0, 0, 0, 1 )
material = SubResource( 2 ) material = SubResource( 2 )
texture = ExtResource( 1 ) texture = ExtResource( 1 )
centered = false centered = false
@ -147,6 +148,7 @@ region_rect = Rect2( 0, 0, 32, 32 )
[node name="Light2D" type="Light2D" parent="computer/screen"] [node name="Light2D" type="Light2D" parent="computer/screen"]
position = Vector2( 16, 16 ) position = Vector2( 16, 16 )
enabled = false
texture = ExtResource( 5 ) texture = ExtResource( 5 )
texture_scale = 0.5 texture_scale = 0.5
energy = 0.5 energy = 0.5
@ -161,6 +163,8 @@ anims/fadein = SubResource( 5 )
anims/fadeout = SubResource( 6 ) anims/fadeout = SubResource( 6 )
[node name="Control" type="Node2D" parent="."] [node name="Control" type="Node2D" parent="."]
modulate = Color( 1, 1, 1, 0 )
position = Vector2( 0, 10 )
z_index = 999 z_index = 999
[node name="ControlComp" parent="Control" instance=ExtResource( 4 )] [node name="ControlComp" parent="Control" instance=ExtResource( 4 )]