Disable warnings that would be refactored anyway (#5047)

This commit is contained in:
Visne
2021-10-27 18:10:40 +02:00
committed by GitHub
parent bd4ab219e3
commit c67160ae19
93 changed files with 302 additions and 5 deletions

View File

@@ -113,7 +113,9 @@ namespace Content.Client.Actions
{
case BehaviorType.Instant:
// for instant actions, we immediately tell the server we're doing it
#pragma warning disable 618
SendNetworkMessage(attempt.PerformInstantActionMessage());
#pragma warning restore 618
break;
case BehaviorType.Toggle:
// for toggle actions, we immediately tell the server we're toggling it.
@@ -123,7 +125,9 @@ namespace Content.Client.Actions
// even if it sometimes may not (it will be reset by the server if wrong).
attempt.ToggleAction(this, !actionState.ToggledOn);
slot.ToggledOn = !actionState.ToggledOn;
#pragma warning disable 618
SendNetworkMessage(attempt.PerformToggleActionMessage(!actionState.ToggledOn));
#pragma warning restore 618
}
else
{
@@ -178,7 +182,9 @@ namespace Content.Client.Actions
case BehaviorType.TargetPoint:
{
// send our action to the server, we chose our target
#pragma warning disable 618
SendNetworkMessage(attempt.PerformTargetPointActionMessage(args));
#pragma warning restore 618
if (!attempt.Action.Repeat)
{
_ui.StopTargeting();
@@ -189,7 +195,9 @@ namespace Content.Client.Actions
case BehaviorType.TargetEntity when args.EntityUid != EntityUid.Invalid:
{
// send our action to the server, we chose our target
#pragma warning disable 618
SendNetworkMessage(attempt.PerformTargetEntityActionMessage(args));
#pragma warning restore 618
if (!attempt.Action.Repeat)
{
_ui.StopTargeting();

View File

@@ -208,7 +208,9 @@ namespace Content.Client.Alerts
return;
}
#pragma warning disable 618
SendNetworkMessage(new ClickAlertMessage(alert.Alert.AlertType));
#pragma warning restore 618
}
protected override void AfterShowAlert()

View File

@@ -56,6 +56,7 @@ namespace Content.Client.Camera
_updateEye();
}
[Obsolete("Component Messages are deprecated, use Entity Events instead.")]
public override void HandleNetworkMessage(ComponentMessage message, INetChannel channel, ICommonSession? session = null)
{
base.HandleNetworkMessage(message, channel, session);

View File

@@ -1,3 +1,4 @@
using System;
using Content.Client.CharacterInterface;
using Content.Client.HUD.UI;
using Content.Client.Stylesheets;
@@ -35,9 +36,12 @@ namespace Content.Client.CharacterInfo.Components
public void Opened()
{
#pragma warning disable 618
SendNetworkMessage(new RequestCharacterInfoMessage());
#pragma warning restore 618
}
[Obsolete("Component Messages are deprecated, use Entity Events instead.")]
public override void HandleNetworkMessage(ComponentMessage message, INetChannel netChannel, ICommonSession? session = null)
{
base.HandleNetworkMessage(message, netChannel, session);

View File

@@ -22,6 +22,7 @@ namespace Content.Client.DoAfter
public DoAfterGui? Gui { get; set; }
[Obsolete("Component Messages are deprecated, use Entity Events instead.")]
public override void HandleNetworkMessage(ComponentMessage message, INetChannel netChannel, ICommonSession? session = null)
{
base.HandleNetworkMessage(message, netChannel, session);

View File

@@ -229,7 +229,9 @@ namespace Content.Client.Instruments
if (!fromStateChange)
{
#pragma warning disable 618
SendNetworkMessage(new InstrumentStartMidiMessage());
#pragma warning restore 618
}
}
@@ -258,7 +260,9 @@ namespace Content.Client.Instruments
if (!fromStateChange && IoCManager.Resolve<INetManager>().IsConnected)
{
#pragma warning disable 618
SendNetworkMessage(new InstrumentStopMidiMessage());
#pragma warning restore 618
}
}
@@ -268,6 +272,7 @@ namespace Content.Client.Instruments
EndRenderer();
}
[Obsolete("Component Messages are deprecated, use Entity Events instead.")]
public override void HandleNetworkMessage(ComponentMessage message, INetChannel channel, ICommonSession? session = null)
{
base.HandleNetworkMessage(message, channel, session);
@@ -472,7 +477,9 @@ namespace Content.Client.Instruments
if (eventCount == 0) return;
#pragma warning disable 618
SendNetworkMessage(new InstrumentMidiEventMessage(events));
#pragma warning restore 618
_sentWithinASec += eventCount;

View File

@@ -232,23 +232,31 @@ namespace Content.Client.Inventory
public void SendEquipMessage(Slots slot)
{
var equipMessage = new ClientInventoryMessage(slot, ClientInventoryUpdate.Equip);
#pragma warning disable 618
SendNetworkMessage(equipMessage);
#pragma warning restore 618
}
public void SendUseMessage(Slots slot)
{
var equipmessage = new ClientInventoryMessage(slot, ClientInventoryUpdate.Use);
#pragma warning disable 618
SendNetworkMessage(equipmessage);
#pragma warning restore 618
}
public void SendHoverMessage(Slots slot)
{
#pragma warning disable 618
SendNetworkMessage(new ClientInventoryMessage(slot, ClientInventoryUpdate.Hover));
#pragma warning restore 618
}
public void SendOpenStorageUIMessage(Slots slot)
{
#pragma warning disable 618
SendNetworkMessage(new OpenSlotStorageUIMessage(slot));
#pragma warning restore 618
}
public void PlayerDetached()

View File

@@ -395,7 +395,9 @@ namespace Content.Client.Light.Components
if (Owner.TryGetComponent(out AnimationPlayerComponent? animation))
{
#pragma warning disable 618
animation.AnimationCompleted += OnAnimationCompleted;
#pragma warning restore 618
}
foreach (var container in _animations)

View File

@@ -23,7 +23,9 @@ namespace Content.Client.Singularity.Components
}
else
{
#pragma warning disable 618
_spriteComponent.Directional = false;
#pragma warning restore 618
}
}
}

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Client.Animations;
@@ -79,6 +80,7 @@ namespace Content.Client.Storage
.ToList();
}
[Obsolete("Component Messages are deprecated, use Entity Events instead.")]
public override void HandleNetworkMessage(ComponentMessage message, INetChannel channel, ICommonSession? session = null)
{
base.HandleNetworkMessage(message, channel, session);
@@ -180,7 +182,9 @@ namespace Content.Client.Storage
{
if (buttonEventArgs.Event.Function == EngineKeyFunctions.UIClick)
{
#pragma warning disable 618
SendNetworkMessage(new RemoveEntityMessage(entityUid));
#pragma warning restore 618
buttonEventArgs.Event.Handle();
}
else if (Owner.EntityManager.TryGetEntity(entityUid, out var entity))
@@ -281,7 +285,9 @@ namespace Content.Client.Storage
if (controlledEntity?.TryGetComponent(out HandsComponent? hands) ?? false)
{
#pragma warning disable 618
StorageEntity.SendNetworkMessage(new InsertEntityMessage());
#pragma warning restore 618
}
};
@@ -316,7 +322,9 @@ namespace Content.Client.Storage
public override void Close()
{
#pragma warning disable 618
StorageEntity.SendNetworkMessage(new CloseStorageUIMessage());
#pragma warning restore 618
base.Close();
}

View File

@@ -104,6 +104,7 @@ namespace Content.Client.Weapons.Ranged.Barrels.Components
_statusControl?.Update();
}
[Obsolete("Component Messages are deprecated, use Entity Events instead.")]
public override void HandleNetworkMessage(ComponentMessage message, INetChannel channel, ICommonSession? session = null)
{
base.HandleNetworkMessage(message, channel, session);

View File

@@ -33,7 +33,9 @@ namespace Content.Client.Weapons.Ranged
public void SyncFirePos(GridId targetGrid, Vector2 targetPosition)
{
#pragma warning disable 618
SendNetworkMessage(new FirePosComponentMessage(targetGrid, targetPosition));
#pragma warning restore 618
}
}
}