From 1740f79673b4aad700fbd131e83bb7beab3b7a4e Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Fri, 13 Oct 2023 02:52:43 +0200 Subject: refactor: Rename all occurences of `_caller` to `_wrapper` To prepare for moving those functions to modules --- src-tauri/src/main.rs | 14 +++++++------- src-vue/src/components/ThunderstoreModCard.vue | 2 +- src-vue/src/plugins/store.ts | 4 ++-- src-vue/src/views/DeveloperView.vue | 4 ++-- src-vue/src/views/RepairView.vue | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 3ad7a1ea..32804192 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -124,7 +124,7 @@ fn main() { check_is_northstar_outdated, verify_install_location, platform_specific::get_host_os, - install_northstar_caller, + install_northstar_wrapper, update_northstar, northstar::launch_northstar, northstar::launch_northstar_steam, @@ -137,8 +137,8 @@ fn main() { github::release_notes::get_northstar_release_notes, platform_specific::linux_checks, mod_management::get_installed_mods_and_properties, - install_mod_caller, - clean_up_download_folder_caller, + install_mod_wrapper, + clean_up_download_folder_wrapper, github::release_notes::get_newest_flightcore_version, mod_management::delete_northstar_mod, util::get_server_player_count, @@ -280,7 +280,7 @@ async fn verify_install_location(game_path: String) -> bool { /// Installs Northstar to the given path #[tauri::command] -async fn install_northstar_caller( +async fn install_northstar_wrapper( window: tauri::Window, game_install: GameInstall, northstar_package_name: Option, @@ -325,12 +325,12 @@ async fn update_northstar( log::info!("Updating Northstar"); // Simply re-run install with up-to-date version for upate - install_northstar_caller(window, game_install, northstar_package_name, None).await + install_northstar_wrapper(window, game_install, northstar_package_name, None).await } /// Installs the specified mod #[tauri::command] -async fn install_mod_caller( +async fn install_mod_wrapper( game_install: GameInstall, thunderstore_mod_string: String, ) -> Result<(), String> { @@ -355,7 +355,7 @@ async fn install_mod_caller( /// Installs the specified mod #[tauri::command] -async fn clean_up_download_folder_caller( +async fn clean_up_download_folder_wrapper( game_install: GameInstall, force: bool, ) -> Result<(), String> { diff --git a/src-vue/src/components/ThunderstoreModCard.vue b/src-vue/src/components/ThunderstoreModCard.vue index 54241e85..11be7545 100644 --- a/src-vue/src/components/ThunderstoreModCard.vue +++ b/src-vue/src/components/ThunderstoreModCard.vue @@ -243,7 +243,7 @@ export default defineComponent({ // Capture translation method in a context, so it can be used outside Vue component context. // (see https://github.com/R2NorthstarTools/FlightCore/issues/384) (async (translate: Function) => { - await invoke("install_mod_caller", { gameInstall: this.$store.state.game_install, thunderstoreModString: this.latestVersion.full_name }).then((message) => { + await invoke("install_mod_wrapper", { gameInstall: this.$store.state.game_install, thunderstoreModString: this.latestVersion.full_name }).then((message) => { showNotification(translate('mods.card.install_success', { modName: mod.name }), message); }) .catch((error) => { diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index f0e86613..854cd19e 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -189,7 +189,7 @@ export const store = createStore({ switch (state.northstar_state) { // Install northstar if it wasn't detected. case NorthstarState.INSTALL: - let install_northstar_result = invoke("install_northstar_caller", { gameInstall: state.game_install, northstarPackageName: state.northstar_release_canal }); + let install_northstar_result = invoke("install_northstar_wrapper", { gameInstall: state.game_install, northstarPackageName: state.northstar_release_canal }); state.northstar_state = NorthstarState.INSTALLING; await install_northstar_result.then((message) => { @@ -206,7 +206,7 @@ export const store = createStore({ // Update northstar if it is outdated. case NorthstarState.MUST_UPDATE: // Updating is the same as installing, simply overwrites the existing files - let reinstall_northstar_result = invoke("install_northstar_caller", { gameInstall: state.game_install, northstarPackageName: state.northstar_release_canal }); + let reinstall_northstar_result = invoke("install_northstar_wrapper", { gameInstall: state.game_install, northstarPackageName: state.northstar_release_canal }); state.northstar_state = NorthstarState.UPDATING; await reinstall_northstar_result.then((message) => { diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index c87e4236..aa586e6e 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -226,7 +226,7 @@ export default defineComponent({ }, async installMod() { let mod_to_install = this.mod_to_install_field_string; - await invoke("install_mod_caller", { gameInstall: this.$store.state.game_install, thunderstoreModString: mod_to_install }).then((message) => { + await invoke("install_mod_wrapper", { gameInstall: this.$store.state.game_install, thunderstoreModString: mod_to_install }).then((message) => { // Show user notification if mod install completed. showNotification(`Installed ${mod_to_install}`, message); }) @@ -294,7 +294,7 @@ export default defineComponent({ 0 ); - let install_northstar_result = invoke("install_northstar_caller", { gameInstall: this.$store.state.game_install, northstarPackageName: this.selected_ns_version.value.package, versionNumber: this.selected_ns_version.value.version }); + let install_northstar_result = invoke("install_northstar_wrapper", { gameInstall: this.$store.state.game_install, northstarPackageName: this.selected_ns_version.value.package, versionNumber: this.selected_ns_version.value.version }); await install_northstar_result .then((message) => { diff --git a/src-vue/src/views/RepairView.vue b/src-vue/src/views/RepairView.vue index ce7e154d..341dff2d 100644 --- a/src-vue/src/views/RepairView.vue +++ b/src-vue/src/views/RepairView.vue @@ -75,7 +75,7 @@ export default defineComponent({ 0 ); - let install_northstar_result = invoke("install_northstar_caller", { gameInstall: this.$store.state.game_install, northstarPackageName: ReleaseCanal.RELEASE }); + let install_northstar_result = invoke("install_northstar_wrapper", { gameInstall: this.$store.state.game_install, northstarPackageName: ReleaseCanal.RELEASE }); appWindow.listen( 'northstar-install-download-progress', @@ -102,7 +102,7 @@ export default defineComponent({ }); }, async cleanUpDownloadFolder() { - await invoke("clean_up_download_folder_caller", { gameInstall: this.$store.state.game_install, force: true }).then((message) => { + await invoke("clean_up_download_folder_wrapper", { gameInstall: this.$store.state.game_install, force: true }).then((message) => { // Show user notification if task completed. showNotification(this.$t('generic.done'), this.$t('generic.done')); }) -- cgit v1.2.3