Replace ValidatePrototypeId uses with ProtoId or EntProtoId (#38814)
* The easy ones * For certain values of easy * Easy test * Hair * Fix sandbox violations * Sort usings
This commit is contained in:
@@ -67,8 +67,7 @@ public sealed partial class ChatUIController : UIController
|
||||
[UISystemDependency] private readonly MindSystem? _mindSystem = default!;
|
||||
[UISystemDependency] private readonly RoleCodewordSystem? _roleCodewordSystem = default!;
|
||||
|
||||
[ValidatePrototypeId<ColorPalettePrototype>]
|
||||
private const string ChatNamePalette = "ChatNames";
|
||||
private static readonly ProtoId<ColorPalettePrototype> ChatNamePalette = "ChatNames";
|
||||
private string[] _chatNameColors = default!;
|
||||
private bool _chatNameColorsEnabled;
|
||||
|
||||
@@ -232,7 +231,7 @@ public sealed partial class ChatUIController : UIController
|
||||
gameplayStateLoad.OnScreenLoad += OnScreenLoad;
|
||||
gameplayStateLoad.OnScreenUnload += OnScreenUnload;
|
||||
|
||||
var nameColors = _prototypeManager.Index<ColorPalettePrototype>(ChatNamePalette).Colors.Values.ToArray();
|
||||
var nameColors = _prototypeManager.Index(ChatNamePalette).Colors.Values.ToArray();
|
||||
_chatNameColors = new string[nameColors.Length];
|
||||
for (var i = 0; i < nameColors.Length; i++)
|
||||
{
|
||||
|
||||
@@ -19,8 +19,7 @@ public sealed class InfoUIController : UIController, IOnStateExited<GameplayStat
|
||||
private RulesPopup? _rulesPopup;
|
||||
private RulesAndInfoWindow? _infoWindow;
|
||||
|
||||
[ValidatePrototypeId<GuideEntryPrototype>]
|
||||
private const string DefaultRuleset = "DefaultRuleset";
|
||||
private static readonly ProtoId<GuideEntryPrototype> DefaultRuleset = "DefaultRuleset";
|
||||
|
||||
public ProtoId<GuideEntryPrototype> RulesEntryId = DefaultRuleset;
|
||||
|
||||
@@ -92,7 +91,7 @@ public sealed class InfoUIController : UIController, IOnStateExited<GameplayStat
|
||||
{
|
||||
if (!_prototype.TryIndex(RulesEntryId, out var guideEntryPrototype))
|
||||
{
|
||||
guideEntryPrototype = _prototype.Index<GuideEntryPrototype>(DefaultRuleset);
|
||||
guideEntryPrototype = _prototype.Index(DefaultRuleset);
|
||||
Log.Error($"Couldn't find the following prototype: {RulesEntryId}. Falling back to {DefaultRuleset}, please check that the server has the rules set up correctly");
|
||||
return guideEntryPrototype;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user