Content PR for YAML hot reloading (#3319)
* Content PR for YAML hot reloading * Add CanAdminReloadPrototypes (host permission) * IndexedPrototype fixes
This commit is contained in:
@@ -490,6 +490,11 @@ namespace Content.Server.Administration
|
|||||||
return GetAdminData(session)?.CanAdminMenu() ?? false;
|
return GetAdminData(session)?.CanAdminMenu() ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanAdminReloadPrototypes(IPlayerSession session)
|
||||||
|
{
|
||||||
|
return GetAdminData(session)?.CanAdminReloadPrototypes() ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
private void SendPermsChangedEvent(IPlayerSession session)
|
private void SendPermsChangedEvent(IPlayerSession session)
|
||||||
{
|
{
|
||||||
var flags = GetAdminData(session)?.Flags;
|
var flags = GetAdminData(session)?.Flags;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Content.Server.Atmos.Reactions
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Prototype("gasReaction")]
|
[Prototype("gasReaction")]
|
||||||
public class GasReactionPrototype : IPrototype, IIndexedPrototype
|
public class GasReactionPrototype : IPrototype
|
||||||
{
|
{
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace Content.Server.Botany
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Prototype("seed")]
|
[Prototype("seed")]
|
||||||
public class Seed : IPrototype, IIndexedPrototype, IExposeData
|
public class Seed : IPrototype, IExposeData
|
||||||
{
|
{
|
||||||
private const string SeedPrototype = "SeedBase";
|
private const string SeedPrototype = "SeedBase";
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Server.GameObjects.Components.BarSign
|
namespace Content.Server.GameObjects.Components.BarSign
|
||||||
{
|
{
|
||||||
[Prototype("barSign")]
|
[Prototype("barSign")]
|
||||||
public class BarSignPrototype : IPrototype, IIndexedPrototype
|
public class BarSignPrototype : IPrototype
|
||||||
{
|
{
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
public string Icon { get; private set; }
|
public string Icon { get; private set; }
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Server.Holiday
|
namespace Content.Server.Holiday
|
||||||
{
|
{
|
||||||
[Prototype("holiday")]
|
[Prototype("holiday")]
|
||||||
public class HolidayPrototype : IPrototype, IIndexedPrototype
|
public class HolidayPrototype : IPrototype
|
||||||
{
|
{
|
||||||
[ViewVariables] public string Name { get; private set; } = string.Empty;
|
[ViewVariables] public string Name { get; private set; } = string.Empty;
|
||||||
[ViewVariables] public string ID { get; private set; } = string.Empty;
|
[ViewVariables] public string ID { get; private set; } = string.Empty;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Server.Objectives
|
namespace Content.Server.Objectives
|
||||||
{
|
{
|
||||||
[Prototype("objective")]
|
[Prototype("objective")]
|
||||||
public class ObjectivePrototype : IPrototype, IIndexedPrototype
|
public class ObjectivePrototype : IPrototype
|
||||||
{
|
{
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Content.Shared.Access
|
|||||||
/// Defines a single access level that can be stored on ID cards and checked for.
|
/// Defines a single access level that can be stored on ID cards and checked for.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("accessLevel")]
|
[Prototype("accessLevel")]
|
||||||
public class AccessLevelPrototype : IPrototype, IIndexedPrototype
|
public class AccessLevelPrototype : IPrototype
|
||||||
{
|
{
|
||||||
public void LoadFrom(YamlMappingNode mapping)
|
public void LoadFrom(YamlMappingNode mapping)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ namespace Content.Shared.Actions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseActionPrototype : IPrototype
|
public abstract class BaseActionPrototype : IPrototype
|
||||||
{
|
{
|
||||||
|
public string ID { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Icon representing this action in the UI.
|
/// Icon representing this action in the UI.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -89,7 +91,11 @@ namespace Content.Shared.Actions
|
|||||||
var serializer = YamlObjectSerializer.NewReader(mapping);
|
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||||
|
|
||||||
serializer.DataReadFunction("name", string.Empty,
|
serializer.DataReadFunction("name", string.Empty,
|
||||||
s => Name = FormattedMessage.FromMarkup(s));
|
s =>
|
||||||
|
{
|
||||||
|
ID = s;
|
||||||
|
Name = FormattedMessage.FromMarkup(s);
|
||||||
|
});
|
||||||
serializer.DataReadFunction("description", string.Empty,
|
serializer.DataReadFunction("description", string.Empty,
|
||||||
s => Description = FormattedMessage.FromMarkup(s));
|
s => Description = FormattedMessage.FromMarkup(s));
|
||||||
|
|
||||||
|
|||||||
@@ -64,5 +64,10 @@ namespace Content.Shared.Administration
|
|||||||
{
|
{
|
||||||
return HasFlag(AdminFlags.Admin);
|
return HasFlag(AdminFlags.Admin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanAdminReloadPrototypes()
|
||||||
|
{
|
||||||
|
return HasFlag(AdminFlags.Host);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,23 +12,29 @@ namespace Content.Shared.Alert
|
|||||||
[Prototype("alertOrder")]
|
[Prototype("alertOrder")]
|
||||||
public class AlertOrderPrototype : IPrototype, IComparer<AlertPrototype>
|
public class AlertOrderPrototype : IPrototype, IComparer<AlertPrototype>
|
||||||
{
|
{
|
||||||
|
public string ID { get; private set; }
|
||||||
|
|
||||||
private readonly Dictionary<AlertType, int> _typeToIdx = new();
|
private readonly Dictionary<AlertType, int> _typeToIdx = new();
|
||||||
private readonly Dictionary<AlertCategory, int> _categoryToIdx = new();
|
private readonly Dictionary<AlertCategory, int> _categoryToIdx = new();
|
||||||
|
|
||||||
public void LoadFrom(YamlMappingNode mapping)
|
public void LoadFrom(YamlMappingNode mapping)
|
||||||
{
|
{
|
||||||
|
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||||
|
|
||||||
|
serializer.DataField(this, x => x.ID, "id", string.Empty);
|
||||||
|
|
||||||
if (!mapping.TryGetNode("order", out YamlSequenceNode orderMapping)) return;
|
if (!mapping.TryGetNode("order", out YamlSequenceNode orderMapping)) return;
|
||||||
|
|
||||||
int i = 0;
|
var i = 0;
|
||||||
foreach (var entryYaml in orderMapping)
|
foreach (var entryYaml in orderMapping)
|
||||||
{
|
{
|
||||||
var orderEntry = (YamlMappingNode) entryYaml;
|
var orderEntry = (YamlMappingNode) entryYaml;
|
||||||
var serializer = YamlObjectSerializer.NewReader(orderEntry);
|
var orderSerializer = YamlObjectSerializer.NewReader(orderEntry);
|
||||||
if (serializer.TryReadDataField("category", out AlertCategory alertCategory))
|
if (orderSerializer.TryReadDataField("category", out AlertCategory alertCategory))
|
||||||
{
|
{
|
||||||
_categoryToIdx[alertCategory] = i++;
|
_categoryToIdx[alertCategory] = i++;
|
||||||
}
|
}
|
||||||
else if (serializer.TryReadDataField("alertType", out AlertType alertType))
|
else if (orderSerializer.TryReadDataField("alertType", out AlertType alertType))
|
||||||
{
|
{
|
||||||
_typeToIdx[alertType] = i++;
|
_typeToIdx[alertType] = i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ namespace Content.Shared.Alert
|
|||||||
[Prototype("alert")]
|
[Prototype("alert")]
|
||||||
public class AlertPrototype : IPrototype
|
public class AlertPrototype : IPrototype
|
||||||
{
|
{
|
||||||
|
public string ID { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Type of alert, no 2 alert prototypes should have the same one.
|
/// Type of alert, no 2 alert prototypes should have the same one.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -94,7 +96,11 @@ namespace Content.Shared.Alert
|
|||||||
serializer.DataField(ref _minSeverity, "minSeverity", (short) 1);
|
serializer.DataField(ref _minSeverity, "minSeverity", (short) 1);
|
||||||
|
|
||||||
serializer.DataReadFunction("name", string.Empty,
|
serializer.DataReadFunction("name", string.Empty,
|
||||||
s => Name = FormattedMessage.FromMarkup(s));
|
s =>
|
||||||
|
{
|
||||||
|
ID = s;
|
||||||
|
Name = FormattedMessage.FromMarkup(s);
|
||||||
|
});
|
||||||
serializer.DataReadFunction("description", string.Empty,
|
serializer.DataReadFunction("description", string.Empty,
|
||||||
s => Description = FormattedMessage.FromMarkup(s));
|
s => Description = FormattedMessage.FromMarkup(s));
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Atmos
|
namespace Content.Shared.Atmos
|
||||||
{
|
{
|
||||||
[Prototype("gas")]
|
[Prototype("gas")]
|
||||||
public class GasPrototype : IPrototype, IIndexedPrototype
|
public class GasPrototype : IPrototype
|
||||||
{
|
{
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Audio
|
namespace Content.Shared.Audio
|
||||||
{
|
{
|
||||||
[Prototype("soundCollection")]
|
[Prototype("soundCollection")]
|
||||||
public sealed class SoundCollectionPrototype : IPrototype, IIndexedPrototype
|
public sealed class SoundCollectionPrototype : IPrototype
|
||||||
{
|
{
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
public IReadOnlyList<string> PickFiles { get; private set; }
|
public IReadOnlyList<string> PickFiles { get; private set; }
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Content.Shared.Chemistry
|
|||||||
/// Prototype for chemical reaction definitions
|
/// Prototype for chemical reaction definitions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("reaction")]
|
[Prototype("reaction")]
|
||||||
public class ReactionPrototype : IPrototype, IIndexedPrototype
|
public class ReactionPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _id = default!;
|
private string _id = default!;
|
||||||
private string _name = default!;
|
private string _name = default!;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Chemistry
|
namespace Content.Shared.Chemistry
|
||||||
{
|
{
|
||||||
[Prototype("reagent")]
|
[Prototype("reagent")]
|
||||||
public class ReagentPrototype : IPrototype, IIndexedPrototype
|
public class ReagentPrototype : IPrototype
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IModuleManager _moduleManager = default!;
|
[Dependency] private readonly IModuleManager _moduleManager = default!;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Construction
|
namespace Content.Shared.Construction
|
||||||
{
|
{
|
||||||
[Prototype("constructionGraph")]
|
[Prototype("constructionGraph")]
|
||||||
public class ConstructionGraphPrototype : IPrototype, IIndexedPrototype
|
public class ConstructionGraphPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private readonly Dictionary<string, ConstructionGraphNode> _nodes = new();
|
private readonly Dictionary<string, ConstructionGraphNode> _nodes = new();
|
||||||
private readonly Dictionary<ValueTuple<string, string>, ConstructionGraphNode[]> _paths = new();
|
private readonly Dictionary<ValueTuple<string, string>, ConstructionGraphNode[]> _paths = new();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Construction
|
namespace Content.Shared.Construction
|
||||||
{
|
{
|
||||||
[Prototype("construction")]
|
[Prototype("construction")]
|
||||||
public class ConstructionPrototype : IPrototype, IIndexedPrototype
|
public class ConstructionPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private List<IConstructionCondition> _conditions;
|
private List<IConstructionCondition> _conditions;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Content.Shared.Damage.DamageContainer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("damageContainer")]
|
[Prototype("damageContainer")]
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public class DamageContainerPrototype : IPrototype, IIndexedPrototype
|
public class DamageContainerPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private bool _supportAll;
|
private bool _supportAll;
|
||||||
private HashSet<DamageClass> _supportedClasses;
|
private HashSet<DamageClass> _supportedClasses;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Content.Shared.Damage.ResistanceSet
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("resistanceSet")]
|
[Prototype("resistanceSet")]
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public class ResistanceSetPrototype : IPrototype, IIndexedPrototype
|
public class ResistanceSetPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private Dictionary<DamageType, float> _coefficients;
|
private Dictionary<DamageType, float> _coefficients;
|
||||||
private Dictionary<DamageType, int> _flatReductions;
|
private Dictionary<DamageType, int> _flatReductions;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Content.Shared.GameObjects.Components.Body.Preset
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("bodyPreset")]
|
[Prototype("bodyPreset")]
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public class BodyPresetPrototype : IPrototype, IIndexedPrototype
|
public class BodyPresetPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _id;
|
private string _id;
|
||||||
private string _name;
|
private string _name;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Content.Shared.GameObjects.Components.Body.Template
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("bodyTemplate")]
|
[Prototype("bodyTemplate")]
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public class BodyTemplatePrototype : IPrototype, IIndexedPrototype
|
public class BodyTemplatePrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _id;
|
private string _id;
|
||||||
private string _name;
|
private string _name;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry.ReagentDispenser
|
|||||||
/// machines define their inventory.
|
/// machines define their inventory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable, NetSerializable, Prototype("reagentDispenserInventory")]
|
[Serializable, NetSerializable, Prototype("reagentDispenserInventory")]
|
||||||
public class ReagentDispenserInventoryPrototype : IPrototype, IIndexedPrototype
|
public class ReagentDispenserInventoryPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _id;
|
private string _id;
|
||||||
private List<string> _inventory;
|
private List<string> _inventory;
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ namespace Content.Shared.GameObjects.Components
|
|||||||
[Serializable, NetSerializable, Prototype("crayonDecal")]
|
[Serializable, NetSerializable, Prototype("crayonDecal")]
|
||||||
public class CrayonDecalPrototype : IPrototype
|
public class CrayonDecalPrototype : IPrototype
|
||||||
{
|
{
|
||||||
|
public string ID { get; private set; }
|
||||||
|
|
||||||
private string _spritePath;
|
private string _spritePath;
|
||||||
public string SpritePath => _spritePath;
|
public string SpritePath => _spritePath;
|
||||||
|
|
||||||
@@ -83,6 +85,7 @@ namespace Content.Shared.GameObjects.Components
|
|||||||
{
|
{
|
||||||
var serializer = YamlObjectSerializer.NewReader(mapping);
|
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||||
|
|
||||||
|
serializer.DataField(this, x => x.ID, "id", string.Empty);
|
||||||
serializer.DataField(ref _spritePath, "spritePath", "");
|
serializer.DataField(ref _spritePath, "spritePath", "");
|
||||||
serializer.DataField(ref _decals, "decals", new List<string>());
|
serializer.DataField(ref _decals, "decals", new List<string>());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.GameObjects.Components.Weapons.Melee
|
namespace Content.Shared.GameObjects.Components.Weapons.Melee
|
||||||
{
|
{
|
||||||
[Prototype("MeleeWeaponAnimation")]
|
[Prototype("MeleeWeaponAnimation")]
|
||||||
public sealed class MeleeWeaponAnimationPrototype : IPrototype, IIndexedPrototype
|
public sealed class MeleeWeaponAnimationPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _prototype;
|
private string _prototype;
|
||||||
private string _state;
|
private string _state;
|
||||||
@@ -19,7 +19,7 @@ namespace Content.Shared.GameObjects.Components.Weapons.Melee
|
|||||||
private float _speed;
|
private float _speed;
|
||||||
private float _width;
|
private float _width;
|
||||||
private WeaponArcType _arcType;
|
private WeaponArcType _arcType;
|
||||||
|
|
||||||
[ViewVariables] public string ID => _id;
|
[ViewVariables] public string ID => _id;
|
||||||
[ViewVariables] public string State => _state;
|
[ViewVariables] public string State => _state;
|
||||||
[ViewVariables] public string Prototype => _prototype;
|
[ViewVariables] public string Prototype => _prototype;
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ namespace Content.Shared.Maps
|
|||||||
{
|
{
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
[Prototype("tile")]
|
[Prototype("tile")]
|
||||||
public sealed class ContentTileDefinition : IPrototype, IIndexedPrototype, ITileDefinition
|
public sealed class ContentTileDefinition : IPrototype, ITileDefinition
|
||||||
{
|
{
|
||||||
string IIndexedPrototype.ID => Name;
|
string IPrototype.ID => Name;
|
||||||
|
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
public ushort TileId { get; private set; }
|
public ushort TileId { get; private set; }
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ namespace Content.Shared.Materials
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Prototype("material")]
|
[Prototype("material")]
|
||||||
public class MaterialPrototype : IPrototype, IIndexedPrototype
|
public class MaterialPrototype : IPrototype
|
||||||
{
|
{
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Prototypes.Cargo
|
namespace Content.Shared.Prototypes.Cargo
|
||||||
{
|
{
|
||||||
[NetSerializable, Serializable, Prototype("cargoProduct")]
|
[NetSerializable, Serializable, Prototype("cargoProduct")]
|
||||||
public class CargoProductPrototype : IPrototype, IIndexedPrototype
|
public class CargoProductPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _id;
|
private string _id;
|
||||||
private string _name;
|
private string _name;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Prototypes
|
namespace Content.Shared.Prototypes
|
||||||
{
|
{
|
||||||
[Prototype("dataset")]
|
[Prototype("dataset")]
|
||||||
public class DatasetPrototype : IPrototype, IIndexedPrototype
|
public class DatasetPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _id;
|
private string _id;
|
||||||
public string ID => _id;
|
public string ID => _id;
|
||||||
|
|||||||
@@ -9,20 +9,17 @@ namespace Content.Shared.Prototypes.Kitchen
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A recipe for space microwaves.
|
/// A recipe for space microwaves.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
[Prototype("microwaveMealRecipe")]
|
[Prototype("microwaveMealRecipe")]
|
||||||
|
public class FoodRecipePrototype : IPrototype
|
||||||
public class FoodRecipePrototype : IPrototype, IIndexedPrototype
|
|
||||||
{
|
{
|
||||||
|
|
||||||
private string _id;
|
private string _id;
|
||||||
private string _name;
|
private string _name;
|
||||||
private string _result;
|
private string _result;
|
||||||
private int _cookTime;
|
private int _cookTime;
|
||||||
|
|
||||||
private Dictionary<string, int> _ingsReagents;
|
private Dictionary<string, int> _ingsReagents;
|
||||||
private Dictionary<string, int> _ingsSolids;
|
private Dictionary<string, int> _ingsSolids;
|
||||||
|
|
||||||
public string Name => Loc.GetString(_name);
|
public string Name => Loc.GetString(_name);
|
||||||
public string ID => _id;
|
public string ID => _id;
|
||||||
public string Result => _result;
|
public string Result => _result;
|
||||||
@@ -30,7 +27,6 @@ namespace Content.Shared.Prototypes.Kitchen
|
|||||||
public IReadOnlyDictionary<string, int> IngredientsReagents => _ingsReagents;
|
public IReadOnlyDictionary<string, int> IngredientsReagents => _ingsReagents;
|
||||||
public IReadOnlyDictionary<string, int> IngredientsSolids => _ingsSolids;
|
public IReadOnlyDictionary<string, int> IngredientsSolids => _ingsSolids;
|
||||||
|
|
||||||
|
|
||||||
public void LoadFrom(YamlMappingNode mapping)
|
public void LoadFrom(YamlMappingNode mapping)
|
||||||
{
|
{
|
||||||
var serializer = YamlObjectSerializer.NewReader(mapping);
|
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||||
@@ -42,6 +38,5 @@ namespace Content.Shared.Prototypes.Kitchen
|
|||||||
serializer.DataField(ref _ingsSolids, "solids", new Dictionary<string, int>());
|
serializer.DataField(ref _ingsSolids, "solids", new Dictionary<string, int>());
|
||||||
serializer.DataField(ref _cookTime, "time", 5);
|
serializer.DataField(ref _cookTime, "time", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Prototypes.PDA
|
namespace Content.Shared.Prototypes.PDA
|
||||||
{
|
{
|
||||||
[Prototype("uplinkListing")]
|
[Prototype("uplinkListing")]
|
||||||
public class UplinkStoreListingPrototype : IPrototype, IIndexedPrototype
|
public class UplinkStoreListingPrototype : IPrototype
|
||||||
{
|
{
|
||||||
|
|
||||||
private string _id;
|
private string _id;
|
||||||
private string _itemId;
|
private string _itemId;
|
||||||
private int _price;
|
private int _price;
|
||||||
@@ -23,6 +22,7 @@ namespace Content.Shared.Prototypes.PDA
|
|||||||
public UplinkCategory Category => _category;
|
public UplinkCategory Category => _category;
|
||||||
public string Description => _desc;
|
public string Description => _desc;
|
||||||
public string ListingName => _name;
|
public string ListingName => _name;
|
||||||
|
|
||||||
public void LoadFrom(YamlMappingNode mapping)
|
public void LoadFrom(YamlMappingNode mapping)
|
||||||
{
|
{
|
||||||
var serializer = YamlObjectSerializer.NewReader(mapping);
|
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||||
@@ -32,7 +32,6 @@ namespace Content.Shared.Prototypes.PDA
|
|||||||
serializer.DataField(ref _category, "category", UplinkCategory.Utility);
|
serializer.DataField(ref _category, "category", UplinkCategory.Utility);
|
||||||
serializer.DataField(ref _desc, "description", string.Empty);
|
serializer.DataField(ref _desc, "description", string.Empty);
|
||||||
serializer.DataField(ref _name, "listingName", string.Empty);
|
serializer.DataField(ref _name, "listingName", string.Empty);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Content.Shared.Prototypes.Tag
|
|||||||
/// gets saved in TagComponent.
|
/// gets saved in TagComponent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("Tag")]
|
[Prototype("Tag")]
|
||||||
public class TagPrototype : IPrototype, IIndexedPrototype
|
public class TagPrototype : IPrototype
|
||||||
{
|
{
|
||||||
public string ID { get; [UsedImplicitly] private set; } = default!;
|
public string ID { get; [UsedImplicitly] private set; } = default!;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Research
|
namespace Content.Shared.Research
|
||||||
{
|
{
|
||||||
[NetSerializable, Serializable, Prototype("latheRecipe")]
|
[NetSerializable, Serializable, Prototype("latheRecipe")]
|
||||||
public class LatheRecipePrototype : IPrototype, IIndexedPrototype
|
public class LatheRecipePrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _name;
|
private string _name;
|
||||||
private string _id;
|
private string _id;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.Research
|
namespace Content.Shared.Research
|
||||||
{
|
{
|
||||||
[NetSerializable, Serializable, Prototype("technology")]
|
[NetSerializable, Serializable, Prototype("technology")]
|
||||||
public class TechnologyPrototype : IPrototype, IIndexedPrototype
|
public class TechnologyPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _name;
|
private string _name;
|
||||||
private string _id;
|
private string _id;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Content.Shared.Roles
|
|||||||
/// Describes information for a single antag.
|
/// Describes information for a single antag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("antag")]
|
[Prototype("antag")]
|
||||||
public class AntagPrototype : IPrototype, IIndexedPrototype
|
public class AntagPrototype : IPrototype
|
||||||
{
|
{
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Content.Shared.Roles
|
|||||||
/// Describes information for a single job on the station.
|
/// Describes information for a single job on the station.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("job")]
|
[Prototype("job")]
|
||||||
public class JobPrototype : IPrototype, IIndexedPrototype
|
public class JobPrototype : IPrototype
|
||||||
{
|
{
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefine
|
|||||||
namespace Content.Shared.Roles
|
namespace Content.Shared.Roles
|
||||||
{
|
{
|
||||||
[Prototype("startingGear")]
|
[Prototype("startingGear")]
|
||||||
public class StartingGearPrototype : IPrototype, IIndexedPrototype
|
public class StartingGearPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _id = default!;
|
private string _id = default!;
|
||||||
private Dictionary<Slots, string> _equipment = default!;
|
private Dictionary<Slots, string> _equipment = default!;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using YamlDotNet.RepresentationModel;
|
|||||||
namespace Content.Shared.VendingMachines
|
namespace Content.Shared.VendingMachines
|
||||||
{
|
{
|
||||||
[Serializable, NetSerializable, Prototype("vendingMachineInventory")]
|
[Serializable, NetSerializable, Prototype("vendingMachineInventory")]
|
||||||
public class VendingMachineInventoryPrototype : IPrototype, IIndexedPrototype
|
public class VendingMachineInventoryPrototype : IPrototype
|
||||||
{
|
{
|
||||||
private string _id;
|
private string _id;
|
||||||
private string _name;
|
private string _name;
|
||||||
|
|||||||
@@ -15,11 +15,13 @@ namespace Content.Tests.Server.GameObjects.Components.Mobs
|
|||||||
{
|
{
|
||||||
const string PROTOTYPES = @"
|
const string PROTOTYPES = @"
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertLowPressure
|
||||||
alertType: LowPressure
|
alertType: LowPressure
|
||||||
category: Pressure
|
category: Pressure
|
||||||
icon: /Textures/Interface/Alerts/Pressure/lowpressure.png
|
icon: /Textures/Interface/Alerts/Pressure/lowpressure.png
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertHighPressure
|
||||||
alertType: HighPressure
|
alertType: HighPressure
|
||||||
category: Pressure
|
category: Pressure
|
||||||
icon: /Textures/Interface/Alerts/Pressure/highpressure.png
|
icon: /Textures/Interface/Alerts/Pressure/highpressure.png
|
||||||
|
|||||||
@@ -12,10 +12,12 @@ namespace Content.Tests.Shared.Alert
|
|||||||
{
|
{
|
||||||
const string PROTOTYPES = @"
|
const string PROTOTYPES = @"
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertLowPressure
|
||||||
alertType: LowPressure
|
alertType: LowPressure
|
||||||
icon: /Textures/Interface/Alerts/Pressure/lowpressure.png
|
icon: /Textures/Interface/Alerts/Pressure/lowpressure.png
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertHighPressure
|
||||||
alertType: HighPressure
|
alertType: HighPressure
|
||||||
icon: /Textures/Interface/Alerts/Pressure/highpressure.png
|
icon: /Textures/Interface/Alerts/Pressure/highpressure.png
|
||||||
";
|
";
|
||||||
|
|||||||
@@ -23,39 +23,49 @@ namespace Content.Tests.Shared.Alert
|
|||||||
- category: Temperature
|
- category: Temperature
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertLowPressure
|
||||||
category: Pressure
|
category: Pressure
|
||||||
alertType: LowPressure
|
alertType: LowPressure
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertOverfed
|
||||||
category: Hunger
|
category: Hunger
|
||||||
alertType: Overfed
|
alertType: Overfed
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertHighPressure
|
||||||
category: Pressure
|
category: Pressure
|
||||||
alertType: HighPressure
|
alertType: HighPressure
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertPeckish
|
||||||
category: Hunger
|
category: Hunger
|
||||||
alertType: Peckish
|
alertType: Peckish
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertStun
|
||||||
alertType: Stun
|
alertType: Stun
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertHandcuffed
|
||||||
alertType: Handcuffed
|
alertType: Handcuffed
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertHot
|
||||||
category: Temperature
|
category: Temperature
|
||||||
alertType: Hot
|
alertType: Hot
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertCold
|
||||||
category: Temperature
|
category: Temperature
|
||||||
alertType: Cold
|
alertType: Cold
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertWeightless
|
||||||
alertType: Weightless
|
alertType: Weightless
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
|
name: AlertPilotingShuttle
|
||||||
alertType: PilotingShuttle
|
alertType: PilotingShuttle
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# Defines ordering in alert tab, higher up = higher in tab.
|
# Defines ordering in alert tab, higher up = higher in tab.
|
||||||
# List below can contain alert type or category, if both are present the id will take precedence.
|
# List below can contain alert type or category, if both are present the id will take precedence.
|
||||||
# If item is not in list it will go at the bottom (ties broken by alert type enum value)
|
# If item is not in list it will go at the bottom (ties broken by alert type enum value)
|
||||||
|
id: BaseAlertOrder
|
||||||
order:
|
order:
|
||||||
- category: Health
|
- category: Health
|
||||||
- alertType: Fire
|
- alertType: Fire
|
||||||
@@ -197,35 +198,35 @@
|
|||||||
- type: alert
|
- type: alert
|
||||||
alertType: Debug1
|
alertType: Debug1
|
||||||
icon: /Textures/Interface/Alerts/Human/human1.png
|
icon: /Textures/Interface/Alerts/Human/human1.png
|
||||||
name: Debug
|
name: Debug1
|
||||||
description: Debug
|
description: Debug
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
alertType: Debug2
|
alertType: Debug2
|
||||||
icon: /Textures/Interface/Alerts/Human/human2.png
|
icon: /Textures/Interface/Alerts/Human/human2.png
|
||||||
name: Debug
|
name: Debug2
|
||||||
description: Debug
|
description: Debug
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
alertType: Debug3
|
alertType: Debug3
|
||||||
icon: /Textures/Interface/Alerts/Human/human3.png
|
icon: /Textures/Interface/Alerts/Human/human3.png
|
||||||
name: Debug
|
name: Debug3
|
||||||
description: Debug
|
description: Debug
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
alertType: Debug4
|
alertType: Debug4
|
||||||
icon: /Textures/Interface/Alerts/Human/human4.png
|
icon: /Textures/Interface/Alerts/Human/human4.png
|
||||||
name: Debug
|
name: Debug4
|
||||||
description: Debug
|
description: Debug
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
alertType: Debug5
|
alertType: Debug5
|
||||||
icon: /Textures/Interface/Alerts/Human/human5.png
|
icon: /Textures/Interface/Alerts/Human/human5.png
|
||||||
name: Debug
|
name: Debug5
|
||||||
description: Debug
|
description: Debug
|
||||||
|
|
||||||
- type: alert
|
- type: alert
|
||||||
alertType: Debug6
|
alertType: Debug6
|
||||||
icon: /Textures/Interface/Alerts/Human/human6.png
|
icon: /Textures/Interface/Alerts/Human/human6.png
|
||||||
name: Debug
|
name: Debug6
|
||||||
description: Debug
|
description: Debug
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
- type: crayonDecal
|
- type: crayonDecal
|
||||||
|
id: BaseDecals
|
||||||
spritePath: "Constructible/Misc/crayondecals.rsi"
|
spritePath: "Constructible/Misc/crayondecals.rsi"
|
||||||
decals:
|
decals:
|
||||||
- 0
|
- 0
|
||||||
|
|||||||
Reference in New Issue
Block a user