Skip to content

Commit

Permalink
0.3.1 (#102)
Browse files Browse the repository at this point in the history
Find installed games from GOG Galaxy and Epic Games Store. The important
modding-related stuff works, but there are still a few features missing
for games found from these providers, to come later.
  • Loading branch information
Raicuparta authored Dec 30, 2023
2 parents feff2b7 + 2616415 commit 501d8be
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 146 deletions.
2 changes: 1 addition & 1 deletion backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rai-pal"
version = "0.3.0"
version = "0.3.1"
authors = ["Raicuparta"]
license = "GPL-3.0-or-later"
repository = "https://github.com/Raicuparta/rai-pal"
Expand Down
130 changes: 0 additions & 130 deletions backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,135 +478,6 @@ async fn frontend_ready() -> Result {
Ok(())
}

#[tauri::command]
#[specta::specta]
async fn get_other_games() -> Result<HashMap<String, Vec<String>>> {
let games = HashMap::from([
(
"Epic".to_string(),
game_scanner::epicgames::games()
.unwrap_or_default()
.iter()
.map(|game| {
format!(
"{}: {}. {} ({})",
game.id,
game.name,
if game.state.installed {
"installed"
} else {
"owned"
},
game.path.clone().unwrap_or_default().to_string_lossy()
)
})
.collect(),
),
(
"GOG".to_string(),
game_scanner::gog::games()
.unwrap_or_default()
.iter()
.map(|game| {
format!(
"{}: {}. {} ({})",
game.id,
game.name,
if game.state.installed {
"installed"
} else {
"owned"
},
game.path.clone().unwrap_or_default().to_string_lossy()
)
})
.collect(),
),
(
"Origin".to_string(),
game_scanner::origin::games()
.unwrap_or_default()
.iter()
.map(|game| {
format!(
"{}: {}. {} ({})",
game.id,
game.name,
if game.state.installed {
"installed"
} else {
"owned"
},
game.path.clone().unwrap_or_default().to_string_lossy()
)
})
.collect(),
),
(
"Ubisoft".to_string(),
game_scanner::ubisoft::games()
.unwrap_or_default()
.iter()
.map(|game| {
format!(
"{}: {}. {} ({})",
game.id,
game.name,
if game.state.installed {
"installed"
} else {
"owned"
},
game.path.clone().unwrap_or_default().to_string_lossy()
)
})
.collect(),
),
(
"Amazon".to_string(),
game_scanner::amazon::games()
.unwrap_or_default()
.iter()
.map(|game| {
format!(
"{}: {}. {} ({})",
game.id,
game.name,
if game.state.installed {
"installed"
} else {
"owned"
},
game.path.clone().unwrap_or_default().to_string_lossy()
)
})
.collect(),
),
(
"Steam".to_string(),
game_scanner::steam::games()
.unwrap_or_default()
.iter()
.map(|game| {
format!(
"{}: {}. {} ({})",
game.id,
game.name,
if game.state.installed {
"installed"
} else {
"owned"
},
game.path.clone().unwrap_or_default().to_string_lossy()
)
})
.collect(),
),
]);

Ok(games)
}

#[tauri::command]
#[specta::specta]
async fn dummy_command() -> Result<(InstalledGame, AppEvent)> {
Expand Down Expand Up @@ -684,7 +555,6 @@ fn main() {
get_remote_mods,
open_mod_loader_folder,
refresh_game,
get_other_games,
]
);

Expand Down
4 changes: 0 additions & 4 deletions frontend/api/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ export function refreshGame(gameId: string) {
return invoke()<null>("refresh_game", { gameId })
}

export function getOtherGames() {
return invoke()<{ [key: string]: string[] }>("get_other_games")
}

export type GameEngineVersion = { major: number; minor: number; patch: number; suffix: string | null; display: string }
export type GameEngineBrand = "Unity" | "Unreal" | "Godot"
export type GameMode = "VR" | "Flat"
Expand Down
10 changes: 0 additions & 10 deletions frontend/components/settings/settings-page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
import { Button, Stack, Tooltip } from "@mantine/core";
import { resetLocalStorage } from "../../util/local-storage";
import { useEffect, useState } from "react";
import { getOtherGames } from "@api/bindings";
import { DebugData } from "@components/debug-data";

export function SettingsPage() {
const [otherGames, setOtherGames] = useState<unknown>();

useEffect(() => {
getOtherGames().then(setOtherGames);
}, []);

return (
<Stack>
<Tooltip
Expand All @@ -19,7 +10,6 @@ export function SettingsPage() {
>
<Button onClick={resetLocalStorage}>Reset settings to defaults</Button>
</Tooltip>
<DebugData data={otherGames} />
</Stack>
);
}

0 comments on commit 501d8be

Please sign in to comment.