Update submodule: light cleanup.
This commit is contained in:
@@ -6,7 +6,6 @@ using Content.Shared.GameObjects;
|
|||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.Components.Container;
|
using Robust.Server.GameObjects.Components.Container;
|
||||||
using Robust.Server.Interfaces.GameObjects;
|
using Robust.Server.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Enums;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
@@ -118,7 +117,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetState(LightState.Off);
|
SetState(false);
|
||||||
Activated = false;
|
Activated = false;
|
||||||
|
|
||||||
if (Owner.TryGetComponent(out SoundComponent soundComponent))
|
if (Owner.TryGetComponent(out SoundComponent soundComponent))
|
||||||
@@ -158,7 +157,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
}
|
}
|
||||||
|
|
||||||
Activated = true;
|
Activated = true;
|
||||||
SetState(LightState.On);
|
SetState(true);
|
||||||
|
|
||||||
if (Owner.TryGetComponent(out soundComponent))
|
if (Owner.TryGetComponent(out soundComponent))
|
||||||
{
|
{
|
||||||
@@ -166,13 +165,13 @@ namespace Content.Server.GameObjects.Components.Interactable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetState(LightState newState)
|
private void SetState(bool on)
|
||||||
{
|
{
|
||||||
_spriteComponent.LayerSetVisible(1, newState == LightState.On);
|
_spriteComponent.LayerSetVisible(1, on);
|
||||||
_pointLight.State = newState;
|
_pointLight.Enabled = on;
|
||||||
if (_clothingComponent != null)
|
if (_clothingComponent != null)
|
||||||
{
|
{
|
||||||
_clothingComponent.ClothingEquippedPrefix = newState.ToString();
|
_clothingComponent.ClothingEquippedPrefix = on ? "On" : "Off";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using Content.Shared.GameObjects;
|
|||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.Components.Container;
|
using Robust.Server.GameObjects.Components.Container;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Enums;
|
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Interfaces.Timing;
|
using Robust.Shared.Interfaces.Timing;
|
||||||
@@ -68,7 +67,7 @@ namespace Content.Server.GameObjects.Components.Power
|
|||||||
|
|
||||||
bool CanBurn(int heatResistance)
|
bool CanBurn(int heatResistance)
|
||||||
{
|
{
|
||||||
return _lightState == LightState.On && heatResistance < LightBulb.BurningTemperature;
|
return _lightState && heatResistance < LightBulb.BurningTemperature;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Burn()
|
void Burn()
|
||||||
@@ -135,8 +134,8 @@ namespace Content.Server.GameObjects.Components.Power
|
|||||||
UpdateLight();
|
UpdateLight();
|
||||||
}
|
}
|
||||||
|
|
||||||
private LightState _lightState => Owner.GetComponent<PointLightComponent>().State;
|
private bool _lightState => Owner.GetComponent<PointLightComponent>().Enabled;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the light's power drain, sprite and actual light state.
|
/// Updates the light's power drain, sprite and actual light state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -149,7 +148,7 @@ namespace Content.Server.GameObjects.Components.Power
|
|||||||
{
|
{
|
||||||
device.Load = 0;
|
device.Load = 0;
|
||||||
sprite.LayerSetState(0, "empty");
|
sprite.LayerSetState(0, "empty");
|
||||||
light.State = LightState.Off;
|
light.Enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +159,7 @@ namespace Content.Server.GameObjects.Components.Power
|
|||||||
if (device.Powered)
|
if (device.Powered)
|
||||||
{
|
{
|
||||||
sprite.LayerSetState(0, "on");
|
sprite.LayerSetState(0, "on");
|
||||||
light.State = LightState.On;
|
light.Enabled = true;
|
||||||
light.Color = LightBulb.Color;
|
light.Color = LightBulb.Color;
|
||||||
var time = IoCManager.Resolve<IGameTiming>().CurTime;
|
var time = IoCManager.Resolve<IGameTiming>().CurTime;
|
||||||
if (time > _lastThunk + _thunkDelay)
|
if (time > _lastThunk + _thunkDelay)
|
||||||
@@ -172,18 +171,18 @@ namespace Content.Server.GameObjects.Components.Power
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprite.LayerSetState(0, "off");
|
sprite.LayerSetState(0, "off");
|
||||||
light.State = LightState.Off;
|
light.Enabled = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LightBulbState.Broken:
|
case LightBulbState.Broken:
|
||||||
device.Load = 0;
|
device.Load = 0;
|
||||||
sprite.LayerSetState(0, "broken");
|
sprite.LayerSetState(0, "broken");
|
||||||
light.State = LightState.Off;
|
light.Enabled = false;
|
||||||
break;
|
break;
|
||||||
case LightBulbState.Burned:
|
case LightBulbState.Burned:
|
||||||
device.Load = 0;
|
device.Load = 0;
|
||||||
sprite.LayerSetState(0, "burned");
|
sprite.LayerSetState(0, "burned");
|
||||||
light.State = LightState.Off;
|
light.Enabled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
- type: PointLight
|
- type: PointLight
|
||||||
radius: 8
|
radius: 8
|
||||||
energy: 1.2
|
energy: 1.2
|
||||||
offset: "0, -16"
|
#offset: "0, -16"
|
||||||
color: "#DCDCC6"
|
color: "#DCDCC6"
|
||||||
|
|
||||||
placement:
|
placement:
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
state: off
|
state: off
|
||||||
|
|
||||||
- type: PointLight
|
- type: PointLight
|
||||||
state: Off
|
enabled: false
|
||||||
|
|
||||||
- type: PowerDevice
|
- type: PowerDevice
|
||||||
priority: Low
|
priority: Low
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
- type: PointLight
|
- type: PointLight
|
||||||
energy: 1.0
|
energy: 1.0
|
||||||
state: Off
|
enabled: false
|
||||||
|
|
||||||
- type: PowerDevice
|
- type: PowerDevice
|
||||||
priority: Low
|
priority: Low
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
components:
|
components:
|
||||||
- type: HandheldLight
|
- type: HandheldLight
|
||||||
- type: PointLight
|
- type: PointLight
|
||||||
state: Off
|
enabled: false
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Clothing/helmet_engineering.rsi
|
sprite: Clothing/helmet_engineering.rsi
|
||||||
layers:
|
layers:
|
||||||
@@ -52,4 +52,4 @@
|
|||||||
- type: Clothing
|
- type: Clothing
|
||||||
Slots:
|
Slots:
|
||||||
- head
|
- head
|
||||||
sprite: Clothing/helmet_engineering.rsi
|
sprite: Clothing/helmet_engineering.rsi
|
||||||
|
|||||||
@@ -16,5 +16,5 @@
|
|||||||
sprite: Objects/lantern.rsi
|
sprite: Objects/lantern.rsi
|
||||||
state: lantern_off
|
state: lantern_off
|
||||||
- type: PointLight
|
- type: PointLight
|
||||||
state: Off
|
enabled: false
|
||||||
- type: Sound
|
- type: Sound
|
||||||
|
|||||||
Submodule RobustToolbox updated: be379b2e20...fdfbf92223
Reference in New Issue
Block a user