diff --git a/apps/app-frontend/src/components/ui/instance_settings/GeneralSettings.vue b/apps/app-frontend/src/components/ui/instance_settings/GeneralSettings.vue
index e30bead729..85a2df3500 100644
--- a/apps/app-frontend/src/components/ui/instance_settings/GeneralSettings.vue
+++ b/apps/app-frontend/src/components/ui/instance_settings/GeneralSettings.vue
@@ -9,6 +9,7 @@ import {
injectNotificationManager,
OverflowMenu,
StyledInput,
+ Toggle,
useVIntl,
} from '@modrinth/ui'
import { useQueryClient } from '@tanstack/vue-query'
@@ -44,6 +45,21 @@ const releaseChannelDisabledItems = computed(() =>
savingReleaseChannel.value ? [...releaseChannelOptions] : [],
)
+const autoUpdateModpack = ref(instance.value.auto_update_modpack ?? false)
+
+const hasLinkedModpack = computed(() => !!instance.value.linked_data)
+
+watch(autoUpdateModpack, async (value) => {
+ await edit(instance.value.path, { auto_update_modpack: value }).catch(handleError)
+})
+
+watch(
+ () => instance.value.auto_update_modpack,
+ (val) => {
+ autoUpdateModpack.value = val ?? false
+ },
+)
+
const newCategoryInput = ref('')
const installing = computed(() => instance.value.install_stage !== 'installed')
@@ -263,6 +279,15 @@ const messages = defineMessages({
id: 'instance.settings.tabs.general.update-channel.select',
defaultMessage: 'Select update channel',
},
+ autoUpdateModpack: {
+ id: 'instance.settings.tabs.general.auto-update-modpack',
+ defaultMessage: 'Auto-update modpack',
+ },
+ autoUpdateModpackDescription: {
+ id: 'instance.settings.tabs.general.auto-update-modpack.description',
+ defaultMessage:
+ 'Automatically update this modpack to the latest version. Updates are checked before launching and periodically in the background.',
+ },
deleteInstance: {
id: 'instance.settings.tabs.general.delete',
defaultMessage: 'Delete instance',
@@ -409,6 +434,18 @@ const messages = defineMessages({
+
+
+
+ {{ formatMessage(messages.autoUpdateModpack) }}
+
+
+ {{ formatMessage(messages.autoUpdateModpackDescription) }}
+
+
+
+
+
{{ formatMessage(messages.deleteInstance) }}
diff --git a/apps/app-frontend/src/helpers/profile.ts b/apps/app-frontend/src/helpers/profile.ts
index be3b62c6ef..d4ffcd4707 100644
--- a/apps/app-frontend/src/helpers/profile.ts
+++ b/apps/app-frontend/src/helpers/profile.ts
@@ -242,6 +242,11 @@ export async function update_managed_modrinth_version(
})
}
+// Auto-update all modpacks with auto_update_modpack enabled
+export async function auto_update_all_modpacks(): Promise {
+ return await invoke('plugin:profile|profile_auto_update_all_modpacks')
+}
+
// Repair a managed Modrinth profile
export async function update_repair_modrinth(path: string): Promise {
return await invoke('plugin:profile|profile_repair_managed_modrinth', { path })
diff --git a/apps/app-frontend/src/helpers/types.d.ts b/apps/app-frontend/src/helpers/types.d.ts
index 143997702f..f659f2d9cc 100644
--- a/apps/app-frontend/src/helpers/types.d.ts
+++ b/apps/app-frontend/src/helpers/types.d.ts
@@ -31,6 +31,7 @@ export type GameInstance = {
force_fullscreen?: boolean
game_resolution?: [number, number]
hooks: Hooks
+ auto_update_modpack?: boolean
}
type InstallStage =
diff --git a/apps/app-frontend/src/locales/en-US/index.json b/apps/app-frontend/src/locales/en-US/index.json
index cf98dc3a76..cb3cb7e424 100644
--- a/apps/app-frontend/src/locales/en-US/index.json
+++ b/apps/app-frontend/src/locales/en-US/index.json
@@ -665,6 +665,12 @@
"instance.settings.tabs.general": {
"message": "General"
},
+ "instance.settings.tabs.general.auto-update-modpack": {
+ "message": "Auto-update modpack"
+ },
+ "instance.settings.tabs.general.auto-update-modpack.description": {
+ "message": "Automatically update this modpack to the latest version. Updates are checked before launching and periodically in the background."
+ },
"instance.settings.tabs.general.delete": {
"message": "Delete instance"
},
diff --git a/apps/app/build.rs b/apps/app/build.rs
index 1f78fcce47..58f683bdff 100644
--- a/apps/app/build.rs
+++ b/apps/app/build.rs
@@ -196,6 +196,7 @@ fn main() {
"profile_edit_icon",
"profile_export_mrpack",
"profile_get_pack_export_candidates",
+ "profile_auto_update_all_modpacks",
])
.default_permission(
DefaultPermissionRule::AllowAllCommands,
diff --git a/apps/app/src/api/profile.rs b/apps/app/src/api/profile.rs
index ab41af5887..cf8ab54e0e 100644
--- a/apps/app/src/api/profile.rs
+++ b/apps/app/src/api/profile.rs
@@ -43,6 +43,7 @@ pub fn init() -> tauri::plugin::TauriPlugin {
profile_edit_icon,
profile_export_mrpack,
profile_get_pack_export_candidates,
+ profile_auto_update_all_modpacks,
])
.build()
}
@@ -432,6 +433,20 @@ pub struct EditProfile {
)]
pub game_resolution: Option