Skip to content

Commit 4bb50b4

Browse files
authored
Merge pull request #16 from thepeacockproject/feat/launcher-enhancements
2 parents 95ded69 + 7276870 commit 4bb50b4

9 files changed

Lines changed: 671 additions & 32 deletions

File tree

launcher/src/app.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::core::config::Config;
66
use crate::core::game_detect::GameInstall;
77
use crate::core::migration::LegacyInstall;
88
use crate::core::node::NodeStatus;
9+
use crate::core::options::PeacockOption;
910
use crate::core::peacock::PeacockStatus;
1011
use crate::core::service::ServiceStatus;
1112

@@ -17,6 +18,7 @@ pub enum Screen {
1718
Service,
1819
Sdk,
1920
Settings,
21+
Options,
2022
Migration,
2123
}
2224

@@ -105,6 +107,11 @@ pub struct App {
105107
pub settings_editing: bool,
106108
pub settings_message: Option<String>,
107109

110+
// Options screen state
111+
pub options: Vec<PeacockOption>,
112+
pub options_index: usize,
113+
pub options_message: Option<String>,
114+
108115
// Migration screen state
109116
pub migration_mode: MigrationMode,
110117
pub migration_source_index: usize,
@@ -135,6 +142,7 @@ pub enum MenuAction {
135142
Service,
136143
Sdk,
137144
Settings,
145+
Options,
138146
Migration,
139147
Quit,
140148
}
@@ -183,6 +191,10 @@ impl App {
183191
settings_editing: false,
184192
settings_message: None,
185193

194+
options: Vec::new(),
195+
options_index: 0,
196+
options_message: None,
197+
186198
migration_mode: MigrationMode::SelectSource,
187199
migration_source_index: 0,
188200
migration_step: 0,
@@ -232,6 +244,11 @@ impl App {
232244
action: MenuAction::Settings,
233245
enabled: true,
234246
},
247+
MenuItem {
248+
label: "Peacock Options".into(),
249+
action: MenuAction::Options,
250+
enabled: self.config.is_peacock_installed(),
251+
},
235252
];
236253

237254
if self.legacy_install.is_some() {
@@ -373,6 +390,11 @@ impl App {
373390
self.settings_message = None;
374391
self.settings_field = SettingsField::InstallDir;
375392
}
393+
Screen::Options => {
394+
self.options = crate::core::options::load_options(&self.config.peacock_dir());
395+
self.options_index = 0;
396+
self.options_message = None;
397+
}
376398
Screen::Migration => {
377399
self.migration_mode = MigrationMode::SelectSource;
378400
self.migration_source_index = 0;

launcher/src/core/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ impl Config {
8080
}
8181

8282
/// `{install_dir}/Peacock/userdata/`
83+
#[allow(dead_code)]
8384
pub fn peacock_userdata_dir(&self) -> PathBuf {
8485
self.peacock_dir().join("userdata")
8586
}
8687

8788
/// `{install_dir}/Peacock/plugins/`
89+
#[allow(dead_code)]
8890
pub fn peacock_plugins_dir(&self) -> PathBuf {
8991
self.peacock_dir().join("plugins")
9092
}

launcher/src/core/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pub mod download;
33
pub mod game_detect;
44
pub mod migration;
55
pub mod node;
6+
pub mod options;
67
pub mod peacock;
78
pub mod sdk;
89
pub mod service;

0 commit comments

Comments
 (0)