forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: FunTust <[email protected]> Co-authored-by: Svarshik <[email protected]> Co-authored-by: Svarshik <[email protected]> Co-authored-by: stalengd <[email protected]> Co-authored-by: Theywod <[email protected]> Co-authored-by: Gnomeev <[email protected]> Co-authored-by: Kirus59 <[email protected]> Co-authored-by: EstKemran <[email protected]>
- Loading branch information
1 parent
d47d933
commit 2a86b5f
Showing
702 changed files
with
16,853 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
using Content.Client.Light.Components; | ||
using Content.Client.Light.EntitySystems; | ||
using Content.Shared.SS220.Bible; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.SS220.Bible; | ||
|
||
public sealed class ExorcismPerformerSystem : SharedExorcismPerformerSystem | ||
{ | ||
|
||
[Dependency] private readonly LightBehaviorSystem _lightBehavior = default!; | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<ExorcismPerformerComponent, AppearanceChangeEvent>(OnAppearanceChanged); | ||
} | ||
|
||
private void OnAppearanceChanged(Entity<ExorcismPerformerComponent> entity, ref AppearanceChangeEvent args) | ||
{ | ||
if (!args.AppearanceData.TryGetValue(ExorcismPerformerVisualState.State, out var value) || value is not ExorcismPerformerVisualState state) | ||
{ | ||
return; | ||
} | ||
//ToDo its broken ... Stalen? | ||
/* | ||
if (TryComp(entity, out LightBehaviourComponent? lightBehaviour)) | ||
{ | ||
// Reset any running behaviour to reset the animated properties back to the original value, to avoid conflicts between resets | ||
_lightBehavior.StopLightBehaviour((entity, lightBehaviour)); | ||
if (state == ExorcismPerformerVisualState.Performing) | ||
{ | ||
_lightBehavior.StartLightBehaviour(entity.Comp.LightBehaviourId); | ||
} | ||
} | ||
*/ | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
Content.Client/SS220/Bible/UI/ExorcismBoundUserInterface.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
using Content.Shared.SS220.Bible; | ||
|
||
namespace Content.Client.SS220.Bible.UI; | ||
|
||
public sealed class ExorcismBoundUserInterface : BoundUserInterface | ||
{ | ||
[ViewVariables] | ||
private ExorcismMenu? _menu; | ||
|
||
[ViewVariables] | ||
public int LengthMin { get; private set; } | ||
[ViewVariables] | ||
public int LengthMax { get; private set; } | ||
|
||
|
||
public ExorcismBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
} | ||
|
||
protected override void Open() | ||
{ | ||
_menu = new ExorcismMenu(this); | ||
_menu.OnClose += Close; | ||
_menu.OpenCentered(); | ||
} | ||
|
||
public void ReadButtonPressed(string message) | ||
{ | ||
SendMessage(new ExorcismReadMessage(message)); | ||
_menu?.Close(); | ||
} | ||
|
||
protected override void UpdateState(BoundUserInterfaceState state) | ||
{ | ||
if (state is not ExorcismInterfaceState exorcismState) | ||
return; | ||
|
||
LengthMin = exorcismState.LengthMin; | ||
LengthMax = exorcismState.LengthMax; | ||
_menu?.RefreshLengthCounter(); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) return; | ||
|
||
_menu?.Dispose(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt --> | ||
<controls:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
Title="{Loc 'bible-exorcism-menu-title'}" | ||
MinSize="400 225"> | ||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="5"> | ||
<TextEdit Name="MessageInput" HorizontalExpand="True" VerticalExpand="True" Margin="0 0 0 5" MinHeight="100" /> | ||
<Label Name="LengthLabel"></Label> | ||
<Button Name="ReadButton" Text="{Loc 'bible-exorcism-menu-read-button'}" StyleClasses="OpenLeft" Access="Public" /> | ||
</BoxContainer> | ||
</controls:FancyWindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
using Content.Client.UserInterface.Controls; | ||
using Content.Shared.SS220.Bible; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.SS220.Bible.UI; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class ExorcismMenu : FancyWindow | ||
{ | ||
private ExorcismBoundUserInterface Owner { get; set; } | ||
|
||
public ExorcismMenu(ExorcismBoundUserInterface owner) | ||
{ | ||
IoCManager.InjectDependencies(this); | ||
RobustXamlLoader.Load(this); | ||
|
||
Owner = owner; | ||
|
||
var loc = IoCManager.Resolve<ILocalizationManager>(); | ||
MessageInput.Placeholder = new Rope.Leaf(loc.GetString("bible-exorcism-menu-message-placeholder")); | ||
|
||
MessageInput.OnTextChanged += (args) => | ||
{ | ||
var len = GetLength(); | ||
if (len < Owner.LengthMin) | ||
{ | ||
ReadButton.Disabled = true; | ||
ReadButton.ToolTip = Loc.GetString("bible-exorcism-message-too-short"); | ||
} | ||
else if (len > Owner.LengthMax) | ||
{ | ||
ReadButton.Disabled = true; | ||
ReadButton.ToolTip = Loc.GetString("bible-exorcism-message-too-long"); | ||
} | ||
else | ||
{ | ||
ReadButton.Disabled = false; | ||
ReadButton.ToolTip = null; | ||
} | ||
RefreshLengthCounter(len); | ||
}; | ||
|
||
RefreshLengthCounter(); | ||
|
||
ReadButton.OnPressed += _ => Owner.ReadButtonPressed(Rope.Collapse(MessageInput.TextRope)); | ||
ReadButton.Disabled = true; | ||
} | ||
|
||
public override void Close() | ||
{ | ||
base.Close(); | ||
} | ||
|
||
public void RefreshLengthCounter() | ||
{ | ||
RefreshLengthCounter(GetLength()); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
} | ||
|
||
private void RefreshLengthCounter(int length) | ||
{ | ||
LengthLabel.Text = $"{length}/{Owner.LengthMin}"; | ||
} | ||
|
||
private int GetLength() | ||
{ | ||
return ExorcismUtils.GetSanitazedMessageLength(Rope.Collapse(MessageInput.TextRope)); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Content.Client/SS220/CultYogg/Altar/CultYoggAltarSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Content.Shared.SS220.CultYogg; | ||
using Content.Shared.SS220.CultYogg.Altar; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.SS220.CultYogg.Altar; | ||
|
||
public sealed partial class CultYoggAltarSystem : SharedCultYoggAltarSystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
Content.Client/SS220/CultYogg/CultYoggIcon/ShowCultYoggIconSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
using Content.Shared.StatusIcon; | ||
using Content.Shared.StatusIcon.Components; | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared.SS220.CultYogg.CultYoggIcons; | ||
using Content.Shared.SS220.CultYogg.Sacraficials; | ||
using Robust.Client.Player; | ||
|
||
namespace Content.Client.SS220.CultYogg.CultYoggIcon; | ||
|
||
public sealed class ShowCultYoggIconsSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
|
||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ShowCultYoggIconsComponent, GetStatusIconsEvent>(OnGetCultistsIconsEvent); | ||
SubscribeLocalEvent<CultYoggSacrificialComponent, GetStatusIconsEvent>(OnGetSacraficialIconsEvent); | ||
} | ||
|
||
private void OnGetCultistsIconsEvent(Entity<ShowCultYoggIconsComponent> uid, ref GetStatusIconsEvent ev) | ||
{ | ||
|
||
if (!TryComp<ShowCultYoggIconsComponent>(uid, out var cultComp)) | ||
return; | ||
|
||
var iconId = cultComp.StatusIcon; | ||
|
||
if (_prototype.TryIndex<FactionIconPrototype>(iconId, out var iconPrototype)) | ||
ev.StatusIcons.Add(iconPrototype); | ||
else | ||
Log.Error($"Invalid faction icon prototype: {iconPrototype}"); | ||
} | ||
private void OnGetSacraficialIconsEvent(Entity<CultYoggSacrificialComponent> uid, ref GetStatusIconsEvent ev) | ||
{ | ||
var viewer = _playerManager.LocalSession?.AttachedEntity; | ||
if (viewer == uid) | ||
return; | ||
|
||
if (!TryComp<CultYoggSacrificialComponent>(uid, out var sacrComp)) | ||
return; | ||
|
||
var iconId = sacrComp.StatusIcon; | ||
|
||
if (_prototype.TryIndex<FactionIconPrototype>(iconId, out var iconPrototype)) | ||
ev.StatusIcons.Add(iconPrototype); | ||
else | ||
Log.Error($"Invalid faction icon prototype: {iconPrototype}"); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
Content.Client/SS220/CultYogg/Cultists/AcsendingVisualizerSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
using Content.Shared.SS220.CultYogg.Cultists; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.SS220.CultYogg.Cultists; | ||
|
||
/// <summary> | ||
/// </summary> | ||
public sealed class AcsendingVisualizerSystem : VisualizerSystem<AcsendingComponent> | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<AcsendingComponent, ComponentInit>(OnComponentInit); | ||
SubscribeLocalEvent<AcsendingComponent, ComponentShutdown>(OnShutdown); | ||
} | ||
|
||
private void OnShutdown(Entity<AcsendingComponent> uid, ref ComponentShutdown args) | ||
{ | ||
// Need LayerMapTryGet because Init fails if there's no existing sprite / appearancecomp | ||
// which means in some setups (most frequently no AppearanceComp) the layer never exists. | ||
if (TryComp<SpriteComponent>(uid, out var sprite) && | ||
sprite.LayerMapTryGet(AcsendingVisualLayers.Particles, out var layer)) | ||
{ | ||
sprite.RemoveLayer(layer); | ||
} | ||
} | ||
|
||
private void OnComponentInit(Entity<AcsendingComponent> uid, ref ComponentInit args) | ||
{ | ||
if (!TryComp<SpriteComponent>(uid, out var sprite) || !TryComp(uid, out AppearanceComponent? appearance)) | ||
return; | ||
|
||
sprite.LayerMapReserveBlank(AcsendingVisualLayers.Particles); | ||
sprite.LayerSetVisible(AcsendingVisualLayers.Particles, true); | ||
sprite.LayerSetShader(AcsendingVisualLayers.Particles, "unshaded"); | ||
|
||
if (uid.Comp.Sprite != null) | ||
{ | ||
sprite.LayerSetRSI(AcsendingVisualLayers.Particles, uid.Comp.Sprite.RsiPath); | ||
sprite.LayerSetState(AcsendingVisualLayers.Particles, uid.Comp.Sprite.RsiState); | ||
} | ||
} | ||
} | ||
|
||
public enum AcsendingVisualLayers : byte | ||
{ | ||
Particles | ||
} |
Oops, something went wrong.