Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions main/components/GameOptions/Launch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class="block w-full rounded-md bg-zinc-800 px-3 py-1.5 text-base text-zinc-100 outline-1 -outline-offset-1 outline-zinc-800 placeholder:text-zinc-400 focus:outline-2 focus:-outline-offset-2 focus:outline-blue-600 sm:text-sm/6"
placeholder="{}"
aria-describedby="launch-description"
v-model="model.launchString"
v-model="model.launchTemplate"
/>
</div>
<p class="mt-2 text-sm text-zinc-400" id="launch-description">
Expand Down Expand Up @@ -129,9 +129,9 @@
</span>
</li>
</ListboxOption>
<li v-else class="italic text-zinc-400 py-2 pr-9 pl-3"
>No auto-discovered layers.</li
>
<li v-else class="italic text-zinc-400 py-2 pr-9 pl-3">
No auto-discovered layers.
</li>
<h1 class="text-white text-sm font-semibold bg-zinc-900 py-2 px-2">
Manually added
</h1>
Expand Down Expand Up @@ -170,9 +170,9 @@
</span>
</li>
</ListboxOption>
<li v-else class="italic text-zinc-400 py-2 pr-9 pl-3"
>No manually added layers.</li
>
<li v-else class="italic text-zinc-400 py-2 pr-9 pl-3">
No manually added layers.
</li>
</ListboxOptions>
</transition>
</div>
Expand All @@ -190,7 +190,7 @@

<script setup lang="ts">
import { invoke } from "@tauri-apps/api/core";
import type { FrontendGameConfiguration, ProtonPath } from "~/composables/game";
import type { ProtonPath } from "~/composables/game";
import {
Listbox,
ListboxButton,
Expand All @@ -201,8 +201,9 @@ import {
import { ChevronUpDownIcon } from "@heroicons/vue/16/solid";
import { CheckIcon } from "@heroicons/vue/20/solid";
import { WrenchIcon } from "@heroicons/vue/24/solid";
import type { GameVersion } from "~/types";

const model = defineModel<FrontendGameConfiguration>({ required: true });
const model = defineModel<GameVersion["userConfiguration"]>({ required: true });

const props = defineProps<{
protonEnabled: boolean;
Expand Down
36 changes: 36 additions & 0 deletions main/components/GameOptions/Updates.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<div class="space-y-8">
<div class="flex flex-row items-center justify-between">
<div>
<h3 class="text-sm font-medium leading-6 text-zinc-100">
Enable update checks
</h3>
<p class="mt-1 text-sm leading-6 text-zinc-400">
Drop will automatically check for updates from your server
</p>
</div>
<Switch
v-model="model.enableUpdates"
:class="[
model.enableUpdates ? 'bg-blue-600' : 'bg-zinc-700',
'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out',
]"
>
<span
:class="[
model.enableUpdates ? 'translate-x-5' : 'translate-x-0',
'pointer-events-none relative inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out',
]"
/>
</Switch>
</div>

</div>
</template>

<script setup lang="ts">
import { Switch } from "@headlessui/vue";
import type { GameVersion } from '~/types';

const model = defineModel<GameVersion["userConfiguration"]>({ required: true });
</script>
26 changes: 16 additions & 10 deletions main/components/GameOptionsModal.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ModalTemplate size-class="max-w-4xl" v-model="open">
<template #default>
<div class="flex flex-row gap-x-4">
<div class="flex flex-row gap-x-4 h-96">
<nav class="flex flex-1 flex-col" aria-label="Sidebar">
<ul role="list" class="-mx-2 space-y-1">
<li v-for="(tab, tabIdx) in tabs" :key="tab.name">
Expand Down Expand Up @@ -29,7 +29,7 @@
</li>
</ul>
</nav>
<div class="border-l-2 border-zinc-800 w-full grow pl-4">
<div class="border-l-2 border-zinc-800 w-full grow pl-4 overflow-y-scroll">
<component
v-model="configuration"
:is="tabs[currentTabIndex]?.page"
Expand Down Expand Up @@ -80,33 +80,39 @@ import {
XCircleIcon,
} from "@heroicons/vue/20/solid";
import Launch from "./GameOptions/Launch.vue";
import type { FrontendGameConfiguration } from "~/composables/game";
import Updates from "./GameOptions/Updates.vue";
import { invoke } from "@tauri-apps/api/core";
import { ArrowPathIcon } from "@heroicons/vue/24/solid";
import type { GameVersion } from "~/types";

const appState = useAppState();

const open = defineModel<boolean>();
const props = defineProps<{ gameId: string }>();
const game = await useGame(props.gameId);

const configuration: Ref<FrontendGameConfiguration> = ref({
launchString: game.version!.userConfiguration.launchTemplate,
overrideProtonPath: game.version!.userConfiguration.overrideProtonPath,
});
const configuration: Ref<GameVersion["userConfiguration"]> = ref(game.version.value!.userConfiguration);

const hasWindows = !!(
game.version!.setups.find((v) => v.platform === "Windows") ??
game.version!.launches.find((v) => v.platform === "Windows")
game.version.value!.setups.find((v) => v.platform === "Windows") ??
game.version.value!.launches.find((v) => v.platform === "Windows")
);

const protonEnabled = !!(appState.value!.umuState !== "NotNeeded" && hasWindows);
const protonEnabled = !!(
appState.value!.umuState !== "NotNeeded" && hasWindows
);

const tabs: Array<{ name: string; icon: Component; page: Component }> = [
{
name: "Launch",
icon: RocketLaunchIcon,
page: Launch,
},
{
name: "Updates",
icon: ArrowPathIcon,
page: Updates,
},
{
name: "Storage",
icon: ServerIcon,
Expand Down
Loading
Loading