Allow entering custom output FPS number for supported AIs

This commit is contained in:
n00mkrad
2022-04-20 05:37:22 +02:00
parent 62944cdb48
commit c6baa2775f
2 changed files with 15 additions and 0 deletions

View File

@@ -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
//

View File

@@ -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();
}
}
}