Screen load event for GameplayState (#14316)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Client.UserInterface.Systems.Gameplay;
|
||||
using Content.Shared.CCVar;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
@@ -25,6 +26,14 @@ public sealed class ViewportUIController : UIController
|
||||
_configurationManager.OnValueChanged(CCVars.ViewportMinimumWidth, _ => UpdateViewportRatio());
|
||||
_configurationManager.OnValueChanged(CCVars.ViewportMaximumWidth, _ => UpdateViewportRatio());
|
||||
_configurationManager.OnValueChanged(CCVars.ViewportWidth, _ => UpdateViewportRatio());
|
||||
|
||||
var gameplayStateLoad = UIManager.GetUIController<GameplayStateLoadController>();
|
||||
gameplayStateLoad.OnScreenLoad += OnScreenLoad;
|
||||
}
|
||||
|
||||
private void OnScreenLoad()
|
||||
{
|
||||
ReloadViewport();
|
||||
}
|
||||
|
||||
private void UpdateViewportRatio()
|
||||
|
||||
Reference in New Issue
Block a user