Research Servers now have proper IDs, and can be selected in lathe menu (#9949)

* rd servers now increment properly when added

* remove debug message
This commit is contained in:
Chris
2022-07-21 15:16:14 -07:00
committed by GitHub
parent b293f2dacb
commit e8eaaa2189
3 changed files with 4 additions and 5 deletions

View File

@@ -2,8 +2,6 @@ using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
namespace Content.Client.Research.UI
{
@@ -11,8 +9,8 @@ namespace Content.Client.Research.UI
public sealed partial class ResearchClientServerSelectionMenu : DefaultWindow
{
private int _serverCount;
private string[] _serverNames = System.Array.Empty<string>();
private int[] _serverIds = System.Array.Empty<int>();
private string[] _serverNames = Array.Empty<string>();
private int[] _serverIds = Array.Empty<int>();
private int _selectedServerId = -1;
private ResearchClientBoundUserInterface Owner { get; }

View File

@@ -11,7 +11,7 @@ namespace Content.Server.Research.Components
[ViewVariables(VVAccess.ReadWrite)] [DataField("points")]
public int Points = 0;
[ViewVariables(VVAccess.ReadOnly)] public int Id { get; private set; }
[ViewVariables(VVAccess.ReadOnly)] public int Id { get; set; }
[ViewVariables(VVAccess.ReadOnly)]
public List<ResearchPointSourceComponent> PointSources { get; } = new();

View File

@@ -31,6 +31,7 @@ namespace Content.Server.Research
{
if (_servers.Contains(server)) return false;
_servers.Add(server);
_servers[^1].Id = _servers.Count - 1;
return true;
}