Unified those messy FrameEventArgs.
This commit is contained in:
@@ -13,6 +13,7 @@ using Robust.Shared.Interfaces.Network;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Client.Chat
|
namespace Content.Client.Chat
|
||||||
@@ -90,7 +91,7 @@ namespace Content.Client.Chat
|
|||||||
_speechBubbleRoot.SetPositionFirst();
|
_speechBubbleRoot.SetPositionFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FrameUpdate(RenderFrameEventArgs delta)
|
public void FrameUpdate(FrameEventArgs delta)
|
||||||
{
|
{
|
||||||
// Update queued speech bubbles.
|
// Update queued speech bubbles.
|
||||||
if (_queuedSpeechBubbles.Count == 0)
|
if (_queuedSpeechBubbles.Count == 0)
|
||||||
@@ -106,7 +107,7 @@ namespace Content.Client.Chat
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
queueData.TimeLeft -= delta.Elapsed;
|
queueData.TimeLeft -= delta.DeltaSeconds;
|
||||||
if (queueData.TimeLeft > 0)
|
if (queueData.TimeLeft > 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Robust.Client.UserInterface.Controls;
|
|||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Timers;
|
using Robust.Shared.Timers;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Client.Chat
|
namespace Content.Client.Chat
|
||||||
{
|
{
|
||||||
@@ -73,11 +74,11 @@ namespace Content.Client.Chat
|
|||||||
_verticalOffsetAchieved = -ContentHeight;
|
_verticalOffsetAchieved = -ContentHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void FrameUpdate(RenderFrameEventArgs args)
|
protected override void FrameUpdate(FrameEventArgs args)
|
||||||
{
|
{
|
||||||
base.FrameUpdate(args);
|
base.FrameUpdate(args);
|
||||||
|
|
||||||
_timeLeft -= args.Elapsed;
|
_timeLeft -= args.DeltaSeconds;
|
||||||
|
|
||||||
if (_timeLeft <= FadeTime)
|
if (_timeLeft <= FadeTime)
|
||||||
{
|
{
|
||||||
@@ -99,7 +100,7 @@ namespace Content.Client.Chat
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_verticalOffsetAchieved = FloatMath.Lerp(_verticalOffsetAchieved, VerticalOffset, 10 * args.Elapsed);
|
_verticalOffsetAchieved = FloatMath.Lerp(_verticalOffsetAchieved, VerticalOffset, 10 * args.DeltaSeconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
var worldPos = _senderEntity.Transform.WorldPosition;
|
var worldPos = _senderEntity.Transform.WorldPosition;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using Robust.Shared.Interfaces.Network;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Client
|
namespace Content.Client
|
||||||
@@ -69,7 +70,7 @@ namespace Content.Client
|
|||||||
PopupMessage(new ScreenCoordinates(_inputManager.MouseScreenPosition), message);
|
PopupMessage(new ScreenCoordinates(_inputManager.MouseScreenPosition), message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FrameUpdate(RenderFrameEventArgs eventArgs)
|
public void FrameUpdate(FrameEventArgs eventArgs)
|
||||||
{
|
{
|
||||||
foreach (var label in _aliveLabels)
|
foreach (var label in _aliveLabels)
|
||||||
{
|
{
|
||||||
@@ -94,9 +95,9 @@ namespace Content.Client
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(RenderFrameEventArgs eventArgs)
|
public void Update(FrameEventArgs eventArgs)
|
||||||
{
|
{
|
||||||
_timeLeft += eventArgs.Elapsed;
|
_timeLeft += eventArgs.DeltaSeconds;
|
||||||
Position = InitialPos - new Vector2(0, 20 * (_timeLeft * _timeLeft + _timeLeft));
|
Position = InitialPos - new Vector2(0, 20 * (_timeLeft * _timeLeft + _timeLeft));
|
||||||
if (_timeLeft > 0.5f)
|
if (_timeLeft > 0.5f)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using Robust.Shared.ContentPack;
|
|||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Client
|
namespace Content.Client
|
||||||
{
|
{
|
||||||
@@ -176,17 +177,16 @@ namespace Content.Client
|
|||||||
IoCManager.Resolve<IChatManager>().Initialize();
|
IoCManager.Resolve<IChatManager>().Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(ModUpdateLevel level, float frameTime)
|
public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs)
|
||||||
{
|
{
|
||||||
base.Update(level, frameTime);
|
base.Update(level, frameEventArgs);
|
||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
case ModUpdateLevel.FramePreEngine:
|
case ModUpdateLevel.FramePreEngine:
|
||||||
var renderFrameEventArgs = new RenderFrameEventArgs(frameTime);
|
IoCManager.Resolve<IClientNotifyManager>().FrameUpdate(frameEventArgs);
|
||||||
IoCManager.Resolve<IClientNotifyManager>().FrameUpdate(renderFrameEventArgs);
|
IoCManager.Resolve<IClientGameTicker>().FrameUpdate(frameEventArgs);
|
||||||
IoCManager.Resolve<IClientGameTicker>().FrameUpdate(renderFrameEventArgs);
|
IoCManager.Resolve<IChatManager>().FrameUpdate(frameEventArgs);
|
||||||
IoCManager.Resolve<IChatManager>().FrameUpdate(renderFrameEventArgs);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using Robust.Shared.Input;
|
|||||||
using Robust.Shared.Interfaces.Network;
|
using Robust.Shared.Interfaces.Network;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ namespace Content.Client.GameTicking
|
|||||||
_gameHud.RootControl.Orphan();
|
_gameHud.RootControl.Orphan();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FrameUpdate(RenderFrameEventArgs renderFrameEventArgs)
|
public void FrameUpdate(FrameEventArgs FrameEventArgs)
|
||||||
{
|
{
|
||||||
if (_lobby == null)
|
if (_lobby == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Content.Client.Chat;
|
using Content.Client.Chat;
|
||||||
using Robust.Client;
|
using Robust.Client;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Client.Interfaces.Chat
|
namespace Content.Client.Interfaces.Chat
|
||||||
{
|
{
|
||||||
@@ -8,7 +9,7 @@ namespace Content.Client.Interfaces.Chat
|
|||||||
{
|
{
|
||||||
void Initialize();
|
void Initialize();
|
||||||
|
|
||||||
void FrameUpdate(RenderFrameEventArgs delta);
|
void FrameUpdate(FrameEventArgs delta);
|
||||||
|
|
||||||
void SetChatBox(ChatBox chatBox);
|
void SetChatBox(ChatBox chatBox);
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
using Content.Client.UserInterface;
|
using Content.Client.UserInterface;
|
||||||
using Robust.Client;
|
using Robust.Client;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Client.Interfaces
|
namespace Content.Client.Interfaces
|
||||||
{
|
{
|
||||||
public interface IClientGameTicker
|
public interface IClientGameTicker
|
||||||
{
|
{
|
||||||
void Initialize();
|
void Initialize();
|
||||||
void FrameUpdate(RenderFrameEventArgs renderFrameEventArgs);
|
void FrameUpdate(FrameEventArgs FrameEventArgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Content.Shared.Interfaces;
|
using Content.Shared.Interfaces;
|
||||||
using Robust.Client;
|
using Robust.Client;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Client.Interfaces
|
namespace Content.Client.Interfaces
|
||||||
{
|
{
|
||||||
@@ -9,6 +10,6 @@ namespace Content.Client.Interfaces
|
|||||||
void Initialize();
|
void Initialize();
|
||||||
void PopupMessage(ScreenCoordinates coordinates, string message);
|
void PopupMessage(ScreenCoordinates coordinates, string message);
|
||||||
void PopupMessage(string message);
|
void PopupMessage(string message);
|
||||||
void FrameUpdate(RenderFrameEventArgs eventArgs);
|
void FrameUpdate(FrameEventArgs eventArgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ namespace Content.Server
|
|||||||
_gameTicker.Initialize();
|
_gameTicker.Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(ModUpdateLevel level, float frameTime)
|
public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs)
|
||||||
{
|
{
|
||||||
base.Update(level, frameTime);
|
base.Update(level, frameEventArgs);
|
||||||
|
|
||||||
_gameTicker.Update(new FrameEventArgs(frameTime));
|
_gameTicker.Update(frameEventArgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule RobustToolbox updated: be0c520455...0a41ef3c9a
Reference in New Issue
Block a user