Skip to content

Commit

Permalink
Fixfixfix (#154)
Browse files Browse the repository at this point in the history
* Reapply "Доработка панели взаимодействия (#145)"

This reverts commit 2bc550c.

* убрал лишний геймтикинг
  • Loading branch information
kanopus952 authored Feb 4, 2025
1 parent a3a4e47 commit e11fe30
Show file tree
Hide file tree
Showing 4 changed files with 405 additions and 305 deletions.
19 changes: 9 additions & 10 deletions Content.Client/_Sunrise/ERP/InteractionEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
using Robust.Client.Player;
using Robust.Shared.Timing;
using Content.Shared.IdentityManagement;

namespace Content.Client._Sunrise.ERP
{
[UsedImplicitly]
public sealed class InteractionEui : BaseEui
{
private readonly InteractionWindow _window;
private InteractionWindow _window;
public IEntityManager _entManager;

[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IChatManager _chat = default!;
[Dependency] private readonly IPlayerManager _player = default!;
Expand All @@ -27,7 +27,10 @@ public InteractionEui()
{
_entManager = IoCManager.Resolve<IEntityManager>();
_window = new InteractionWindow(this);
_window.OnClose += OnClosed;
_window.OnClose += () =>
{
SendMessage(new CloseEuiMessage());
};
}

public override void HandleMessage(EuiMessageBase msg)
Expand Down Expand Up @@ -67,13 +70,9 @@ public void RequestState()
SendMessage(new RequestInteractionState());
}

private void OnClosed()
{
SendMessage(new CloseEuiMessage());
}

public override void Opened()
{
base.Opened();
_window.OpenCenteredLeft();
}

Expand Down Expand Up @@ -102,10 +101,10 @@ public override void HandleState(EuiStateBase state)

public void FrameUpdate(FrameEventArgs args)
{
foreach((var item, var time, var text) in _disabledItems)
foreach ((var item, var time, var text) in _disabledItems)
{
item.Text = text + $" ({(time - _gameTiming.CurTime).Seconds} сек.)";
if(_gameTiming.CurTime >= time)
if (_gameTiming.CurTime >= time)
{
item.Text = text;
item.Disabled = false;
Expand Down
Loading

0 comments on commit e11fe30

Please sign in to comment.