* Add the chameleon controller implant * address the issues (Git please dont kill me) * Address the review and fix some merge conflicts! * Cleanup * Add use delay * Silly mistakes * Making a PR at 2 am: Gone wrong * Predict use delay and disable the buttons until you can choose another * First phase custom clothing * Better system, now relays to agent id and mindshield. Chameleon loadouts are a lot better to work with as well * Address the review! No more evil goto * Slams way is better I should have read more closely xD * Some of the jobs * Add to Cargo, CentComm, Service, Passenger, Ninja, Cluwne, Wizard + Minor changes to existing; Add chameleon to bandanas, medals, jugsuits and HUDs * Add everything else * Fix test * Job name * This looks better * Add department organization * Minor cleanup * Added some mindshields * Remove redudent comment and change funcion name to be clearer * Fix cluwne outfit * fix merge conflicts --------- Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using Content.Shared.Clothing;
|
|
using Content.Shared.Implants;
|
|
using Content.Shared.Preferences.Loadouts;
|
|
using Content.Shared.Roles;
|
|
using Content.Shared.Timing;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client.Implants.UI;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class ChameleonControllerBoundUserInterface : BoundUserInterface
|
|
{
|
|
private readonly UseDelaySystem _delay;
|
|
|
|
[ViewVariables]
|
|
private ChameleonControllerMenu? _menu;
|
|
|
|
public ChameleonControllerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
_delay = EntMan.System<UseDelaySystem>();
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_menu = this.CreateWindow<ChameleonControllerMenu>();
|
|
_menu.OnJobSelected += OnJobSelected;
|
|
}
|
|
|
|
private void OnJobSelected(ProtoId<ChameleonOutfitPrototype> outfit)
|
|
{
|
|
if (!EntMan.TryGetComponent<UseDelayComponent>(Owner, out var useDelayComp))
|
|
return;
|
|
|
|
if (!_delay.TryResetDelay((Owner, useDelayComp), true))
|
|
return;
|
|
|
|
SendMessage(new ChameleonControllerSelectedOutfitMessage(outfit));
|
|
|
|
if (!_delay.TryGetDelayInfo((Owner, useDelayComp), out var delay) || _menu == null)
|
|
return;
|
|
|
|
_menu._lockedUntil = DateTime.Now.Add(delay.Length);
|
|
_menu.UpdateGrid(true);
|
|
}
|
|
}
|