Skip to content

Commit

Permalink
fix: fixed merging issues
Browse files Browse the repository at this point in the history
  • Loading branch information
krypt0nn committed Aug 2, 2024
1 parent 6d39afd commit e63c4a4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 66 deletions.
36 changes: 0 additions & 36 deletions src/ui/main/apply_mfplat_patch.rs

This file was deleted.

4 changes: 2 additions & 2 deletions src/ui/main/download_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub fn download_diff(sender: ComponentSender<App>, progress_bar_input: Sender<Pr

move |state| {
match &state {
DiffUpdate::InstallerUpdate(InstallerUpdate::DownloadingError(err)) => {
InstallerUpdate::DownloadingError(err) => {
tracing::error!("Downloading failed: {err}");

sender.input(AppMsg::Toast {
Expand All @@ -41,7 +41,7 @@ pub fn download_diff(sender: ComponentSender<App>, progress_bar_input: Sender<Pr
});
}

DiffUpdate::InstallerUpdate(InstallerUpdate::UnpackingError(err)) => {
InstallerUpdate::UnpackingError(err) => {
tracing::error!("Unpacking failed: {err}");

sender.input(AppMsg::Toast {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/main/download_wine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub fn download_wine(sender: ComponentSender<App>, progress_bar_input: Sender<Pr
}

#[allow(unused_must_use)] {
progress_bar_input.send(ProgressBarMsg::UpdateFromState(DiffUpdate::InstallerUpdate(state)));
progress_bar_input.send(ProgressBarMsg::UpdateFromState(state));
}
}
));
Expand Down
27 changes: 1 addition & 26 deletions src/ui/main/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use adw::prelude::*;
use gtk::glib::clone;

mod repair_game;
mod apply_mfplat_patch;
mod update_patch;
mod download_wine;
mod create_prefix;
Expand Down Expand Up @@ -317,8 +316,7 @@ impl SimpleComponent for App {
Some(LauncherState::PrefixNotExists) => "document-save-symbolic",

Some(LauncherState::GameUpdateAvailable(_)) |
Some(LauncherState::GameNotInstalled(_)) |
Some(LauncherState::MfplatPatchAvailable) => "document-save-symbolic",
Some(LauncherState::GameNotInstalled(_)) => "document-save-symbolic",

Some(LauncherState::PatchBroken) |
Some(LauncherState::PatchUnsafe) |
Expand All @@ -331,7 +329,6 @@ impl SimpleComponent for App {
Some(LauncherState::PatchNotVerified) |
Some(LauncherState::PatchConcerning) => tr!("launch"),

Some(LauncherState::MfplatPatchAvailable) => tr!("apply-patch"),
Some(LauncherState::WineNotInstalled) => tr!("download-wine"),
Some(LauncherState::PrefixNotExists) => tr!("create-prefix"),
Some(LauncherState::GameNotInstalled(_)) => tr!("download"),
Expand Down Expand Up @@ -761,20 +758,6 @@ impl SimpleComponent for App {
sender,

move || {
// Check mfplay patch
match mfplat::is_applied(CONFIG.get_wine_prefix_path()) {
Ok(applied) => sender.input(AppMsg::SetMfplatPatch(applied)),

Err(err) => {
tracing::error!("Failed to check mfplat patch status: {err}");

sender.input(AppMsg::Toast {
title: tr!("patch-state-check-failed"),
description: Some(err.to_string())
});
}
}

// Get main patch status
sender.input(AppMsg::SetMainPatch(match jadeite::get_metadata() {
Ok(metadata) => {
Expand Down Expand Up @@ -869,12 +852,6 @@ impl SimpleComponent for App {
sender.input(AppMsg::SetLoadingStatus(Some(Some(tr!("loading-launcher-state--game")))));
}

StateUpdating::Voice(locale) => {
sender.input(AppMsg::SetLoadingStatus(Some(Some(tr!("loading-launcher-state--voice", {
"locale" = locale.to_name()
})))));
}

StateUpdating::Patch => {
sender.input(AppMsg::SetLoadingStatus(Some(Some(tr!("loading-launcher-state--patch")))));
}
Expand Down Expand Up @@ -969,8 +946,6 @@ impl SimpleComponent for App {
LauncherState::PatchConcerning |
LauncherState::Launch => launch::launch(sender),

LauncherState::MfplatPatchAvailable => apply_mfplat_patch::apply_mfplat_patch(sender),

LauncherState::PatchNotInstalled |
LauncherState::PatchUpdateAvailable => update_patch::update_patch(sender, self.progress_bar.sender().to_owned()),

Expand Down
2 changes: 2 additions & 0 deletions src/ui/main/repair_game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use relm4::{
Sender
};

use gtk::glib::clone;

use anime_launcher_sdk::config::ConfigExt;
use anime_launcher_sdk::honkai::config::Config;

Expand Down
2 changes: 1 addition & 1 deletion src/ui/main/update_patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn update_patch(sender: ComponentSender<App>, progress_bar_input: Sender<Pro
}

#[allow(unused_must_use)] {
progress_bar_input.send(ProgressBarMsg::UpdateFromState(state.into()));
progress_bar_input.send(ProgressBarMsg::UpdateFromState(state));
}
}
)));
Expand Down

0 comments on commit e63c4a4

Please sign in to comment.