Skip to content

Commit

Permalink
всего лишь восемь минут летит бекдур в репу
Browse files Browse the repository at this point in the history
  • Loading branch information
RedFoxIV committed Dec 25, 2024
1 parent 76aadc1 commit c394940
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions Content.Client/_White/Misc/ChristmasLights/ChristmasLightsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,8 @@ private void OnChristmasLightsVerbs(EntityUid uid, ChristmasLightsComponent comp
ClientExclusive = true,
CloseMenu = false,
Act = () => {
if (!CanInteract(uid, args.User))
return;
// can't move this into shared without a great deal of effort because of reliance on nodes.
// Nodes only exist in Content.Server, which is, frankly, fucking retarded.
_audio.PlayLocal(comp.ButtonSound, uid, args.User);
if (HasComp<EmaggedComponent>(args.Target))
{
_popup.PopupClient(_loc.GetString("christmas-lights-unresponsive"), uid, args.User);
return;
}
RaiseNetworkEvent(new ChangeChristmasLightsModeAttemptEvent(GetNetEntity(args.Target)));
if(TryInteract(uid, args.User, comp))
RaiseNetworkEvent(new ChangeChristmasLightsModeAttemptEvent(GetNetEntity(args.Target)));
}
});
args.Verbs.Add(
Expand All @@ -115,19 +106,26 @@ private void OnChristmasLightsVerbs(EntityUid uid, ChristmasLightsComponent comp
ClientExclusive = true,
CloseMenu = false,
Act = () =>{
if(!CanInteract(uid, args.User))
return;
_audio.PlayLocal(comp.ButtonSound, uid, args.User);
if(HasComp<EmaggedComponent>(args.Target))
{
_popup.PopupClient(_loc.GetString("christmas-lights-unresponsive"), uid, args.User);
return;
}
RaiseNetworkEvent(new ChangeChristmasLightsBrightnessAttemptEvent(GetNetEntity(args.Target)));
if(TryInteract(uid, args.User, comp))
RaiseNetworkEvent(new ChangeChristmasLightsBrightnessAttemptEvent(GetNetEntity(args.Target)));
}
});
}

private bool TryInteract(EntityUid uid, EntityUid user, ChristmasLightsComponent comp)
{
if (!CanInteract(uid, user))
return false;
// can't move this into shared without a great deal of effort because of reliance on nodes.
// Nodes only exist in Content.Server, which is, frankly, fucking retarded.
_audio.PlayLocal(comp.ButtonSound, uid, user);
if (HasComp<EmaggedComponent>(uid))
{
_popup.PopupClient(_loc.GetString("christmas-lights-unresponsive"), uid, user);
return false;
}
return true;
}



Expand Down

0 comments on commit c394940

Please sign in to comment.