Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Game Pass to Xbox and update related references #442

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ BoilR can import games from many platforms, but there are limits based
| [Bottles](https://usebottles.com/) | No | Yes | Yes |
| [MiniGalaxy](https://sharkwouter.github.io/minigalaxy/) | No | Yes | Yes |
| [Playnite](https://playnite.link/) | Yes | No | No |
| [Game Pass](https://www.xbox.com/en-US/xbox-game-pass) | Yes | No | No |
| [Xbox](https://www.xbox.com/en-US/) | Yes | No | No |

## Getting cover art for your shortcuts

Expand Down
2 changes: 1 addition & 1 deletion src/platforms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod amazon;
mod playnite;

#[cfg(not(target_family = "unix"))]
mod gamepass;
mod xbox;



Expand Down
6 changes: 3 additions & 3 deletions src/platforms/platforms_load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const PLATFORM_NAMES: [&str; 14] = [
"uplay",
"minigalaxy",
"playnite",
"gamepass"
"xbox"
];

pub type Platforms = Vec<Box<dyn GamesPlatform>>;
Expand All @@ -35,11 +35,11 @@ pub fn load_platform<A: AsRef<str>, B: AsRef<str>>(
//Windows only platforms
use super::amazon::AmazonPlatform;
use super::playnite::PlaynitePlatform;
use super::gamepass::GamePassPlatForm;
use super::xbox::XboxPlatform;
match name {
"amazon" => return load::<AmazonPlatform>(s),
"playnite" => return load::<PlaynitePlatform>(s),
"gamepass" => return load::<GamePassPlatForm>(s),
"xbox" => return load::<XboxPlatform>(s),
_ => {}
}
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ use steam_shortcuts_util::Shortcut;
use crate::platforms::ShortcutToImport;

#[derive(Clone, Deserialize, Default)]
pub struct GamePassPlatForm {
settings: GamePassSettings,
pub struct XboxPlatform {
settings: XboxSettings,
}

#[derive(Serialize, Deserialize, Default, Clone)]
pub struct GamePassSettings {
pub struct XboxSettings {
enabled: bool,
}

impl GamesPlatform for GamePassPlatForm {
impl GamesPlatform for XboxPlatform {
fn name(&self) -> &str {
"Game Pass"
"Xbox"
}

fn code_name(&self) -> &str {
"gamepass"
"xbox"
}

fn enabled(&self) -> bool {
self.settings.enabled
}

fn get_shortcut_info(&self) -> eyre::Result<Vec<crate::platforms::ShortcutToImport>> {
let command = include_str!("./game_pass_games.ps1");
let command = include_str!("./xbox_games.ps1");
let res = run_powershell_command(command)?;
let apps: Vec<AppInfo> = serde_json::from_str(&res)?;
let windows_dir = std::env::var("WinDir").unwrap_or("C:\\Windows".to_string());
Expand Down Expand Up @@ -82,8 +82,8 @@ impl GamesPlatform for GamePassPlatForm {
}

fn render_ui(&mut self, ui: &mut egui::Ui) {
ui.heading("Game Pass");
ui.checkbox(&mut self.settings.enabled, "Import from Game Pass");
ui.heading("Xbox");
ui.checkbox(&mut self.settings.enabled, "Import from Xbox");
}
}

Expand Down Expand Up @@ -181,9 +181,9 @@ fn run_powershell_command(cmd: &str) -> Result<String, Error> {
}
}

impl FromSettingsString for GamePassPlatForm {
impl FromSettingsString for XboxPlatform {
fn from_settings_string<S: AsRef<str>>(s: S) -> Self {
GamePassPlatForm {
XboxPlatform {
settings: load_settings(s),
}
}
Expand Down
Loading