Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ public override void Init()
_prototypeManager.RegisterIgnore("ghostRoleRaffleDecider");
_prototypeManager.RegisterIgnore("codewordGenerator");
_prototypeManager.RegisterIgnore("codewordFaction");
_prototypeManager.RegisterIgnore("narsiAbilityPrototype"); //RPSX
_prototypeManager.RegisterIgnore("narsiRitualCategory"); //RPSX
_prototypeManager.RegisterIgnore("narsiRitual"); //RPSX

_componentFactory.GenerateNetIds();
_adminManager.Initialize();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Content.Shared.RPSX.DarkForces.Desecrated.Pontific;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;

namespace Content.Client.RPSX.DarkForces.Desecrated;
public sealed class PontificDamageStateVisualizerSystem : VisualizerSystem<PontificVisualsComponent>
{
protected override void OnAppearanceChange(
EntityUid uid, PontificVisualsComponent component, ref AppearanceChangeEvent args
)
{
var sprite = args.Sprite;
if (sprite == null || !AppearanceSystem.TryGetData<PontificState>(uid, PontificStateVisuals.State, out var pontificState, args.Component))
return;

sprite.LayerSetVisible(PontificVisualLayers.Base, pontificState == PontificState.Base);
sprite.LayerSetVisible(PontificVisualLayers.Dead, pontificState == PontificState.Dead);
sprite.LayerSetVisible(PontificVisualLayers.Flame, pontificState == PontificState.Flame);
// sprite.LayerSetVisible(PontificVisualLayers.Prayer, pontificState == PontificState.Prayer);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Robust.Shared.GameObjects;

namespace Content.Client.RPSX.DarkForces.Desecrated;

[RegisterComponent]
public sealed partial class PontificVisualsComponent : Component
{

}

public enum PontificVisualLayers : byte
{
Base,
Dead,
Flame,
Prayer
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System;
using Content.Shared.RPSX.DarkForces.Narsi.Buildings.Altar.Abilities;
using Robust.Shared.GameObjects;

namespace Content.Client.RPSX.DarkForces.Narsi.Buildings.Altar.Abilities;

public sealed class NarsiAbilitiesBoundInterface : BoundUserInterface
{
private NarsiAbilitiesWindow? _window;

public NarsiAbilitiesBoundInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

_window?.Dispose();
_window = new NarsiAbilitiesWindow(this);
_window.OnClose += Close;
_window.OpenCentered();
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
{
_window?.Dispose();
}
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

if (state is not NarsiAbilitiesState abilitiesState || _window == null)
return;

_window.UpdateState(abilitiesState);
}

public void OnAbilityOpen(string id)
{
SendMessage(new NarsiAbilityOpenMessage(id));
}

public void OnAbilityLearn(string id)
{
SendMessage(new NarsiAbilityLearnMessage(id));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<ui:FancyWindow xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Content.Client.RPSX.DarkForces.Narsi.Buildings.Altar.Abilities.NarsiAbilitiesWindow"
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls;assembly=Content.Client"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
Title="Способности"
MinSize="400 600">

<BoxContainer Orientation="Vertical" Margin="8 8 8 8">

<PanelContainer StyleClasses="Inset">

<BoxContainer Orientation="Vertical">
<Label Text="Способности" StyleClasses="LabelKeyText" Align="Center" />
<RichTextLabel Margin="8 8 8 8" Name="Description" />
</BoxContainer>

</PanelContainer>

<SplitContainer Name="SplitContainer" Orientation="Horizontal" VerticalExpand="True" Margin="0 0 0 8">

<PanelContainer>
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>

<BoxContainer VerticalExpand="True" Orientation="Vertical" MinWidth="416">

<Label Text="Доступные для изучения"
Align="Center"
Margin="8 8 8 8"
StyleClasses="LabelKeyText" />

<ScrollContainer HScrollEnabled="False" HorizontalExpand="True" VerticalExpand="True">

<BoxContainer Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True"
Name="ClosedAbilities"
RectClipContent="True" />
</ScrollContainer>
</BoxContainer>

</PanelContainer>

<PanelContainer>
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>

<BoxContainer VerticalExpand="True" Orientation="Vertical" MinWidth="416">

<Label Text="Изученные" Align="Center" Margin="8 8 8 8" StyleClasses="LabelKeyText" />

<ScrollContainer HScrollEnabled="False" HorizontalExpand="True" VerticalExpand="True">
<BoxContainer Orientation="Vertical"
HorizontalExpand="True"
VerticalExpand="True"
Name="OpenedAbilities"
RectClipContent="True" />
</ScrollContainer>

</BoxContainer>
</PanelContainer>
</SplitContainer>
</BoxContainer>
</ui:FancyWindow>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using System.Collections.Generic;
using Content.Client.UserInterface.Controls;
using Content.Shared.RPSX.DarkForces.Narsi.Buildings.Altar.Abilities;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;

namespace Content.Client.RPSX.DarkForces.Narsi.Buildings.Altar.Abilities;

[GenerateTypedNameReferences]
public sealed partial class NarsiAbilitiesWindow : FancyWindow
{
private readonly NarsiAbilitiesBoundInterface _bui;

public NarsiAbilitiesWindow(NarsiAbilitiesBoundInterface bui)
{
RobustXamlLoader.Load(this);
_bui = bui;

Description.SetMessage(FormattedMessage.EscapeText("Способности культистов - ключ к призыву Нар'Си.\nСпособности могут быть полезны в различных ситуациях, таких как: защита, нападение, проникновение.\nКаждая способность имеет три уровня, описание которых вы можете увидеть здесь.\nЧтобы прокачивать способности, нужно получить Очки Крови, которые выдаются за задания культа"));
SetupSplitContainer();
}

private void SetupSplitContainer()
{
SplitContainer.ResizeMode = SplitContainer.SplitResizeMode.RespectChildrenMinSize;
SplitContainer.SplitWidth = 2;
SplitContainer.SplitEdgeSeparation = 1f;
SplitContainer.StretchDirection = SplitContainer.SplitStretchDirection.TopLeft;
}

public void UpdateState(NarsiAbilitiesState state)
{
ClosedAbilities.RemoveAllChildren();
OpenedAbilities.RemoveAllChildren();

AddToControl(OpenedAbilities, state.OpenedAbilities, state.BloodScore, false, state.IsLeader);
AddToControl(ClosedAbilities, state.ClosedAbilities, state.BloodScore, true, state.IsLeader);
}

private void AddToControl(BoxContainer container, List<NarsiAbilityUIModel> items, int bloodScore, bool isClosed, bool isLeader)
{
foreach (var item in items)
{
var control = new NarsiAbilityControl(
id: item.Id,
name: item.Name,
description: item.Description,
levelDescription: item.LevelDescription,
level: item.Level,
requiredBloodScore: item.RequiredBloodScore,
icon: item.Icon,
buttonState: GetButtonState(isClosed, isLeader, bloodScore, item.RequiredBloodScore),
bui: _bui
);
container.AddChild(control);
}
}

private NarsiAbilityControl.ButtonState GetButtonState(bool isClosed, bool isLeader, int bloodScore, int requiredBloodScore)
{
if (!isClosed)
return NarsiAbilityControl.ButtonState.Learn;

if (bloodScore < requiredBloodScore)
return NarsiAbilityControl.ButtonState.ClosedNotEnoughPoints;

if (isLeader)
return NarsiAbilityControl.ButtonState.ClosedLeader;

return NarsiAbilityControl.ButtonState.ClosedNotLeader;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<Control xmlns="https://spacestation14.io"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls;assembly=Content.Client"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Content.Client.RPSX.DarkForces.Narsi.Buildings.Altar.Abilities.NarsiAbilityControl"
MaxWidth="400"
MinWidth="400">
<BoxContainer Orientation="Horizontal" Margin="8 8 8 8">
<PanelContainer Name="Background"
Access="Public"
StyleClasses="PdaBackground"
MinWidth="2"
MaxWidth="4"
VerticalExpand="True"
HorizontalExpand="False"
Margin="0 0 0 0" />

<PanelContainer Name="BasePanel" HorizontalExpand="True" StyleClasses="PanelBackgroundLight">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">

<TextureRect Margin="8 8 8 8"
Name="Icon"
TextureScale="2 2"
VerticalAlignment="Center"
HorizontalAlignment="Center" />

<BoxContainer Orientation="Vertical"
HorizontalExpand="True"
VerticalAlignment="Center">

<Label Name="Name"
HorizontalAlignment="Left"
Margin="8 8 8 8" />

<customControls:HSeparator StyleClasses="LowDivider" Margin="8 0 8 0" />

<BoxContainer Orientation="Horizontal" Margin="8 0 8 0">

<Label Name="LevelLabel"
Text="Уровень, "
StyleClasses="LabelKeyText" />

<Label Name="Level" StyleClasses="LabelSubText" />
</BoxContainer>

<BoxContainer Orientation="Horizontal" Margin="8 0 8 4">

<Label Name="RequiredBloodScoreLabel"
Text="Требует очков Крови, "
StyleClasses="LabelKeyText" />

<Label Name="RequiredBloodScore" StyleClasses="LabelSubText" />
</BoxContainer>
</BoxContainer>
</BoxContainer>

<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="8 0 8 4">

<Label Name="DescriptionLabel" Text="Описание" StyleClasses="LabelKeyText" />
<RichTextLabel Name="Description" Margin="4 4 0 0" StyleClasses="LabelSubText" />

<Label Name="LevelDescriptionLabel" Text="Уровень" Margin="0 8 0 0" StyleClasses="LabelKeyText" />
<RichTextLabel Name="LevelDescription" Margin="4 4 0 0" StyleClasses="LabelSubText"
HorizontalAlignment="Stretch" VerticalAlignment="Center" />
</BoxContainer>

<Button Name="LearnButton" Margin="8 8 8 8" />
</BoxContainer>
</PanelContainer>
</BoxContainer>
</Control>
Loading