update
This commit is contained in:
@@ -4,7 +4,7 @@ use tauri::{AppHandle, State};
|
||||
use tauri_plugin_dialog::DialogExt;
|
||||
use tauri_plugin_opener::OpenerExt;
|
||||
|
||||
use crate::launcher::{Launcher, Status};
|
||||
use crate::launcher::{Launcher, Market, Status};
|
||||
use crate::settings::Settings;
|
||||
use crate::stack::StackEvent;
|
||||
use crate::sync::Conflict;
|
||||
@@ -21,6 +21,31 @@ pub async fn get_status(launcher: State<'_, Launcher>) -> CmdResult<Status> {
|
||||
Ok(launcher.status().await)
|
||||
}
|
||||
|
||||
/// The marketplace: every tile set and source file of the version, required ones first. With
|
||||
/// `drive`, what that drive can install instead of the DHP.
|
||||
#[tauri::command]
|
||||
pub async fn get_market(app: AppHandle, launcher: State<'_, Launcher>, drive: Option<String>) -> CmdResult<Market> {
|
||||
launcher.market(&app, drive.map(std::path::PathBuf::from)).await
|
||||
}
|
||||
|
||||
/// Choose the optional items (their keys) for an install about to run, without touching what
|
||||
/// is installed. `drive` names the drive whose items these are.
|
||||
#[tauri::command]
|
||||
pub async fn set_market(
|
||||
app: AppHandle,
|
||||
launcher: State<'_, Launcher>,
|
||||
selected: Vec<String>,
|
||||
drive: Option<String>,
|
||||
) -> CmdResult<()> {
|
||||
launcher.choose_market(&app, selected, drive.map(std::path::PathBuf::from)).await
|
||||
}
|
||||
|
||||
/// Choose the optional items (their keys) and apply the choice; see `Launcher::apply_market`.
|
||||
#[tauri::command]
|
||||
pub async fn apply_market(app: AppHandle, launcher: State<'_, Launcher>, selected: Vec<String>) -> CmdResult<()> {
|
||||
launcher.apply_market(&app, selected).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn refresh(app: AppHandle, launcher: State<'_, Launcher>) -> CmdResult<Status> {
|
||||
Ok(launcher.refresh(&app).await)
|
||||
|
||||
Reference in New Issue
Block a user