diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2024-08-02 02:43:39 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2024-08-02 02:43:39 +0200 |
commit | 3362cd9b55021c1325fc573a90ee0be22497bdeb (patch) | |
tree | 0aa139cd452fcb8d9f6bc9c6baac21e852b09f52 /src-vue/src | |
parent | e5a74818e79e78d0e065d9375f38fd17a3a591a9 (diff) | |
parent | edbce33c4a8f142967df868fb99476400f4ddfb3 (diff) | |
download | FlightCore-3362cd9b55021c1325fc573a90ee0be22497bdeb.tar.gz FlightCore-3362cd9b55021c1325fc573a90ee0be22497bdeb.zip |
Merge branch 'main' into chore/bump-upload-artifact-action
Diffstat (limited to 'src-vue/src')
-rw-r--r-- | src-vue/src/App.vue | 10 | ||||
-rw-r--r-- | src-vue/src/components/PullRequestsSelector.vue | 2 | ||||
-rw-r--r-- | src-vue/src/i18n/lang/de.json | 27 | ||||
-rw-r--r-- | src-vue/src/i18n/lang/en.json | 1 | ||||
-rw-r--r-- | src-vue/src/i18n/lang/fr.json | 4 | ||||
-rw-r--r-- | src-vue/src/i18n/lang/pl.json | 17 | ||||
-rw-r--r-- | src-vue/src/i18n/lang/ru.json | 7 | ||||
-rw-r--r-- | src-vue/src/plugins/modules/search.ts | 1 | ||||
-rw-r--r-- | src-vue/src/plugins/store.ts | 22 | ||||
-rw-r--r-- | src-vue/src/views/DeveloperView.vue | 47 | ||||
-rw-r--r-- | src-vue/src/views/SettingsView.vue | 16 | ||||
-rw-r--r-- | src-vue/src/views/mods/LocalModsView.vue | 21 | ||||
-rw-r--r-- | src-vue/src/views/mods/ThunderstoreModsView.vue | 14 |
13 files changed, 150 insertions, 39 deletions
diff --git a/src-vue/src/App.vue b/src-vue/src/App.vue index 1b7ee91b..162b0b34 100644 --- a/src-vue/src/App.vue +++ b/src-vue/src/App.vue @@ -137,6 +137,12 @@ export default { font-weight: bold; font-size: large; background-color: transparent !important; + + border-width: 2px !important; + border-style: solid !important; + border-color: transparent !important; + border-radius: 10px !important; + transition: none; } #fc__menu_items .el-menu-item:hover, #fc__menu_items .el-sub-menu__title { @@ -144,6 +150,10 @@ export default { background-color: transparent; } +#fc__menu_items .el-menu-item:focus-visible { + border-color: rgb(160, 207, 255) !important; +} + #fc__menu_items .el-menu-item.is-active, #fc__menu_items .el-sub-menu.is-active > .el-sub-menu__title { color: white !important; } diff --git a/src-vue/src/components/PullRequestsSelector.vue b/src-vue/src/components/PullRequestsSelector.vue index fe103edc..bd17ed14 100644 --- a/src-vue/src/components/PullRequestsSelector.vue +++ b/src-vue/src/components/PullRequestsSelector.vue @@ -28,6 +28,7 @@ <a target="_blank" :href="pull_request.html_url"> {{ pull_request.number }}: {{ pull_request.title }} </a> + <el-tag v-for="label in pull_request.labels">{{ label }}</el-tag> </el-card> <div v-else class="no_matching_pr"> No matching PR found. @@ -67,6 +68,7 @@ <a target="_blank" :href="pull_request.html_url"> {{ pull_request.number }}: {{ pull_request.title }} </a> + <el-tag v-for="label in pull_request.labels">{{ label }}</el-tag> </el-card> <div v-else class="no_matching_pr"> No matching PR found. diff --git a/src-vue/src/i18n/lang/de.json b/src-vue/src/i18n/lang/de.json index c830ae5a..a360c124 100644 --- a/src-vue/src/i18n/lang/de.json +++ b/src-vue/src/i18n/lang/de.json @@ -15,7 +15,8 @@ "downloading": "Herunterladen", "extracting": "Extrahieren", "done": "Fertig", - "success": "Erfolg" + "success": "Erfolg", + "confirm": "Bestätigen" }, "play": { "button": { @@ -120,8 +121,15 @@ "show_deprecated_mods": "Veraltete Thunderstore mods anzeigen", "profile": { "dialog": { - "title": "Profile" - } + "title": "Profile", + "delete_confirm": "Sind Sie sich sicher, dass Sie dieses Profil löschen möchten?", + "delete": "Löschen", + "clone": "Duplizieren", + "create_empty": "Neues Profil", + "new_profile_name": "Neuen Profilnamen eingeben" + }, + "active": "Aktives Profil", + "edit": "Profile bearbeiten" } }, "notification": { @@ -142,7 +150,18 @@ "flightcore_outdated": { "title": "FlightCore veraltet!", "text": "Bitte aktualisiere FlightCore.\nDu hast die veraltetet Version {oldVersion}.\nNeuste Version ist {newVersion}!" - } + }, + "profile": { + "invalid": { + "text": "Das Profil auf das Sie wechseln möchten ist nicht länger gültig.", + "title": "Ungültiges Profil" + } + }, + "no_new": { + "title": "Aktuell", + "text": "Hier gibt es nichts zu sehen!" + }, + "date_prefix": "auf" }, "channels": { "release": { diff --git a/src-vue/src/i18n/lang/en.json b/src-vue/src/i18n/lang/en.json index e0460fd1..4c3da49f 100644 --- a/src-vue/src/i18n/lang/en.json +++ b/src-vue/src/i18n/lang/en.json @@ -110,6 +110,7 @@ "show_deprecated_mods": "Show deprecated Thunderstore mods", "show_deprecated_mods_desc1": "This allows you to see deprecated mods in the online mods collection.", "show_deprecated_mods_desc2": "Watch out, such mods are usually deprecated for a good reason.", + "show_nsfw_mods": "Show NSFW Thunderstore mods", "profile": { "active": "Active Profile", diff --git a/src-vue/src/i18n/lang/fr.json b/src-vue/src/i18n/lang/fr.json index d2de46b0..efc0815b 100644 --- a/src-vue/src/i18n/lang/fr.json +++ b/src-vue/src/i18n/lang/fr.json @@ -126,7 +126,9 @@ "title": "Profiles", "clone": "Cloner", "delete": "Supprimer", - "delete_confirm": "Voulez-vous vraiment supprimer ce profil ?" + "delete_confirm": "Voulez-vous vraiment supprimer ce profil ?", + "create_empty": "nouveau profil", + "new_profile_name": "Entrez le nouveau nom du profil" } } }, diff --git a/src-vue/src/i18n/lang/pl.json b/src-vue/src/i18n/lang/pl.json index c11c7f06..175d6eb3 100644 --- a/src-vue/src/i18n/lang/pl.json +++ b/src-vue/src/i18n/lang/pl.json @@ -15,7 +15,8 @@ "extracting": "Wypakowywanie", "done": "Gotowe", "success": "Sukces", - "informationShort": "Informacja" + "informationShort": "Informacja", + "confirm": "Potwierdź" }, "play": { "button": { @@ -121,7 +122,12 @@ "profile": { "active": "Aktywny profil", "dialog": { - "title": "Profile" + "title": "Profile", + "delete": "Usuń", + "clone": "Klonuj", + "new_profile_name": "Wprowadź nową nazwę profilu", + "create_empty": "Nowy profil", + "delete_confirm": "Czy na pewno chcesz usunąć ten profil?" }, "edit": "Edytuj profile" } @@ -150,7 +156,12 @@ "title": "Nieprawidłowy profil", "text": "Profil, na który próbowano się przełączyć, nie jest już prawidłowy." } - } + }, + "no_new": { + "title": "Aktualny", + "text": "Nie ma tu nic do obejrzenia!" + }, + "date_prefix": "na" }, "channels": { "release": { diff --git a/src-vue/src/i18n/lang/ru.json b/src-vue/src/i18n/lang/ru.json index 2888bdfd..6a0331f1 100644 --- a/src-vue/src/i18n/lang/ru.json +++ b/src-vue/src/i18n/lang/ru.json @@ -126,7 +126,9 @@ "title": "Профили", "clone": "Копировать", "delete": "Удалить", - "delete_confirm": "Вы уверены, что удалите этот профиль?" + "delete_confirm": "Вы уверены, что удалите этот профиль?", + "new_profile_name": "Введите новое имя профиля", + "create_empty": "Новый профиль" } } }, @@ -158,7 +160,8 @@ "no_new": { "text": "Смотреть здесь нечего!", "title": "Актуальный" - } + }, + "date_prefix": "в" }, "channels": { "release": { diff --git a/src-vue/src/plugins/modules/search.ts b/src-vue/src/plugins/modules/search.ts index e590b94b..9614b0be 100644 --- a/src-vue/src/plugins/modules/search.ts +++ b/src-vue/src/plugins/modules/search.ts @@ -9,6 +9,7 @@ export const searchModule = { // Selected mod categories selectedCategories: [], showDeprecatedMods: false, + showNsfwMods: false, sortValue: {label: '', value: ''} }), getters: { diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index a1a67e2b..b61ac573 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -15,6 +15,7 @@ import { router } from "../main"; import { ReleaseInfo } from "../../../src-tauri/bindings/ReleaseInfo"; import { ThunderstoreMod } from "../../../src-tauri/bindings/ThunderstoreMod"; import { NorthstarMod } from "../../../src-tauri/bindings/NorthstarMod"; +import { NorthstarLaunchOptions } from "../../../src-tauri/bindings/NorthstarLaunchOptions" import { searchModule } from './modules/search'; import { i18n } from '../main'; import { pullRequestModule } from './modules/pull_requests'; @@ -172,9 +173,10 @@ export const store = createStore<FlightCoreStore>({ } } }, - async launchGame(state: any, no_checks = false) { - if (no_checks) { - await invoke("launch_northstar", { gameInstall: state.game_install, bypassChecks: no_checks }) + async launchGame(state: any, launch_options: NorthstarLaunchOptions = { launch_via_steam: false, bypass_checks: false}) { + + if (launch_options.bypass_checks) { + await invoke("launch_northstar", { gameInstall: state.game_install, launchOptions: launch_options }) .then((message) => { console.log("Launched with bypassed checks"); console.log(message); @@ -224,7 +226,7 @@ export const store = createStore<FlightCoreStore>({ // Game is ready to play. case NorthstarState.READY_TO_PLAY: - await invoke("launch_northstar", { gameInstall: state.game_install }) + await invoke("launch_northstar", { gameInstall: state.game_install, launchOptions: launch_options }) .then((message) => { console.log(message); // NorthstarState.RUNNING @@ -240,8 +242,8 @@ export const store = createStore<FlightCoreStore>({ break; } }, - async launchGameSteam(state: any, no_checks = false) { - await invoke("launch_northstar", { gameInstall: state.game_install, launchViaSteam: true, bypassChecks: no_checks }) + async launchGameSteam(state: any, launch_options: NorthstarLaunchOptions = { launch_via_steam: true, bypass_checks: false}) { + await invoke("launch_northstar", { gameInstall: state.game_install, launchOptions: launch_options }) .then((message) => { showNotification('Success'); }) @@ -254,7 +256,13 @@ export const store = createStore<FlightCoreStore>({ }, async fetchReleaseNotes(state: FlightCoreStore) { if (state.releaseNotes.length !== 0) return; - state.releaseNotes = await invoke("get_northstar_release_notes"); + await invoke<ReleaseInfo[]>("get_northstar_release_notes") + .then((message) => { + state.releaseNotes = message; + }) + .catch((error) => { + showErrorNotification(error); + }); }, async fetchThunderstoreMods(state: FlightCoreStore) { // To check if some Thunderstore mods are already installed/outdated, we need to load locally-installed mods. diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index aa586e6e..a08c73f3 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -17,10 +17,6 @@ <h3>Linux:</h3> - <el-button type="primary" @click="checkLinuxCompatibility"> - Check NSProton Compatibility - </el-button> - <el-button type="primary" @click="installNSProton"> Install NSProton </el-button> @@ -93,7 +89,7 @@ :label="item.label" :value="item.value" /> - </el-select> + </el-select> <el-button type="primary" @click="getTags"> Get tags </el-button> @@ -129,6 +125,19 @@ :rows="5" placeholder="Output" /> + + <h3>Release announcements</h3> + + <el-button type="primary" @click="generateReleaseAnnouncementMessage"> + Generate release announcement + </el-button> + + <el-input + v-model="discord_release_announcement_text" + type="textarea" + :rows="5" + placeholder="Output" + /> </el-scrollbar> </div> </template> @@ -136,6 +145,7 @@ <script lang="ts"> import { defineComponent } from "vue"; import { invoke } from "@tauri-apps/api"; +import { NorthstarLaunchOptions } from "../../../src-tauri/bindings/NorthstarLaunchOptions"; import { TagWrapper } from "../../../src-tauri/bindings/TagWrapper"; import { NorthstarThunderstoreReleaseWrapper } from "../../../src-tauri/bindings/NorthstarThunderstoreReleaseWrapper"; import PullRequestsSelector from "../components/PullRequestsSelector.vue"; @@ -151,6 +161,7 @@ export default defineComponent({ return { mod_to_install_field_string: "", release_notes_text: "", + discord_release_announcement_text: "", first_tag: { label: '', value: { name: '' } }, second_tag: { label: '', value: { name: '' } }, ns_release_tags: [] as TagWrapper[], @@ -195,21 +206,13 @@ export default defineComponent({ await invoke("force_panic"); showErrorNotification("Never should have been able to get here!"); }, - async checkLinuxCompatibility() { - await invoke("linux_checks") - .then(() => { - showNotification('Linux compatible', 'All checks passed'); - }) - .catch((error) => { - showNotification('Not Linux compatible', error, 'error'); - console.error(error); - }); - }, async launchGameWithoutChecks() { - this.$store.commit('launchGame', true); + let launch_options: NorthstarLaunchOptions = { bypass_checks: true, launch_via_steam: false }; + this.$store.commit('launchGame', launch_options); }, async launchGameViaSteam() { - this.$store.commit('launchGameSteam', true); + let launch_options: NorthstarLaunchOptions = { bypass_checks: false, launch_via_steam: true }; + this.$store.commit('launchGameSteam', launch_options); }, async getInstalledMods() { await invoke("get_installed_mods_and_properties", { gameInstall: this.$store.state.game_install }).then((message) => { @@ -336,6 +339,16 @@ export default defineComponent({ showErrorNotification("Failed copying to clipboard"); }); }, + async generateReleaseAnnouncementMessage() { + await invoke<string>("generate_release_note_announcement", { }) + .then((message) => { + this.discord_release_announcement_text = message; + showNotification("Done", "Generated announcement"); + }) + .catch((error) => { + showErrorNotification(error); + }); + }, } }); </script> diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue index 16b894d5..5ead665b 100644 --- a/src-vue/src/views/SettingsView.vue +++ b/src-vue/src/views/SettingsView.vue @@ -112,6 +112,14 @@ </el-button> </div> + <div class="fc_parameter__panel"> + <h3>{{ $t('settings.show_nsfw_mods') }}</h3> + <span> + {{ $t('settings.show_nsfw_mods') }} + <el-switch v-model="showNsfwMods"></el-switch> + </span> + </div> + <!-- About section --> <div class="fc_parameter__panel"> <h3>{{ $t('settings.about') }}</h3> @@ -157,6 +165,14 @@ export default defineComponent({ } }, computed: { + showNsfwMods: { + get(): boolean { + return this.$store.state.search.showNsfwMods; + }, + set(value: boolean) { + this.$store.state.search.showNsfwMods = value; + } + }, showDeprecatedMods: { get(): boolean { return this.$store.state.search.showDeprecatedMods; diff --git a/src-vue/src/views/mods/LocalModsView.vue b/src-vue/src/views/mods/LocalModsView.vue index 38f7a914..3979ca14 100644 --- a/src-vue/src/views/mods/LocalModsView.vue +++ b/src-vue/src/views/mods/LocalModsView.vue @@ -5,14 +5,19 @@ </div> <el-scrollbar v-else> + <el-button class="disableModsBtn" type="primary" @click="disableAllModsButCore"> + {{ $t('settings.repair.window.disable_all_but_core') }} + </el-button> <local-mod-card v-for="mod of mods" v-bind:key="mod.name" :mod="mod" /> </el-scrollbar> </template> <script lang="ts"> import { defineComponent } from 'vue'; +import { invoke } from "@tauri-apps/api"; import { NorthstarMod } from "../../../../src-tauri/bindings/NorthstarMod"; import { fuzzy_filter } from "../../utils/filter"; +import { showErrorNotification, showNotification } from "../../utils/ui"; import LocalModCard from "../../components/LocalModCard.vue"; export default defineComponent({ @@ -41,6 +46,16 @@ export default defineComponent({ }; }, methods: { + async disableAllModsButCore() { + await invoke("disable_all_but_core", { gameInstall: this.$store.state.game_install }) + .then((message) => { + showNotification(this.$t('generic.success'), this.$t('settings.repair.window.disable_all_but_core_success')); + this.$store.commit('loadInstalledMods'); + }) + .catch((error) => { + showErrorNotification(error); + }); + }, }, mounted() { this.$store.commit('loadInstalledMods'); @@ -49,5 +64,9 @@ export default defineComponent({ </script> <style scoped> - +.disableModsBtn { + margin-bottom: 10px; + top: 10px; + position: sticky; +} </style> diff --git a/src-vue/src/views/mods/ThunderstoreModsView.vue b/src-vue/src/views/mods/ThunderstoreModsView.vue index 1221f85f..1ec684a6 100644 --- a/src-vue/src/views/mods/ThunderstoreModsView.vue +++ b/src-vue/src/views/mods/ThunderstoreModsView.vue @@ -66,6 +66,9 @@ export default defineComponent({ showDeprecatedMods(): boolean {
return this.$store.state.search.showDeprecatedMods;
},
+ showNsfwMods(): boolean {
+ return this.$store.state.search.showNsfwMods;
+ },
searchValue(): string {
return this.$store.getters.searchWords;
},
@@ -95,22 +98,25 @@ export default defineComponent({ // Filter out deprecated mods
const showDeprecated = !mod.is_deprecated || this.showDeprecatedMods;
+ // Filter out NSFW mods
+ const showNsfw = !mod.has_nsfw_content || this.showNsfwMods;
+
// Filter with categories (only if some categories are selected)
const categoriesMatch: boolean = this.selectedCategories.length === 0
|| mod.categories
.filter((category: string) => this.selectedCategories.includes(category))
.length === this.selectedCategories.length;
- return inputMatches && categoriesMatch && showDeprecated;
+ return inputMatches && categoriesMatch && showDeprecated && showNsfw;
});
},
modsList(): ThunderstoreMod[] {
// Use filtered mods if user is searching, vanilla list otherwise.
const mods: ThunderstoreMod[] = this.searchValue.length !== 0 || this.selectedCategories.length !== 0
? this.filteredMods
- : this.showDeprecatedMods
- ? this.mods
- : this.mods.filter(mod => !mod.is_deprecated);
+ : this.mods
+ .filter(mod => this.showDeprecatedMods || !mod.is_deprecated)
+ .filter(mod => this.showNsfwMods || !mod.has_nsfw_content);
// Sort mods regarding user selected algorithm.
let compare: (a: ThunderstoreMod, b: ThunderstoreMod) => number;
|