Make PauseTime a DataField (#3863)

This commit is contained in:
Leon Friedrich
2023-03-24 19:00:25 +13:00
committed by GitHub
parent 0b3a4821fa
commit 124c627fe2
3 changed files with 9 additions and 4 deletions

View File

@@ -43,7 +43,8 @@ END TEMPLATE-->
### Bugfixes
*None yet*
* `MetaDataComponent.PauseTime` is now a yaml data-field
* The client-side `(un)pausemap` command is now disabled while connected to a server.
### Other

View File

@@ -8,6 +8,7 @@ using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
using System;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Robust.Shared.GameObjects
{
@@ -66,7 +67,8 @@ namespace Robust.Shared.GameObjects
/// <summary>
/// When this entity was paused, if applicable
/// </summary>
internal TimeSpan? PauseTime;
[DataField("pauseTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan? PauseTime { get; internal set; }
// Every entity starts at tick 1, because they are conceptually created in the time between 0->1
[ViewVariables]

View File

@@ -176,7 +176,8 @@ namespace Robust.Shared.Map
}
SetMapPaused(mapId, true);
});
},
requireServerOrSingleplayer: true);
_conhost.RegisterCommand("querymappaused",
"Check whether a map is paused or not.",
@@ -214,7 +215,8 @@ namespace Robust.Shared.Map
}
SetMapPaused(mapId, false);
});
},
requireServerOrSingleplayer: true);
}
}
}