@@ -36,6 +36,8 @@ public partial class formSettings : Form
3636 bool varLfz = false ;
3737 private formEditorToml formEditor ;
3838 private mainForm mainFormInstance ;
39+ public System . Windows . Forms . TextBox fpsLimitTextBox ;
40+ public System . Windows . Forms . Label labelFpsLimit ;
3941
4042 public formSettings ( )
4143 {
@@ -45,6 +47,7 @@ public formSettings()
4547 AddOptionsSelect . ItemCheck += new ItemCheckEventHandler ( AddOptionsSelect_ItemCheck ) ;
4648 listMods . SelectedIndexChanged += listMods_SelectedIndexChanged ;
4749 this . Resize += new EventHandler ( formSettings_Resize ) ;
50+ TextBoxFpsLimit ( ) ;
4851 SubMenuClose ( ) ;
4952 }
5053
@@ -270,8 +273,8 @@ public void ClearListMods()
270273 { "0.10.1" , new string [ ] { "mods\\ FSR2FSR3_0.10.1\\ FSR2FSR3_COMMON" ,
271274 "mods\\ FSR2FSR3_0.10.1\\ Red Dead Redemption 2" } } ,
272275
273- { "0.10.1h1" , new string [ ] { "mods\\ FSR2FSR3_0.10.1h1\\ 0.10.1h1 \\ FSR2FSR3_COMMON" ,
274- "mods\\ FSR2FSR3_0.10.1h1\\ 0.10.1h1 \\ Red Dead Redemption 2" } } ,
276+ { "0.10.1h1" , new string [ ] { "mods\\ FSR2FSR3_0.10.1h1\\ FSR2FSR3_COMMON" ,
277+ "mods\\ FSR2FSR3_0.10.1h1\\ Red Dead Redemption 2" } } ,
275278
276279 { "0.10.2h1" , new string [ ] { "mods\\ FSR2FSR3_0.10.2h1\\ FSR2FSR3_COMMON" ,
277280 "mods\\ FSR2FSR3_0.10.2h1\\ Red Dead Redemption 2" } } ,
@@ -400,6 +403,50 @@ public void DeselectAddOpt()
400403 AddOptionsSelect . SetItemCheckState ( 0 , CheckState . Unchecked ) ;
401404 }
402405
406+ public void TextBoxFpsLimit ( )
407+ {
408+ fpsLimitTextBox = new System . Windows . Forms . TextBox ( ) ;
409+ fpsLimitTextBox . Location = new System . Drawing . Point ( 475 , 100 ) ;
410+ fpsLimitTextBox . Size = new System . Drawing . Size ( 25 , 25 ) ;
411+ panel1 . Controls . Add ( fpsLimitTextBox ) ;
412+ fpsLimitTextBox . BringToFront ( ) ;
413+ fpsLimitTextBox . Visible = false ;
414+
415+ labelFpsLimit = new System . Windows . Forms . Label ( ) ;
416+ labelFpsLimit . Location = new System . Drawing . Point ( 406 , 100 ) ;
417+ labelFpsLimit . Size = new System . Drawing . Size ( 125 , 20 ) ;
418+ labelFpsLimit . Text = "Fps Limit" ;
419+ labelFpsLimit . Font = new Font ( "Segoe UI Semibold" , 11.25f , FontStyle . Bold ) ;
420+ labelFpsLimit . ForeColor = Color . White ; ;
421+ panel1 . Controls . Add ( labelFpsLimit ) ;
422+ labelFpsLimit . BringToFront ( ) ;
423+ labelFpsLimit . Visible = false ;
424+
425+ fpsLimitTextBox . KeyPress += textBoxFps_KeyPress ;
426+ fpsLimitTextBox . TextChanged += textBoxFps_TextChanged ;
427+ }
428+ private void textBoxFps_KeyPress ( object sender , KeyPressEventArgs e )
429+ {
430+ if ( ! char . IsControl ( e . KeyChar ) && ! char . IsDigit ( e . KeyChar ) )
431+ {
432+ e . Handled = true ;
433+ }
434+ if ( fpsLimitTextBox . Text . Length >= 3 && e . KeyChar != '\b ' )
435+ {
436+ e . Handled = true ;
437+ }
438+ }
439+ private void textBoxFps_TextChanged ( object sender , EventArgs e )
440+ {
441+ fpsLimit ( ) ;
442+ }
443+ public void fpsLimit ( )
444+ {
445+ if ( fpsLimitTextBox . Text . ToString ( ) != null )
446+ {
447+ ConfigIni ( "original_frame_rate_limit" , fpsLimitTextBox . Text . ToString ( ) , uniscaler_path , "general" ) ;
448+ }
449+ }
403450 private void AddOptionsSelect_ItemCheck ( object ? sender , ItemCheckEventArgs e )
404451 {
405452
@@ -518,6 +565,33 @@ void ConfigureMod(string configKey, string modVersionMessage, Dictionary<string,
518565 {
519566 ConfigureMod ( "disable_console" , "Select a mod version starting from 0.10.3." , folder_disable_console , "logging" ) ;
520567 }
568+
569+ if ( itemText == "Fps Limit" )
570+ {
571+ if ( select_mod != null && uniscaler_path . ContainsKey ( select_mod ) )
572+ {
573+ if ( fpsLimitTextBox != null )
574+ {
575+ if ( e . NewValue == CheckState . Checked )
576+ {
577+ fpsLimitTextBox . Visible = true ;
578+ labelFpsLimit . Visible = true ;
579+ AddOptionsSelect . Size = new Size ( 275 , 44 ) ;
580+ }
581+ else if ( e . NewValue == CheckState . Unchecked )
582+ {
583+ fpsLimitTextBox . Visible = false ;
584+ labelFpsLimit . Visible = false ;
585+ AddOptionsSelect . Size = new Size ( 275 , 66 ) ;
586+ }
587+ }
588+ }
589+ else
590+ {
591+ ShowErrorMessage ( "Select a Uniscaler option to proceed." ) ;
592+ return ;
593+ }
594+ }
521595 if ( itemText == "Install lfz.sl.dlss" )
522596 {
523597 if ( CheckedOption is true )
@@ -691,11 +765,9 @@ public static async Task CopyModsAsync(string sourcePath, string destPath)
691765
692766 public async Task CopyFSR ( Dictionary < string , string [ ] > DictionaryFSR )
693767 {
694- string path_mods = path_fsr ;
695768 string path_dest = select_Folder ;
696769 string exeDirectory = AppDomain . CurrentDomain . BaseDirectory ;
697770 string selectedVersion = listMods . SelectedItem as string ;
698- string varDici ;
699771 string [ ] uniscalerVersion = { "Uniscaler" , "Uniscaler + Xess + Dlss" , "Uniscaler V2" } ;
700772
701773 if ( selectedVersion != null )
@@ -705,7 +777,9 @@ public async Task CopyFSR(Dictionary<string, string[]> DictionaryFSR)
705777 foreach ( string relativePath in paths )
706778 {
707779 string path_final = Path . GetFullPath ( Path . Combine ( exeDirectory , relativePath ) ) ;
708- string path_fsr_common = Path . GetFullPath ( Path . Combine ( exeDirectory , "mods\\ FSR2_FSR3_COMMON_GLOBAL" ) ) ;
780+ string path_fsr_initial = ( path_final + "\\ ..\\ .." ) + "\\ FSR2FSR3_COMMON" ;
781+ string path_fsr_common = Path . GetFullPath ( path_fsr_initial ) ;
782+ Debug . WriteLine ( path_fsr_common ) ;
709783 if ( Directory . Exists ( path_final ) )
710784 {
711785 await CopyModsAsync ( path_final , path_dest ) ;
@@ -822,7 +896,32 @@ public void fsr_rdr2()
822896 {
823897 CopyFSR ( origins_rdr2_folder ) ;
824898 }
899+ public void ac_valhalla_dlss ( )
900+ {
901+ #region Copy Ac Valhalla DLSS
902+ string dlss_valhalla = "mods\\ Ac_Valhalla_DLSS" ;
903+
904+ foreach ( string files_fsr in Directory . GetFiles ( dlss_valhalla ) )
905+ {
906+ string fileName = Path . GetFileName ( files_fsr ) ;
907+ File . Copy ( files_fsr , select_Folder + "\\ " + fileName , true ) ;
908+ }
909+ foreach ( var subPath in Directory . GetDirectories ( dlss_valhalla , "*" , SearchOption . AllDirectories ) )
910+ {
911+ string relativePath = subPath . Substring ( dlss_valhalla . Length + 1 ) ;
912+ string fullPath = Path . Combine ( select_Folder , relativePath ) ;
825913
914+ Directory . CreateDirectory ( fullPath ) ;
915+
916+ foreach ( string filePath in Directory . GetFiles ( subPath ) )
917+ {
918+ string relativeFilePath = filePath . Substring ( subPath . Length + 1 ) ;
919+ string destFilePath = Path . Combine ( fullPath , relativeFilePath ) ;
920+ File . Copy ( filePath , destFilePath , true ) ;
921+ }
922+ }
923+ #endregion;
924+ }
826925 public async Task fsr_rdr2_build02 ( )
827926 {
828927
@@ -1017,6 +1116,10 @@ private void button2_Click(object sender, EventArgs e)
10171116 {
10181117 aw2_fsr3 ( ) ;
10191118 }
1119+ if ( select_mod == "Ac Valhalla Dlss (Only RTX)" )
1120+ {
1121+ ac_valhalla_dlss ( ) ;
1122+ }
10201123
10211124 select_mod = listMods . SelectedItem as string ;
10221125
0 commit comments