Clean up some warnings (#6088)
* Clean up some warnings * Remove nullable enable Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Content.Client.Arcade.UI
|
||||
_menu?.SetUsability(userMessage.IsPlayer);
|
||||
break;
|
||||
case BlockGameMessages.BlockGameSetScreenMessage statusMessage:
|
||||
if (statusMessage.isStarted) _menu?.SetStarted();
|
||||
if (statusMessage.IsStarted) _menu?.SetStarted();
|
||||
_menu?.SetScreen(statusMessage.Screen);
|
||||
if (statusMessage is BlockGameMessages.BlockGameGameOverScreenMessage gameOverScreenMessage)
|
||||
_menu?.SetGameoverInfo(gameOverScreenMessage.FinalScore, gameOverScreenMessage.LocalPlacement, gameOverScreenMessage.GlobalPlacement);
|
||||
|
||||
@@ -9,16 +9,16 @@ namespace Content.Client.Computer
|
||||
/// ComputerBoundUserInterface shunts all sorts of responsibilities that are in the BoundUserInterface for architectural reasons into the Window.
|
||||
/// NOTE: Despite the name, ComputerBoundUserInterface does not and will not care about things like power.
|
||||
/// </summary>
|
||||
public class ComputerBoundUserInterface<W, S> : ComputerBoundUserInterfaceBase where W : BaseWindow, IComputerWindow<S>, new() where S : BoundUserInterfaceState
|
||||
public class ComputerBoundUserInterface<TWindow, TState> : ComputerBoundUserInterfaceBase where TWindow : BaseWindow, IComputerWindow<TState>, new() where TState : BoundUserInterfaceState
|
||||
{
|
||||
[Dependency] private readonly IDynamicTypeFactory _dynamicTypeFactory = default!;
|
||||
private W? _window;
|
||||
private TWindow? _window;
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = (W) _dynamicTypeFactory.CreateInstance(typeof(W));
|
||||
_window = (TWindow) _dynamicTypeFactory.CreateInstance(typeof(TWindow));
|
||||
_window.SetupComputerWindow(this);
|
||||
_window.OnClose += Close;
|
||||
_window.OpenCentered();
|
||||
@@ -36,7 +36,7 @@ namespace Content.Client.Computer
|
||||
return;
|
||||
}
|
||||
|
||||
_window.UpdateState((S) state);
|
||||
_window.UpdateState((TState) state);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
@@ -64,10 +64,10 @@ namespace Content.Client.Computer
|
||||
}
|
||||
}
|
||||
|
||||
public interface IComputerWindow<S>
|
||||
public interface IComputerWindow<TState>
|
||||
{
|
||||
void SetupComputerWindow(ComputerBoundUserInterfaceBase cb) {}
|
||||
void UpdateState(S state) {}
|
||||
void UpdateState(TState state) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,8 @@ using Robust.Client.Graphics;
|
||||
using Robust.Client.Utility;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Client.Decals
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Content.Client.Inventory
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner).EntityName))}");
|
||||
_strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner).EntityName))}");
|
||||
|
||||
_strippingMenu.OnClose += Close;
|
||||
_strippingMenu.OpenCentered();
|
||||
|
||||
@@ -20,9 +20,9 @@ namespace Content.Client.Lathe.Components
|
||||
|
||||
Clear();
|
||||
|
||||
foreach (var ID in state.Recipes)
|
||||
foreach (var id in state.Recipes)
|
||||
{
|
||||
if (!_prototypeManager.TryIndex(ID, out LatheRecipePrototype? recipe)) continue;
|
||||
if (!_prototypeManager.TryIndex(id, out LatheRecipePrototype? recipe)) continue;
|
||||
AddRecipe(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace Content.Client.Lathe.Components
|
||||
|
||||
Clear();
|
||||
|
||||
foreach (var ID in state.Recipes)
|
||||
foreach (var id in state.Recipes)
|
||||
{
|
||||
if(!_prototypeManager.TryIndex(ID, out LatheRecipePrototype? recipe)) continue;
|
||||
if(!_prototypeManager.TryIndex(id, out LatheRecipePrototype? recipe)) continue;
|
||||
AddRecipe(recipe);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Client.MedicalScanner.UI
|
||||
}
|
||||
else
|
||||
{
|
||||
text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", Name: entities.GetComponent<MetaDataComponent>(state.Entity.Value).EntityName))}\n");
|
||||
text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", entities.GetComponent<MetaDataComponent>(state.Entity.Value).EntityName))}\n");
|
||||
|
||||
var totalDamage = state.DamagePerType.Values.Sum();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Client.VendingMachines.UI;
|
||||
using Content.Client.VendingMachines.UI;
|
||||
using Content.Shared.VendingMachines;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -38,9 +38,9 @@ namespace Content.Client.VendingMachines
|
||||
_menu.OpenCentered();
|
||||
}
|
||||
|
||||
public void Eject(string ID)
|
||||
public void Eject(string id)
|
||||
{
|
||||
SendMessage(new VendingMachineEjectMessage(ID));
|
||||
SendMessage(new VendingMachineEjectMessage(id));
|
||||
}
|
||||
|
||||
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
|
||||
|
||||
Reference in New Issue
Block a user