Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Psionics Registry Computer, PsiWatch, and Epi-Glasses/Epi-HUD #1598

Merged
merged 20 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
39ca830
Add everything for psionics except equipment.
CerberusWolfie Jan 19, 2025
e901437
Add glasses (which currently don't work in-game, but they're there).
CerberusWolfie Jan 19, 2025
24f77c8
Change reason to psionics/reason and make glasses work.
CerberusWolfie Jan 19, 2025
8984d17
Fix the image for abusing.
CerberusWolfie Jan 19, 2025
84f0336
Add cartridge and apply it to Chaplain, Mystagogue, Mantis, and Catal…
CerberusWolfie Jan 20, 2025
2c7534f
Add Loadouts.
CerberusWolfie Jan 20, 2025
1b81d2a
Add cartridge to locker.
CerberusWolfie Jan 20, 2025
b78c20b
Change the accesses required to only Chapel, Library, Mantis, and Mys…
CerberusWolfie Jan 20, 2025
4bbdc6f
Map on all maps.
CerberusWolfie Jan 20, 2025
540f089
Merge branch 'master' into PsionicsRecords
CerberusWolfie Jan 20, 2025
569850d
Fix a minor typo, lmao.
CerberusWolfie Jan 20, 2025
77dc608
Merge branch 'PsionicsRecords' of https://github.com/CerberusWolfie/E…
CerberusWolfie Jan 20, 2025
3420d1e
Merge branch 'master' into PsionicsRecords
CerberusWolfie Jan 20, 2025
01c2be5
Update psionics-records.ftl
sleepyyapril Jan 20, 2025
bf5013c
Merge branch 'master' into PsionicsRecords
sleepyyapril Jan 20, 2025
cc46b0f
Merge upstream to correct merge conflicts. Switch ComputerPsionicsRec…
CerberusWolfie Jan 20, 2025
c8feaec
I forgot to include the computers, lmao....
CerberusWolfie Jan 20, 2025
401d460
Merge branch 'PsionicsRecords' of https://github.com/CerberusWolfie/E…
CerberusWolfie Jan 20, 2025
5651dc8
Merge branch 'master' into PsionicsRecords
CerberusWolfie Jan 20, 2025
3b9a04a
Merge branch 'master' into PsionicsRecords
sleepyyapril Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<BoxContainer xmlns="https://spacestation14.io"
xmlns:cartridges="clr-namespace:Content.Client.CartridgeLoader.Cartridges"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
HorizontalExpand="True"
VerticalExpand="True"
Margin="5">
<!-- All labels populated in constructor -->
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Left">
<BoxContainer Orientation="Vertical">
<Label Name="Status"/>
<Label Text="{Loc 'psionics-records-console-reason'}"/>
</BoxContainer>
<customControls:VSeparator StyleClasses="LowDivider" Margin="8 0"/>
<BoxContainer Orientation="Vertical">
<Label Name="Title"/>
<Label Name="Reason"/>
</BoxContainer>
</BoxContainer>
</BoxContainer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Content.Shared.CartridgeLoader.Cartridges;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

/// <summary>
/// ADAPTED FROM SECWATCH - DELTAV
/// </summary>

namespace Content.Client.CartridgeLoader.Cartridges;

[GenerateTypedNameReferences]
public sealed partial class PsiWatchEntryControl : BoxContainer
{
public PsiWatchEntryControl(PsiWatchEntry entry)
{
RobustXamlLoader.Load(this);

Status.Text = Loc.GetString($"psionics-records-status-{entry.Status.ToString().ToLower()}");
Title.Text = Loc.GetString("psi-watch-entry", ("name", entry.Name), ("job", entry.Job));

Reason.Text = entry.Reason ?? Loc.GetString("psi-watch-no-reason");
}
}
31 changes: 31 additions & 0 deletions Content.Client/CartridgeLoader/Cartridges/PsiWatchUi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Content.Client.UserInterface.Fragments;
using Content.Shared.CartridgeLoader;
using Content.Shared.CartridgeLoader.Cartridges;
using Robust.Client.UserInterface;

/// <summary>
/// ADAPTED FROM SECWATCH - DELTAV
/// </summary>

namespace Content.Client.CartridgeLoader.Cartridges;

public sealed partial class PsiWatchUi : UIFragment
{
private PsiWatchUiFragment? _fragment;

public override Control GetUIFragmentRoot()
{
return _fragment!;
}

public override void Setup(BoundUserInterface ui, EntityUid? owner)
{
_fragment = new PsiWatchUiFragment();
}

public override void UpdateState(BoundUserInterfaceState state)
{
if (state is PsiWatchUiState cast)
_fragment?.UpdateState(cast);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<cartridges:PsiWatchUiFragment xmlns="https://spacestation14.io"
xmlns:cartridges="clr-namespace:Content.Client.CartridgeLoader.Cartridges"
Margin="5"
VerticalExpand="True">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True">
<Label Text="{Loc 'psi-watch-title'}" HorizontalExpand="True" HorizontalAlignment="Center"/>
<Label Name="NoEntries" Text="{Loc 'psi-watch-no-entries'}" HorizontalExpand="True" HorizontalAlignment="Center" Visible="False"/>
<ScrollContainer HorizontalExpand="True" VerticalExpand="True">
<!-- Populated when state received -->
<BoxContainer Name="Entries" Orientation="Vertical" VerticalAlignment="Top"/>
</ScrollContainer>
</BoxContainer>
</cartridges:PsiWatchUiFragment>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Content.Shared.CartridgeLoader.Cartridges;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

/// <summary>
/// ADAPTED FROM SECWATCH - DELTAV
/// </summary>

namespace Content.Client.CartridgeLoader.Cartridges;

[GenerateTypedNameReferences]
public sealed partial class PsiWatchUiFragment : BoxContainer
{
public PsiWatchUiFragment()
{
RobustXamlLoader.Load(this);
}

public void UpdateState(PsiWatchUiState state)
{
NoEntries.Visible = state.Entries.Count == 0;
Entries.RemoveAllChildren();
foreach (var entry in state.Entries)
{
Entries.AddChild(new PsiWatchEntryControl(entry));
}
}
}
32 changes: 32 additions & 0 deletions Content.Client/Overlays/ShowPsionicsRecordIconsSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Content.Shared.Overlays;
using Content.Shared.Psionics.Components;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Prototypes;

/// <summary>
/// EVERYTHING HERE IS A MODIFIED VERSION OF CRIMINAL RECORDS
/// </summary>

namespace Content.Client.Overlays;

public sealed class ShowPsionicsRecordIconsSystem : EquipmentHudSystem<ShowPsionicsRecordIconsComponent>
{
[Dependency] private readonly IPrototypeManager _prototype = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<PsionicsRecordComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
}

private void OnGetStatusIconsEvent(EntityUid uid, PsionicsRecordComponent component, ref GetStatusIconsEvent ev)
{
if (!IsActive)
return;

if (_prototype.TryIndex(component.StatusIcon, out var iconPrototype))
ev.StatusIcons.Add(iconPrototype);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Content.Shared.PsionicsRecords.Systems;

/// <summary>
/// EVERYTHING HERE IS A MODIFIED VERSION OF CRIMINAL RECORDS
/// </summary>

namespace Content.Client.PsionicsRecords.Systems;

public sealed class PsionicsRecordsConsoleSystem : SharedPsionicsRecordsConsoleSystem
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using Content.Shared.Access.Systems;
using Content.Shared.PsionicsRecords;
using Content.Shared.PsionicsRecords.Components;
using Content.Shared.Psionics;
using Content.Shared.StationRecords;
using Robust.Client.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;

/// <summary>
/// EVERYTHING HERE IS A MODIFIED VERSION OF CRIMINAL RECORDS
/// </summary>

namespace Content.Client.PsionicsRecords;

public sealed class PsionicsRecordsConsoleBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
private readonly AccessReaderSystem _accessReader;

private PsionicsRecordsConsoleWindow? _window;

public PsionicsRecordsConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
_accessReader = EntMan.System<AccessReaderSystem>();
}

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

var comp = EntMan.GetComponent<PsionicsRecordsConsoleComponent>(Owner);

_window = new(Owner, comp.MaxStringLength, _playerManager, _proto, _random, _accessReader);
_window.OnKeySelected += key =>
SendMessage(new SelectStationRecord(key));
_window.OnFiltersChanged += (type, filterValue) =>
SendMessage(new SetStationRecordFilter(type, filterValue));
_window.OnStatusSelected += status =>
SendMessage(new PsionicsRecordChangeStatus(status, null));
_window.OnDialogConfirmed += (status, reason) =>
SendMessage(new PsionicsRecordChangeStatus(status, reason));
_window.OnClose += Close;
}

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

if (state is not PsionicsRecordsConsoleState cast)
return;

_window?.UpdateState(cast);
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);

_window?.Close();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'psionics-records-console-window-title'}"
MinSize="660 400">
<BoxContainer Orientation="Vertical">
<!-- Record search bar
TODO: make this into a control shared with general records -->
<BoxContainer Margin="5 5 5 10" HorizontalExpand="true" VerticalAlignment="Center">
<OptionButton Name="FilterType" MinWidth="200" Margin="0 0 10 0"/> <!-- Populated in constructor -->
<LineEdit Name="FilterText" PlaceHolder="{Loc 'psionics-records-filter-placeholder'}" HorizontalExpand="True"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal" VerticalExpand="True">
<!-- Record listing -->
<BoxContainer Orientation="Vertical" Margin="5" MinWidth="250" MaxWidth="250">
<Label Name="RecordListingTitle" Text="{Loc 'psionics-records-console-records-list-title'}" HorizontalExpand="True" Align="Center"/>
<Label Name="NoRecords" Text="{Loc 'psionics-records-console-no-records'}" HorizontalExpand="True" Align="Center" FontColorOverride="DarkGray"/>
<ScrollContainer VerticalExpand="True">
<ItemList Name="RecordListing"/> <!-- Populated when loading state -->
</ScrollContainer>
</BoxContainer>
<Label Name="RecordUnselected" Text="{Loc 'psionics-records-console-select-record-info'}" HorizontalExpand="True" Align="Center" FontColorOverride="DarkGray"/>
<!-- Selected record info -->
<BoxContainer Name="PersonContainer" Orientation="Vertical" Margin="5" Visible="False">
<Label Name="PersonName" StyleClasses="LabelBig"/>
<PanelContainer StyleClasses="LowDivider" Margin="0 5 0 5" />
<BoxContainer Orientation="Horizontal" Margin="5 5 5 5">
<Label Name="StatusLabel" Text="{Loc 'psionics-records-console-status'}" FontColorOverride="DarkGray"/>
<OptionButton Name="StatusOptionButton"/> <!-- Populated in constructor -->
</BoxContainer>
<RichTextLabel Name="PsionicsList" Visible="False"/>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</controls:FancyWindow>

Loading
Loading