mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-27 18:47:52 +03:00
# Description Port of https://github.com/WWhiteDreamProject/wwdpublic/pull/2 And now also https://github.com/WWhiteDreamProject/wwdpublic/pull/8 Because Lying Down System is dependent on the Telescope System. # TODO - [x] Reconcile the code with core code, do code cleanup. I'll undraft this when I'm done. Probably not going to be tonight, because I will have to get some sleep soon to get up early for my calculus classes. # Changelog 🆑 Spatison (White Dream) - add: Added lying down system / Добавлена система лежания - tweak: Lying down now uses do-afters that are visible to other people to indicate what is going on. - add: Added telescope system / Добавлена система прицеливания - tweak: Now you can aim from Hristov / Теперь можно прицеливаться из Христова --------- Signed-off-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com> Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> # Conflicts: # Content.Client/Input/ContentContexts.cs # Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs # Content.Shared/Input/ContentKeyFunctions.cs # Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml # Resources/keybinds.yml
29 lines
775 B
C#
29 lines
775 B
C#
using Content.Shared.Standing;
|
|
using Content.Shared.CCVar;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Server.Standing;
|
|
|
|
public sealed class LayingDownSystem : SharedLayingDownSystem
|
|
{
|
|
[Dependency] private readonly INetConfigurationManager _cfg = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeNetworkEvent<CheckAutoGetUpEvent>(OnCheckAutoGetUp);
|
|
}
|
|
|
|
private void OnCheckAutoGetUp(CheckAutoGetUpEvent ev, EntitySessionEventArgs args)
|
|
{
|
|
var uid = GetEntity(ev.User);
|
|
|
|
if (!TryComp(uid, out LayingDownComponent? layingDown))
|
|
return;
|
|
|
|
layingDown.AutoGetUp = _cfg.GetClientCVar(args.SenderSession.Channel, CCVars.AutoGetUp);
|
|
Dirty(uid, layingDown);
|
|
}
|
|
}
|