mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 16:37:48 +01:00
Allow entering custom output FPS number for supported AIs
This commit is contained in:
1
Code/Form1.Designer.cs
generated
1
Code/Form1.Designer.cs
generated
@@ -278,6 +278,7 @@
|
||||
this.fpsOutTbox.ReadOnly = true;
|
||||
this.fpsOutTbox.Size = new System.Drawing.Size(107, 23);
|
||||
this.fpsOutTbox.TabIndex = 9;
|
||||
this.fpsOutTbox.Leave += new System.EventHandler(this.fpsOutTbox_Leave);
|
||||
//
|
||||
// fpsInTbox
|
||||
//
|
||||
|
||||
@@ -466,6 +466,7 @@ namespace Flowframes
|
||||
ConfigParser.SaveComboxIndex(aiCombox);
|
||||
|
||||
interpFactorCombox_SelectedIndexChanged(null, null);
|
||||
fpsOutTbox.ReadOnly = GetAi().factorSupport != AI.FactorSupport.AnyFloat;
|
||||
}
|
||||
|
||||
public void UpdateAiModelCombox()
|
||||
@@ -718,5 +719,18 @@ namespace Flowframes
|
||||
if (initialized)
|
||||
ConfigParser.SaveComboxIndex(outModeCombox);
|
||||
}
|
||||
|
||||
private void fpsOutTbox_Leave(object sender, EventArgs e)
|
||||
{
|
||||
float inFps = fpsInTbox.GetFloat();
|
||||
float outFps = fpsOutTbox.GetFloat();
|
||||
|
||||
var targetFactorRounded = Math.Round((Decimal)(outFps / inFps), 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
interpFactorCombox.Text = $"{targetFactorRounded}";
|
||||
fpsOutTbox.Text = $"{outFps} FPS";
|
||||
|
||||
ValidateFactor();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user