* Move submodule to Godot * Update submodule AGAIN. * Update project files. * Remove WearableAnimatedSprite from prototypes. * Remove content repo resource copier. * Update submodule. * Fix resource handling. * Content.Client compiles by commenting out hands GUI. * Update submodule. * Fix prototype textures and update submodule. * Update Submodule. * Update submodule SOME MORE! * Random WiP shit I guess * Make omnisharp not choke on buildchecker. * Update submodule. * Highly WiP broken HandsGui code. * Ok maybe let's not insult omnisharp. * Fix annoying Omnisharp warning. * Update submodule. * Update submodule. * Hey I forgot to push this but it didn't conflict! * Fix hands GUI on godot. * Update submodule. * Obligatory submodule update. * Work on exports. * Work on exports. * Update submodule. * Update submodule. * Fix dumb case mismatch between content and engine * work pls. * This maybe. * Now! * Update submodule. * update submodule. * Some WiP work on exporting aaah. * OK READY FOR THE BUILDS SERVER. * Probably should've made those commits in a different order. * DO THE THING * update submodule. * Updates for effects system. * Update submodule. * Make file/line numbers show up on Windows Godot. * Set submodule to master.
72 lines
1.7 KiB
C#
72 lines
1.7 KiB
C#
using Content.Shared.GameObjects;
|
|
using Lidgren.Network;
|
|
using SS14.Client.GameObjects;
|
|
using SS14.Shared.GameObjects;
|
|
using SS14.Shared.Utility;
|
|
using YamlDotNet.RepresentationModel;
|
|
|
|
namespace Content.Client.GameObjects
|
|
{
|
|
public class ClientDoorComponent : SharedDoorComponent
|
|
{
|
|
public bool Opened { get; private set; }
|
|
private SpriteComponent spriteComponent;
|
|
|
|
private string OpenSprite = "Objects/door_ewo.png";
|
|
private string CloseSprite = "Objects/door_ew.png";
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
spriteComponent = Owner.GetComponent<SpriteComponent>();
|
|
}
|
|
|
|
private void Open()
|
|
{
|
|
Opened = true;
|
|
spriteComponent.SetSpriteByKey(OpenSprite);
|
|
}
|
|
|
|
private void Close()
|
|
{
|
|
Opened = false;
|
|
spriteComponent.SetSpriteByKey(CloseSprite);
|
|
}
|
|
|
|
public override void HandleComponentState(ComponentState state)
|
|
{
|
|
var castState = (DoorComponentState)state;
|
|
if (castState.Opened == Opened)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (castState.Opened)
|
|
{
|
|
Open();
|
|
}
|
|
else
|
|
{
|
|
Close();
|
|
}
|
|
}
|
|
|
|
public override void LoadParameters(YamlMappingNode mapping)
|
|
{
|
|
base.LoadParameters(mapping);
|
|
|
|
YamlNode node;
|
|
if (mapping.TryGetNode("openstate", out node))
|
|
{
|
|
OpenSprite = node.AsString();
|
|
}
|
|
|
|
if (mapping.TryGetNode("closestate", out node))
|
|
{
|
|
CloseSprite = node.AsString();
|
|
}
|
|
}
|
|
}
|
|
}
|