Files
crystall-punk-14/Content.Client/StationRecords/GeneralStationRecordConsoleBoundUserInterface.cs

58 lines
1.4 KiB
C#
Raw Normal View History

using Content.Shared.StationRecords;
using Robust.Client.GameObjects;
namespace Content.Client.StationRecords;
public sealed class GeneralStationRecordConsoleBoundUserInterface : BoundUserInterface
{
2023-07-08 09:02:17 -07:00
[ViewVariables]
private GeneralStationRecordConsoleWindow? _window = default!;
2023-07-08 09:02:17 -07:00
public GeneralStationRecordConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = new();
_window.OnKeySelected += OnKeySelected;
Fingerprints filter for records station computer (#15017) * add new labels and buttons for records stantion console * add fingerprint fields for server * set buttons and updates for fingerPrints filters * set fingerprints filters * final set for finger prints filters * add new trhaslates for station records computer * some fix for the PR * refactor server side station record console system * add message for filters * add tranlates * add new ui with several filters * updetes prints with server side logic * resolve conflicts with DNA * resolve conflicts with DNA * deleted unused variable and rename some fields * added description for new state * added select for filter * set multiplay filters for the console * added new translates * add class filters & fixed issue with reset line edit * fix dublicate with set the selectId for option button * fixed review notes * fixed review notes forget changet fix name * add event TextEntered for better usability * fixed review notes 3 * fixed formating in xaml * fixed array with _filterTypes * fixed ui and made it in minimalistic style * fixed generalstationRecordFilter class, move method * delete margin after line edit * fix placeholder for lineEdit * fix placeholder for lineEdit, the review note * Revert "fixed generalstationRecordFilter class, move method" This reverts commit 1b35c6ac44e7dafe9a1f0560eb177152b822f20b. * impliment short swith in method IsSkippedRecord * fixed review notes, remaked method IsSkipped and fix casing * fixed the review note about check null record name
2023-04-12 17:27:13 +03:00
_window.OnFiltersChanged += OnFiltersChanged;
_window.OnClose += Close;
_window.OpenCentered();
}
private void OnKeySelected((NetEntity, uint)? key)
{
SendMessage(new SelectGeneralStationRecord(key));
}
Fingerprints filter for records station computer (#15017) * add new labels and buttons for records stantion console * add fingerprint fields for server * set buttons and updates for fingerPrints filters * set fingerprints filters * final set for finger prints filters * add new trhaslates for station records computer * some fix for the PR * refactor server side station record console system * add message for filters * add tranlates * add new ui with several filters * updetes prints with server side logic * resolve conflicts with DNA * resolve conflicts with DNA * deleted unused variable and rename some fields * added description for new state * added select for filter * set multiplay filters for the console * added new translates * add class filters & fixed issue with reset line edit * fix dublicate with set the selectId for option button * fixed review notes * fixed review notes forget changet fix name * add event TextEntered for better usability * fixed review notes 3 * fixed formating in xaml * fixed array with _filterTypes * fixed ui and made it in minimalistic style * fixed generalstationRecordFilter class, move method * delete margin after line edit * fix placeholder for lineEdit * fix placeholder for lineEdit, the review note * Revert "fixed generalstationRecordFilter class, move method" This reverts commit 1b35c6ac44e7dafe9a1f0560eb177152b822f20b. * impliment short swith in method IsSkippedRecord * fixed review notes, remaked method IsSkipped and fix casing * fixed the review note about check null record name
2023-04-12 17:27:13 +03:00
private void OnFiltersChanged(
GeneralStationRecordFilterType type, string filterValue)
{
GeneralStationRecordsFilterMsg msg = new(type, filterValue);
SendMessage(msg);
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not GeneralStationRecordConsoleState cast)
{
return;
}
_window?.UpdateState(cast);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_window?.Close();
}
}