diff --git a/.gitignore b/.gitignore index d9fcee736..363fe7422 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,5 @@ fabric.properties # MSVC Windows builds of rustc generate these, which store debugging information *.pdb +theseus.iml + diff --git a/Cargo.lock b/Cargo.lock index d89677e07..9fe68b1f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4609,7 +4609,7 @@ dependencies = [ [[package]] name = "theseus" -version = "0.5.0" +version = "0.5.1" dependencies = [ "async-recursion", "async-tungstenite", @@ -4654,7 +4654,7 @@ dependencies = [ [[package]] name = "theseus_cli" -version = "0.5.0" +version = "0.5.1" dependencies = [ "argh", "color-eyre", @@ -4681,7 +4681,7 @@ dependencies = [ [[package]] name = "theseus_gui" -version = "0.5.0" +version = "0.5.1" dependencies = [ "chrono", "cocoa", diff --git a/theseus.iml b/theseus.iml new file mode 100644 index 000000000..fbdd85c4d --- /dev/null +++ b/theseus.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/theseus/Cargo.toml b/theseus/Cargo.toml index 30c3dc8ed..d41ad9a08 100644 --- a/theseus/Cargo.toml +++ b/theseus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus" -version = "0.5.0" +version = "0.5.1" authors = ["Jai A "] edition = "2018" diff --git a/theseus/src/state/children.rs b/theseus/src/state/children.rs index efa2b0424..189a8eab3 100644 --- a/theseus/src/state/children.rs +++ b/theseus/src/state/children.rs @@ -160,12 +160,11 @@ impl Children { .signed_duration_since(last_updated_playtime) .num_seconds(); if diff >= 60 { - if let Err(e) = - profile::edit(&associated_profile, |mut prof| { - prof.metadata.recent_time_played += diff as u64; - async { Ok(()) } - }) - .await + if let Err(e) = profile::edit(&associated_profile, |prof| { + prof.metadata.recent_time_played += diff as u64; + async { Ok(()) } + }) + .await { tracing::warn!( "Failed to update playtime for profile {}: {}", @@ -181,7 +180,7 @@ impl Children { let diff = Utc::now() .signed_duration_since(last_updated_playtime) .num_seconds(); - if let Err(e) = profile::edit(&associated_profile, |mut prof| { + if let Err(e) = profile::edit(&associated_profile, |prof| { prof.metadata.recent_time_played += diff as u64; async { Ok(()) } }) diff --git a/theseus_cli/Cargo.toml b/theseus_cli/Cargo.toml index 762d23120..1bd9be909 100644 --- a/theseus_cli/Cargo.toml +++ b/theseus_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus_cli" -version = "0.5.0" +version = "0.5.1" authors = ["Jai A "] edition = "2018" diff --git a/theseus_gui/package.json b/theseus_gui/package.json index 273e5effd..0cb6f3d39 100644 --- a/theseus_gui/package.json +++ b/theseus_gui/package.json @@ -1,7 +1,7 @@ { "name": "theseus_gui", "private": true, - "version": "0.5.0", + "version": "0.5.1", "type": "module", "scripts": { "dev": "vite", @@ -18,7 +18,7 @@ "floating-vue": "^2.0.0-beta.20", "mixpanel-browser": "^2.47.0", "ofetch": "^1.0.1", - "omorphia": "^0.4.35", + "omorphia": "^0.4.38", "pinia": "^2.1.3", "qrcode.vue": "^3.4.0", "tauri-plugin-window-state-api": "github:tauri-apps/tauri-plugin-window-state#v1", diff --git a/theseus_gui/pnpm-lock.yaml b/theseus_gui/pnpm-lock.yaml index 027d36dfa..145740cf2 100644 --- a/theseus_gui/pnpm-lock.yaml +++ b/theseus_gui/pnpm-lock.yaml @@ -21,8 +21,8 @@ dependencies: specifier: ^1.0.1 version: 1.0.1 omorphia: - specifier: ^0.4.35 - version: 0.4.35 + specifier: ^0.4.38 + version: 0.4.38 pinia: specifier: ^2.1.3 version: 2.1.3(vue@3.3.4) @@ -1348,8 +1348,8 @@ packages: ufo: 1.1.2 dev: false - /omorphia@0.4.35: - resolution: {integrity: sha512-ZxA6sJKWZbiG49l/gTG25cxAvTcIfVSLhuIV2e+LSY0nwkZO4EFvxhzGNz0exR3lVs+OdDCdJyb1U2QYMVbVrA==} + /omorphia@0.4.38: + resolution: {integrity: sha512-V0vEarmAart6Gf5WuPUZ58TuIiQf7rI5HJpmYU7FVbtdvZ3q08VqyKZflCddbeBSFQ4/N+A+sNr/ELf/jz+Cug==} dependencies: dayjs: 1.11.7 floating-vue: 2.0.0-beta.20(vue@3.3.4) diff --git a/theseus_gui/src-tauri/Cargo.toml b/theseus_gui/src-tauri/Cargo.toml index de8b7a061..db9f66549 100644 --- a/theseus_gui/src-tauri/Cargo.toml +++ b/theseus_gui/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus_gui" -version = "0.5.0" +version = "0.5.1" description = "A Tauri App" authors = ["you"] license = "" diff --git a/theseus_gui/src-tauri/tauri.conf.json b/theseus_gui/src-tauri/tauri.conf.json index 1f11c3e85..4bc1b6a5f 100644 --- a/theseus_gui/src-tauri/tauri.conf.json +++ b/theseus_gui/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "Modrinth App", - "version": "0.5.0" + "version": "0.5.1" }, "tauri": { "allowlist": { diff --git a/theseus_gui/src/App.vue b/theseus_gui/src/App.vue index a70cde19c..3b01c4b16 100644 --- a/theseus_gui/src/App.vue +++ b/theseus_gui/src/App.vue @@ -218,10 +218,11 @@ command_listener((e) => { - + + @@ -240,6 +241,7 @@ command_listener((e) => { { > - + @@ -260,7 +262,7 @@ command_listener((e) => { - + @@ -290,7 +292,7 @@ command_listener((e) => { offset-height="var(--appbar-height)" offset-width="var(--sidebar-width)" /> - + diff --git a/theseus_gui/src/assets/icons/bug.svg b/theseus_gui/src/assets/icons/bug.svg new file mode 100644 index 000000000..3058c0345 --- /dev/null +++ b/theseus_gui/src/assets/icons/bug.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/theseus_gui/src/assets/icons/index.js b/theseus_gui/src/assets/icons/index.js index 020e12313..185e498b5 100644 --- a/theseus_gui/src/assets/icons/index.js +++ b/theseus_gui/src/assets/icons/index.js @@ -10,3 +10,5 @@ export { default as TextInputIcon } from './text-cursor-input.svg' export { default as AddProjectImage } from './add-project.svg' export { default as NewInstanceImage } from './new-instance.svg' export { default as MenuIcon } from './menu.svg' +export { default as BugIcon } from './bug.svg' +export { default as ChatIcon } from './messages-square.svg' diff --git a/theseus_gui/src/assets/icons/messages-square.svg b/theseus_gui/src/assets/icons/messages-square.svg new file mode 100644 index 000000000..f85d1ebe8 --- /dev/null +++ b/theseus_gui/src/assets/icons/messages-square.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/theseus_gui/src/components/GridDisplay.vue b/theseus_gui/src/components/GridDisplay.vue index 4654df8c3..b182d7982 100644 --- a/theseus_gui/src/components/GridDisplay.vue +++ b/theseus_gui/src/components/GridDisplay.vue @@ -245,6 +245,7 @@ const filteredResults = computed(() => { @@ -254,6 +255,7 @@ const filteredResults = computed(() => { @@ -263,6 +265,7 @@ const filteredResults = computed(() => { diff --git a/theseus_gui/src/components/ui/AccountsCard.vue b/theseus_gui/src/components/ui/AccountsCard.vue index 686930cc2..bd2f07c9d 100644 --- a/theseus_gui/src/components/ui/AccountsCard.vue +++ b/theseus_gui/src/components/ui/AccountsCard.vue @@ -2,6 +2,7 @@ - - - {{ selectedAccount ? selectedAccount.username : 'Offline' }} - - - - Accounts - - + + + + + + Sign into Microsoft with your browser. If your browser didn't open, you can copy and open + the link below, or scan the QR code with your device. + + + + + navigator.clipboard.writeText(loginUrl)" + > + + + + + + + Open link + + Cancel + + + + diff --git a/theseus_gui/src/components/ui/tutorial/FakeGridDisplay.vue b/theseus_gui/src/components/ui/tutorial/FakeGridDisplay.vue index d955e77ea..bafa22ef0 100644 --- a/theseus_gui/src/components/ui/tutorial/FakeGridDisplay.vue +++ b/theseus_gui/src/components/ui/tutorial/FakeGridDisplay.vue @@ -32,6 +32,7 @@ defineProps({ @@ -41,6 +42,7 @@ defineProps({ @@ -50,6 +52,7 @@ defineProps({ diff --git a/theseus_gui/src/components/ui/tutorial/FakeRowDisplay.vue b/theseus_gui/src/components/ui/tutorial/FakeRowDisplay.vue index 74f417de3..a7a2abe50 100644 --- a/theseus_gui/src/components/ui/tutorial/FakeRowDisplay.vue +++ b/theseus_gui/src/components/ui/tutorial/FakeRowDisplay.vue @@ -63,7 +63,7 @@ defineProps({ > diff --git a/theseus_gui/src/components/ui/tutorial/FakeSearch.vue b/theseus_gui/src/components/ui/tutorial/FakeSearch.vue index 17f53cf44..d32d41518 100644 --- a/theseus_gui/src/components/ui/tutorial/FakeSearch.vue +++ b/theseus_gui/src/components/ui/tutorial/FakeSearch.vue @@ -176,7 +176,7 @@ defineProps({ - + diff --git a/theseus_gui/src/components/ui/tutorial/OnboardingScreen.vue b/theseus_gui/src/components/ui/tutorial/OnboardingScreen.vue index 120b99c23..8b5df5392 100644 --- a/theseus_gui/src/components/ui/tutorial/OnboardingScreen.vue +++ b/theseus_gui/src/components/ui/tutorial/OnboardingScreen.vue @@ -8,7 +8,6 @@ import { SettingsIcon, XIcon, Notifications, - LogOutIcon, } from 'omorphia' import { appWindow } from '@tauri-apps/api/window' import { saveWindowState, StateFlags } from 'tauri-plugin-window-state-api' @@ -160,7 +159,10 @@ onMounted(async () => { - + { - - - @@ -192,7 +191,11 @@ onMounted(async () => { - + { background-color: var(--color-brand-highlight); transition: all ease-in-out 0.1s; } - - &.sleek-exit { - background-color: var(--color-red); - color: var(--color-accent-contrast); - transition: all ease-in-out 0.1s; - } } } diff --git a/theseus_gui/src/pages/Browse.vue b/theseus_gui/src/pages/Browse.vue index 172a8e0f9..e13ef5795 100644 --- a/theseus_gui/src/pages/Browse.vue +++ b/theseus_gui/src/pages/Browse.vue @@ -29,7 +29,7 @@ import ModInstallModal from '@/components/ui/ModInstallModal.vue' import SplashScreen from '@/components/ui/SplashScreen.vue' import IncompatibilityWarningModal from '@/components/ui/IncompatibilityWarningModal.vue' import { useFetch } from '@/helpers/fetch.js' -import { check_installed, get as getInstance } from '@/helpers/profile.js' +import { check_installed, get, get as getInstance } from '@/helpers/profile.js' import { convertFileSrc } from '@tauri-apps/api/tauri' import { isOffline } from '@/helpers/utils' import { offline_listener } from '@/helpers/events' @@ -56,6 +56,7 @@ const orFacets = ref([]) const selectedVersions = ref([]) const onlyOpenSource = ref(false) const showSnapshots = ref(false) +const hideAlreadyInstalled = ref(false) const selectedEnvironments = ref([]) const sortTypes = readonly([ { display: 'Relevance', name: 'relevance' }, @@ -143,6 +144,9 @@ if (route.query.m) { if (route.query.o) { currentPage.value = Math.ceil(route.query.o / maxResults.value) + 1 } +if (route.query.ai) { + hideAlreadyInstalled.value = route.query.ai === 'true' +} async function refreshSearch() { const base = 'https://api.modrinth.com/v2/' @@ -222,6 +226,16 @@ async function refreshSearch() { ]) } + if (hideAlreadyInstalled.value) { + const installedMods = await get(instanceContext.value.path, false).then((x) => + Object.values(x.projects) + .filter((x) => x.metadata.project) + .map((x) => x.metadata.project.id) + ) + installedMods.map((x) => [`project_id != ${x}`]).forEach((x) => formattedFacets.push(x)) + console.log(`facets=${JSON.stringify(formattedFacets)}`) + } + params.push(`facets=${JSON.stringify(formattedFacets)}`) } const offset = (currentPage.value - 1) * maxResults.value @@ -339,6 +353,10 @@ function getSearchUrl(offset, useObj) { queryItems.push('il=true') obj.il = true } + if (hideAlreadyInstalled.value) { + queryItems.push('ai=true') + obj.ai = true + } let url = `${route.path}` @@ -555,6 +573,13 @@ onUnmounted(() => unlistenOffline()) @update:model-value="onSearchChangeToTop(1)" @click.prevent.stop /> + unlistenOffline()) - + @@ -711,7 +736,7 @@ onUnmounted(() => unlistenOffline()) @switch-page="onSearchChange" /> - + You are currently offline. Connect to the internet to browse Modrinth! diff --git a/theseus_gui/src/pages/Library.vue b/theseus_gui/src/pages/Library.vue index bedc9c386..d3b883978 100644 --- a/theseus_gui/src/pages/Library.vue +++ b/theseus_gui/src/pages/Library.vue @@ -35,12 +35,7 @@ onUnmounted(() => { - + @@ -55,11 +50,6 @@ onUnmounted(() => { diff --git a/theseus_gui/src/pages/instance/Options.vue b/theseus_gui/src/pages/instance/Options.vue index 0d11f6e03..baa964ff9 100644 --- a/theseus_gui/src/pages/instance/Options.vue +++ b/theseus_gui/src/pages/instance/Options.vue @@ -21,7 +21,12 @@ Game Version - + @@ -31,6 +36,7 @@ :model-value="selectableLoaderVersions[loaderVersionIndex]" :options="selectableLoaderVersions" :display-name="(option) => option?.id" + name="Version selector" render-up @change="(value) => (loaderVersionIndex = value.index)" /> @@ -426,11 +432,9 @@ const groups = ref(props.instance.metadata.groups) const instancesList = Object.values(await list(true)) const availableGroups = ref([ - ...new Set( - instancesList.reduce((acc, obj) => { - return acc.concat(obj.metadata.groups) - }, []) - ), + ...instancesList.reduce((acc, obj) => { + return acc.concat(obj.metadata.groups) + }, []), ]) async function resetIcon() { diff --git a/theseus_gui/src/pages/project/Index.vue b/theseus_gui/src/pages/project/Index.vue index 070a68464..c95bd3688 100644 --- a/theseus_gui/src/pages/project/Index.vue +++ b/theseus_gui/src/pages/project/Index.vue @@ -37,6 +37,7 @@ (cat) => data.categories.includes(cat.name) && cat.project_type === 'mod' ) " + type="ignored" > - +
- - Accounts -
+ Sign into Microsoft with your browser. If your browser didn't open, you can copy and open + the link below, or scan the QR code with your device. +
Game Version