feat: display module for chunithm

Also make the progress bar all shiny
This commit is contained in:
2025-04-12 17:33:39 +00:00
parent 7db36b7bc0
commit 6270fce05f
17 changed files with 188 additions and 83 deletions

View File

@ -5,6 +5,7 @@ import ConfirmDialog from 'primevue/confirmdialog';
import Dialog from 'primevue/dialog';
import InputIcon from 'primevue/inputicon';
import InputText from 'primevue/inputtext';
import ProgressBar from 'primevue/progressbar';
import ScrollPanel from 'primevue/scrollpanel';
import Tab from 'primevue/tab';
import TabList from 'primevue/tablist';
@ -43,7 +44,7 @@ const isProfileDisabled = computed(() => prf.current === null);
const updateProgress: Ref<number | null> = ref(null);
listen<number>('update-progress', (ev) => {
updateProgress.value = ev.payload;
updateProgress.value = Math.floor(ev.payload * 100);
});
listen<undefined>('update-end', (_) => {
@ -152,7 +153,7 @@ listen<{ message: string; header: string }>('invoke-error', (event) => {
header="Updating"
:style="{ width: '200px' }"
>
{{ ((updateProgress ?? 0) * 100).toFixed(0) }}%
<ProgressBar :value="updateProgress ?? undefined" />
</Dialog>
<Tabs
@ -331,4 +332,10 @@ body {
.p-tooltip {
min-width: 300px;
}
.p-progressbar,
.p-progressbar-value,
.p-progressbar-label {
transition-duration: 0s !important;
}
</style>

View File

@ -69,10 +69,21 @@ prf.reload();
<template>
<SegatoolsOptions />
<DisplayOptions v-if="prf.current!.meta.game === 'ongeki'" />
<DisplayOptions />
<NetworkOptions />
<AimeOptions />
<MiscOptions />
<OptionCategory
title="Extensions"
v-if="prf.current!.meta.game === 'chunithm'"
>
<OptionRow title="Saekawa config">
<FileEditor
filename="saekawa.toml"
promptname="saekawa config file"
extension="toml"
/> </OptionRow
></OptionCategory>
<OptionCategory
title="Extensions"
v-if="prf.current!.meta.game === 'ongeki'"

View File

@ -19,6 +19,7 @@ defineProps({
name: String,
tooltip: String,
type: String,
defaultValue: Number,
});
</script>
@ -29,6 +30,10 @@ defineProps({
:model-value="prf.current!.data.patches[id!] !== undefined"
@update:model-value="(v: boolean) => toggleUnary(id!, v)"
/>
<InputNumber v-else class="number-input" />
<InputNumber
v-else
class="number-input"
:placeholder="(defaultValue ?? 0).toString()"
/>
</OptionRow>
</template>

View File

@ -11,8 +11,8 @@ const prf = usePrfStore();
prf.reload();
const gamePatches: Ref<Patch[]> = ref([]);
const amdPatches: Ref<Patch[]> = ref([]);
const gamePatches: Ref<Patch[] | null> = ref(null);
const amdPatches: Ref<Patch[] | null> = ref(null);
invoke('list_patches', { target: prf.current!.data.sgt.target }).then(
(patches) => {
@ -29,25 +29,40 @@ invoke('list_patches', { target: prf.current!.data.sgt.target }).then(
target: amd,
})) as Patch[];
})();
const errorMessage =
"No compatible patches found. Make sure you're using unpacked and unpatched files.";
</script>
<template>
<OptionCategory title="chusanApp.exe" always-found>
<PatchEntry
v-if="gamePatches !== null"
v-for="p in gamePatches"
:id="p.id"
:title="p.name"
:tooltip="p.tooltip"
:type="p.type"
:default-value="p.default"
/>
<div v-if="gamePatches === null">Loading...</div>
<div v-if="gamePatches !== null && gamePatches.length === 0">
{{ errorMessage }}
</div>
</OptionCategory>
<OptionCategory title="amdaemon.exe" always-found>
<PatchEntry
v-if="amdPatches !== null"
v-for="p in amdPatches"
:id="p.id"
:title="p.name"
:tooltip="p.tooltip"
:type="p.type"
:default-value="p.default"
/>
<div v-if="gamePatches === null">Loading...</div>
<div v-if="amdPatches !== null && amdPatches.length === 0">
{{ errorMessage }}
</div>
</OptionCategory>
</template>

View File

@ -63,6 +63,11 @@ const loadDisplays = () => {
};
loadDisplays();
const game = prf.current!.meta.game;
const isVertical = game === 'ongeki';
const adjustableRez = game === 'ongeki';
const canSkipPrimarySwitch = game === 'ongeki';
</script>
<template>
@ -80,7 +85,11 @@ loadDisplays();
@show="loadDisplays"
></Select>
</OptionRow>
<OptionRow class="number-input" title="Game resolution">
<OptionRow
class="number-input"
title="Game resolution"
v-if="adjustableRez"
>
<InputNumber
class="shrink"
size="small"
@ -118,12 +127,18 @@ loadDisplays();
>
<SelectButton
v-model="prf.current!.data.display.rotation"
:options="[
{ title: 'Unchanged', value: 0 },
{ title: 'Portrait', value: 90 },
{ title: 'Portrait (flipped)', value: 270 },
]"
:allow-empty="false"
:options="
isVertical
? [
{ title: 'Portrait', value: 90 },
{ title: 'Portrait (flipped)', value: 270 },
]
: [
{ title: 'Landscape', value: 0 },
{ title: 'Landscape (flipped)', value: 180 },
]
"
:allow-empty="true"
option-label="title"
option-value="value"
:disabled="extraDisplayOptionsDisabled"
@ -135,6 +150,7 @@ loadDisplays();
title="Refresh Rate"
>
<InputNumber
v-if="game === 'ongeki'"
class="shrink"
size="small"
:min="60"
@ -143,6 +159,18 @@ loadDisplays();
v-model="prf.current!.data.display.frequency"
:disabled="extraDisplayOptionsDisabled"
/>
<SelectButton
v-if="game === 'chunithm'"
v-model="prf.current!.data.display.frequency"
:options="[
{ title: '60Hz (CVT)', value: 60 },
{ title: '120Hz (SP)', value: 120 },
]"
:allow-empty="false"
option-label="title"
option-value="value"
:disabled="extraDisplayOptionsDisabled"
/>
</OptionRow>
<OptionRow
title="Borderless fullscreen"
@ -163,7 +191,8 @@ loadDisplays();
capabilities.includes('display') &&
prf.current?.data.display.target !== 'default' &&
(prf.current!.data.display.dont_switch_primary ||
displayList.length > 2)
displayList.length > 2) &&
canSkipPrimarySwitch
"
dangerous-tooltip="Only enable this option if switching the primary display causes issues. The monitors must have a matching refresh rate."
>
@ -173,7 +202,7 @@ loadDisplays();
/>
</OptionRow>
<OptionRow
title="Unity display index"
title="Display index"
class="number-input"
v-if="
capabilities.includes('display') &&
@ -184,7 +213,7 @@ loadDisplays();
<InputNumber
class="shrink"
size="small"
:min="1"
:min="game === 'chunithm' ? 0 : 1"
:max="32"
:use-grouping="false"
v-model="prf.current!.data.display.monitor_index_override"

View File

@ -84,7 +84,7 @@ export interface DisplayConfig {
target: String;
rez: [number, number];
mode: 'Window' | 'Borderless' | 'Fullscreen';
rotation: number;
rotation: number | null;
frequency: number;
borderless_fullscreen: boolean;
dont_switch_primary: boolean;
@ -163,4 +163,5 @@ export interface Patch {
name: string;
tooltip: string;
type: undefined | 'number';
default: number;
}