Content PR for YAML hot reloading (#3319)
* Content PR for YAML hot reloading * Add CanAdminReloadPrototypes (host permission) * IndexedPrototype fixes
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Content.Shared.GameObjects.Components.Body.Preset
|
||||
/// </summary>
|
||||
[Prototype("bodyPreset")]
|
||||
[Serializable, NetSerializable]
|
||||
public class BodyPresetPrototype : IPrototype, IIndexedPrototype
|
||||
public class BodyPresetPrototype : IPrototype
|
||||
{
|
||||
private string _id;
|
||||
private string _name;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Shared.GameObjects.Components.Body.Template
|
||||
/// </summary>
|
||||
[Prototype("bodyTemplate")]
|
||||
[Serializable, NetSerializable]
|
||||
public class BodyTemplatePrototype : IPrototype, IIndexedPrototype
|
||||
public class BodyTemplatePrototype : IPrototype
|
||||
{
|
||||
private string _id;
|
||||
private string _name;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry.ReagentDispenser
|
||||
/// machines define their inventory.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable, Prototype("reagentDispenserInventory")]
|
||||
public class ReagentDispenserInventoryPrototype : IPrototype, IIndexedPrototype
|
||||
public class ReagentDispenserInventoryPrototype : IPrototype
|
||||
{
|
||||
private string _id;
|
||||
private List<string> _inventory;
|
||||
|
||||
@@ -73,6 +73,8 @@ namespace Content.Shared.GameObjects.Components
|
||||
[Serializable, NetSerializable, Prototype("crayonDecal")]
|
||||
public class CrayonDecalPrototype : IPrototype
|
||||
{
|
||||
public string ID { get; private set; }
|
||||
|
||||
private string _spritePath;
|
||||
public string SpritePath => _spritePath;
|
||||
|
||||
@@ -83,6 +85,7 @@ namespace Content.Shared.GameObjects.Components
|
||||
{
|
||||
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||
|
||||
serializer.DataField(this, x => x.ID, "id", string.Empty);
|
||||
serializer.DataField(ref _spritePath, "spritePath", "");
|
||||
serializer.DataField(ref _decals, "decals", new List<string>());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using YamlDotNet.RepresentationModel;
|
||||
namespace Content.Shared.GameObjects.Components.Weapons.Melee
|
||||
{
|
||||
[Prototype("MeleeWeaponAnimation")]
|
||||
public sealed class MeleeWeaponAnimationPrototype : IPrototype, IIndexedPrototype
|
||||
public sealed class MeleeWeaponAnimationPrototype : IPrototype
|
||||
{
|
||||
private string _prototype;
|
||||
private string _state;
|
||||
@@ -19,7 +19,7 @@ namespace Content.Shared.GameObjects.Components.Weapons.Melee
|
||||
private float _speed;
|
||||
private float _width;
|
||||
private WeaponArcType _arcType;
|
||||
|
||||
|
||||
[ViewVariables] public string ID => _id;
|
||||
[ViewVariables] public string State => _state;
|
||||
[ViewVariables] public string Prototype => _prototype;
|
||||
|
||||
Reference in New Issue
Block a user