mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-13 08:12:40 +10:00
feat(umu id override): add support for overriding UMU id
This commit is contained in:
@ -160,6 +160,72 @@
|
|||||||
/>
|
/>
|
||||||
</Switch>
|
</Switch>
|
||||||
</SwitchGroup>
|
</SwitchGroup>
|
||||||
|
<Disclosure as="div" class="py-2" v-slot="{ open }">
|
||||||
|
<dt>
|
||||||
|
<DisclosureButton
|
||||||
|
class="flex w-full items-start justify-between text-left text-zinc-100"
|
||||||
|
>
|
||||||
|
<span class="text-base/7 font-semibold">Advanced options</span>
|
||||||
|
<span class="ml-6 flex h-7 items-center">
|
||||||
|
<ChevronUpIcon v-if="!open" class="size-6" aria-hidden="true" />
|
||||||
|
<ChevronDownIcon v-else class="size-6" aria-hidden="true" />
|
||||||
|
</span>
|
||||||
|
</DisclosureButton>
|
||||||
|
</dt>
|
||||||
|
<DisclosurePanel as="dd" class="mt-2 flex flex-col gap-y-4">
|
||||||
|
<SwitchGroup as="div" class="flex items-center justify-between">
|
||||||
|
<span class="flex flex-grow flex-col">
|
||||||
|
<SwitchLabel
|
||||||
|
as="span"
|
||||||
|
class="text-sm font-medium leading-6 text-zinc-100"
|
||||||
|
passive
|
||||||
|
>Override UMU Launcher Game ID</SwitchLabel
|
||||||
|
>
|
||||||
|
<SwitchDescription as="span" class="text-sm text-zinc-400"
|
||||||
|
>By default, Drop uses a non-ID when launching with UMU
|
||||||
|
Launcher. In order to get the right patches for some games, you
|
||||||
|
may have to manually set this field.</SwitchDescription
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
<Switch
|
||||||
|
v-model="umuIdEnabled"
|
||||||
|
:class="[
|
||||||
|
umuIdEnabled ? 'bg-blue-600' : 'bg-zinc-800',
|
||||||
|
'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 focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2',
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-hidden="true"
|
||||||
|
:class="[
|
||||||
|
umuIdEnabled ? 'translate-x-5' : 'translate-x-0',
|
||||||
|
'pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out',
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
</Switch>
|
||||||
|
</SwitchGroup>
|
||||||
|
<div>
|
||||||
|
<label
|
||||||
|
for="umu-id"
|
||||||
|
class="block text-sm font-medium leading-6 text-zinc-100"
|
||||||
|
>UMU Launcher ID</label
|
||||||
|
>
|
||||||
|
<div class="mt-2">
|
||||||
|
<input
|
||||||
|
id="umu-id"
|
||||||
|
name="umu-id"
|
||||||
|
type="text"
|
||||||
|
autocomplete="umu-id"
|
||||||
|
required
|
||||||
|
:disabled="!umuIdEnabled"
|
||||||
|
v-model="umuId"
|
||||||
|
placeholder="umu-starcitizen"
|
||||||
|
class="block w-full rounded-md border-0 py-1.5 px-3 bg-zinc-950 disabled:bg-zinc-900/80 text-zinc-100 disabled:text-zinc-400 shadow-sm ring-1 ring-inset ring-zinc-700 disabled:ring-zinc-800 placeholder:text-zinc-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</DisclosurePanel>
|
||||||
|
</Disclosure>
|
||||||
|
|
||||||
<LoadingButton
|
<LoadingButton
|
||||||
@click="startImport_wrapper"
|
@click="startImport_wrapper"
|
||||||
class="w-fit"
|
class="w-fit"
|
||||||
@ -218,9 +284,13 @@ import {
|
|||||||
SwitchDescription,
|
SwitchDescription,
|
||||||
SwitchGroup,
|
SwitchGroup,
|
||||||
SwitchLabel,
|
SwitchLabel,
|
||||||
|
Disclosure,
|
||||||
|
DisclosureButton,
|
||||||
|
DisclosurePanel,
|
||||||
} from "@headlessui/vue";
|
} from "@headlessui/vue";
|
||||||
import { XCircleIcon } from "@heroicons/vue/16/solid";
|
import { XCircleIcon } from "@heroicons/vue/16/solid";
|
||||||
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||||
|
import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/vue/24/solid";
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: "admin",
|
layout: "admin",
|
||||||
@ -243,6 +313,20 @@ const versionSettings = ref<
|
|||||||
>();
|
>();
|
||||||
const delta = ref(false);
|
const delta = ref(false);
|
||||||
|
|
||||||
|
const _umuId = ref("");
|
||||||
|
const umuIdEnabled = ref(false);
|
||||||
|
const umuId = computed({
|
||||||
|
get() {
|
||||||
|
if (umuIdEnabled.value) return _umuId.value;
|
||||||
|
return undefined;
|
||||||
|
},
|
||||||
|
set(v) {
|
||||||
|
if (umuIdEnabled.value && v) {
|
||||||
|
_umuId.value = v;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const importLoading = ref(false);
|
const importLoading = ref(false);
|
||||||
const importError = ref<string | undefined>();
|
const importError = ref<string | undefined>();
|
||||||
|
|
||||||
@ -272,7 +356,7 @@ async function startImport() {
|
|||||||
platform: versionSettings.value.platform,
|
platform: versionSettings.value.platform,
|
||||||
startup: versionSettings.value.startup,
|
startup: versionSettings.value.startup,
|
||||||
setup: versionSettings.value.setup,
|
setup: versionSettings.value.setup,
|
||||||
delta: delta.value
|
delta: delta.value,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
router.push(`/admin/task/${taskId.taskId}`);
|
router.push(`/admin/task/${taskId.taskId}`);
|
||||||
|
|||||||
@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "GameVersion" ADD COLUMN "umuIdOverride" TEXT;
|
||||||
@ -44,6 +44,7 @@ model GameVersion {
|
|||||||
platform Platform
|
platform Platform
|
||||||
launchCommand String // Command to run to start. Platform-specific. Windows games on Linux will wrap this command in Proton/Wine
|
launchCommand String // Command to run to start. Platform-specific. Windows games on Linux will wrap this command in Proton/Wine
|
||||||
setupCommand String // Command to setup game (dependencies and such)
|
setupCommand String // Command to setup game (dependencies and such)
|
||||||
|
umuIdOverride String?
|
||||||
dropletManifest Json // Results from droplet
|
dropletManifest Json // Results from droplet
|
||||||
|
|
||||||
versionIndex Int
|
versionIndex Int
|
||||||
|
|||||||
@ -12,6 +12,7 @@ export default defineEventHandler(async (h3) => {
|
|||||||
const startup = body.startup;
|
const startup = body.startup;
|
||||||
const setup = body.setup ?? "";
|
const setup = body.setup ?? "";
|
||||||
const delta = body.delta ?? false;
|
const delta = body.delta ?? false;
|
||||||
|
const umuId = body.umuId;
|
||||||
|
|
||||||
// startup & delta require more complex checking logic
|
// startup & delta require more complex checking logic
|
||||||
if (!gameId || !versionName || !platform)
|
if (!gameId || !versionName || !platform)
|
||||||
@ -21,6 +22,12 @@ export default defineEventHandler(async (h3) => {
|
|||||||
"ID, version, platform, setup, and startup (if not in update mode) are required.",
|
"ID, version, platform, setup, and startup (if not in update mode) are required.",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (umuId && typeof umuId !== "string")
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: "If specified, UMU ID must be a string.",
|
||||||
|
});
|
||||||
|
|
||||||
if (!delta && !startup)
|
if (!delta && !startup)
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
@ -46,6 +53,7 @@ export default defineEventHandler(async (h3) => {
|
|||||||
platform,
|
platform,
|
||||||
startup,
|
startup,
|
||||||
setup,
|
setup,
|
||||||
|
umuId,
|
||||||
},
|
},
|
||||||
delta
|
delta
|
||||||
);
|
);
|
||||||
|
|||||||
@ -208,7 +208,12 @@ class LibraryManager {
|
|||||||
async importVersion(
|
async importVersion(
|
||||||
gameId: string,
|
gameId: string,
|
||||||
versionName: string,
|
versionName: string,
|
||||||
metadata: { platform: string; setup: string; startup: string },
|
metadata: {
|
||||||
|
platform: string;
|
||||||
|
setup: string;
|
||||||
|
startup: string;
|
||||||
|
umuId: string | undefined;
|
||||||
|
},
|
||||||
delta = false
|
delta = false
|
||||||
) {
|
) {
|
||||||
const taskId = `import:${gameId}:${versionName}`;
|
const taskId = `import:${gameId}:${versionName}`;
|
||||||
@ -264,6 +269,7 @@ class LibraryManager {
|
|||||||
platform: platform,
|
platform: platform,
|
||||||
setupCommand: metadata.setup,
|
setupCommand: metadata.setup,
|
||||||
launchCommand: metadata.startup,
|
launchCommand: metadata.startup,
|
||||||
|
umuIdOverride: metadata.umuId,
|
||||||
dropletManifest: manifest,
|
dropletManifest: manifest,
|
||||||
versionIndex: currentIndex,
|
versionIndex: currentIndex,
|
||||||
delta: delta,
|
delta: delta,
|
||||||
|
|||||||
Reference in New Issue
Block a user