diff --git a/assets/locales/en/main.ftl b/assets/locales/en/main.ftl index 0c152ac..ec02169 100644 --- a/assets/locales/en/main.ftl +++ b/assets/locales/en/main.ftl @@ -1,5 +1,6 @@ custom = Custom none = None +default = Default @@ -58,4 +59,20 @@ enabled = Enabled fps-unlocker-description = Remove frames rendering limitation by modifying the game's memory. Can be detected by the anti-cheat power-saving = Power saving -power-saving-description = Automatically set the FPS limit to 10 and low process priority upon losing focus to the game (e.g. tabbing out) \ No newline at end of file +power-saving-description = Automatically set the FPS limit to 10 and low process priority upon losing focus to the game (e.g. tabbing out) + +monitor = Monitor +monitor-description = Number of monitor you want to run the game on + +window-mode = Window Mode +popup = Popup +fullscreen = Fullscreen + +priority = Priority +priority-description = Game process priority +realtime = Realtime +high = High +above-normal = Above Normal +normal = Normal +below-normal = Below Normal +low = Low diff --git a/assets/locales/ru/main.ftl b/assets/locales/ru/main.ftl index d4d4c3c..934a30d 100644 --- a/assets/locales/ru/main.ftl +++ b/assets/locales/ru/main.ftl @@ -1,5 +1,6 @@ custom = Свое значение none = Нет +default = По умолчанию @@ -58,4 +59,20 @@ enabled = Включен fps-unlocker-description = Убрать ограничение количества кадров модифицируя память игры. Может быть обнаружено античитом power-saving = Энергосбережение -power-saving-description = Автоматически устанавливать предел количества кадров до 10 и снижать приоритет процесса игры когда она не находится в фокусе \ No newline at end of file +power-saving-description = Автоматически устанавливать предел количества кадров до 10 и снижать приоритет процесса игры когда она не находится в фокусе + +monitor = Монитор +monitor-description = Номер монитора, на котором стоит запустить игру + +window-mode = Режим окна +popup = Всплывающий +fullscreen = Полноэкранный + +priority = Приоритет +priority-description = Приоритет процесса игры +realtime = Реального времени +high = Высокий +above-normal = Выше среднего +normal = Средний +below-normal = Ниже среднего +low = Низкий diff --git a/src/ui/preferences/enhancements.rs b/src/ui/preferences/enhancements.rs index 7d43d4f..c1a551e 100644 --- a/src/ui/preferences/enhancements.rs +++ b/src/ui/preferences/enhancements.rs @@ -318,7 +318,79 @@ impl WidgetTemplate for Enhancements { } } } - } + }, + + adw::ActionRow { + set_title: &tr("monitor"), + set_subtitle: &tr("monitor-description"), + + add_suffix = >k::SpinButton { + set_valign: gtk::Align::Center, + set_adjustment: >k::Adjustment::new(1.0, 1.0, 10.0, 1.0, 1.0, 0.0), + + set_value: CONFIG.game.enhancements.fps_unlocker.config.monitor as f64, + + connect_changed => move |row| { + if is_ready() { + if let Ok(mut config) = config::get() { + config.game.enhancements.fps_unlocker.config.monitor = row.value() as u64; + + config::update(config); + } + } + } + } + }, + + adw::ComboRow { + set_title: &tr("window-mode"), + + #[wrap(Some)] + set_model = >k::StringList::new(&[ + &tr("default"), + &tr("popup"), + &tr("fullscreen") + ]), + + set_selected: CONFIG.game.enhancements.fps_unlocker.config.window_mode.into(), + + connect_selected_notify => move |row| { + if is_ready() { + if let Ok(mut config) = config::get() { + config.game.enhancements.fps_unlocker.config.window_mode = WindowMode::try_from(row.selected()).unwrap(); + + config::update(config); + } + } + } + }, + + adw::ComboRow { + set_title: &tr("priority"), + set_subtitle: &tr("priority-description"), + + #[wrap(Some)] + set_model = >k::StringList::new(&[ + &tr("realtime"), + &tr("high"), + &tr("above-normal"), + &tr("normal"), + &tr("below-normal"), + &tr("low") + ]), + + set_selected: CONFIG.game.enhancements.fps_unlocker.config.priority as u32, + + connect_selected_notify => move |row| { + if is_ready() { + if let Ok(mut config) = config::get() { + config.game.enhancements.fps_unlocker.config.priority = row.selected() as u64; + + config::update(config); + } + } + } + }, } } }