refactor: pull out constant
This commit is contained in:
parent
25d156c20f
commit
ff5d3100be
|
@ -16,6 +16,7 @@ internal class PluginUi : IDisposable {
|
|||
|
||||
internal bool Visible;
|
||||
|
||||
private const int RefreshSeconds = 5;
|
||||
private readonly Stopwatch _metaUpdate = Stopwatch.StartNew();
|
||||
|
||||
internal PluginUi(Plugin plugin) {
|
||||
|
@ -47,7 +48,7 @@ internal class PluginUi : IDisposable {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this._metaUpdate.Elapsed >= TimeSpan.FromSeconds(5)) {
|
||||
if (this._metaUpdate.Elapsed >= TimeSpan.FromSeconds(RefreshSeconds)) {
|
||||
this.Metadata = ScreenshotMetadata.Capture(this.Plugin);
|
||||
|
||||
this._metaUpdate.Restart();
|
||||
|
@ -113,7 +114,7 @@ internal class PluginUi : IDisposable {
|
|||
}
|
||||
|
||||
ImGui.ProgressBar(
|
||||
(float) (TimeSpan.FromSeconds(5) - this._metaUpdate.Elapsed).TotalSeconds / 5,
|
||||
(float) (TimeSpan.FromSeconds(RefreshSeconds) - this._metaUpdate.Elapsed).TotalSeconds / RefreshSeconds,
|
||||
new Vector2(-1, 1)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue