feat: partial support for patches

This commit is contained in:
2025-04-11 15:27:13 +00:00
parent b9a40d44a8
commit 1a68eda8c1
21 changed files with 1218 additions and 583 deletions

View File

@ -0,0 +1,34 @@
<script setup lang="ts">
import InputNumber from 'primevue/inputnumber';
import ToggleSwitch from 'primevue/toggleswitch';
import OptionRow from './OptionRow.vue';
import { usePrfStore } from '../stores';
const prf = usePrfStore();
const toggleUnary = (key: string, val: boolean) => {
if (val) {
prf.current!.data.patches[key] = 'Enabled';
} else {
delete prf.current!.data.patches[key];
}
};
defineProps({
id: String,
name: String,
tooltip: String,
type: String,
});
</script>
<template>
<OptionRow :title="name" :tooltip="tooltip" :greytext="id">
<ToggleSwitch
v-if="type === undefined"
:model-value="prf.current!.data.patches[id!] !== undefined"
@update:model-value="(v: boolean) => toggleUnary(id!, v)"
/>
<InputNumber v-else class="number-input" />
</OptionRow>
</template>