fix: 유산 유니크 경매 후보를 종류별로 정렬
Ref의 명마, 무기, 서적, 도구 순서와 종류 내부 선언 순서를 보존한다. 선택 목록은 종류별 optgroup으로 구분하고 API·Chromium 회귀를 추가한다.
This commit is contained in:
@@ -6,6 +6,7 @@ import { trpc } from '../utils/trpc';
|
||||
type InheritStatus = Awaited<ReturnType<typeof trpc.inherit.getStatus.query>>;
|
||||
type InheritLog = Awaited<ReturnType<typeof trpc.inherit.getLogs.query>>[number];
|
||||
type JoinConfig = Awaited<ReturnType<typeof trpc.join.getConfig.query>>;
|
||||
type UniqueItemSlot = InheritStatus['availableUnique'][number]['slot'];
|
||||
|
||||
type BuffKey =
|
||||
| 'warAvoidRatio'
|
||||
@@ -67,6 +68,14 @@ const pointOrder = [
|
||||
'betting',
|
||||
] as const;
|
||||
|
||||
const uniqueItemSlotOrder: readonly UniqueItemSlot[] = ['horse', 'weapon', 'book', 'item'];
|
||||
const uniqueItemSlotLabels: Record<UniqueItemSlot, string> = {
|
||||
horse: '명마',
|
||||
weapon: '무기',
|
||||
book: '서적',
|
||||
item: '도구',
|
||||
};
|
||||
|
||||
const pointHelp: Record<string, string> = {
|
||||
previous: '이전에 물려받은 포인트입니다.',
|
||||
lived_month: '살아남은 기간입니다. (1개월 단위)',
|
||||
@@ -196,6 +205,15 @@ const specialNameMap = computed(() => {
|
||||
const selectedSpecialWarInfo = computed(
|
||||
() => status.value?.availableSpecialWar.find((entry) => entry.key === nextSpecialKey.value)?.info ?? ''
|
||||
);
|
||||
const availableUniqueGroups = computed(() =>
|
||||
uniqueItemSlotOrder
|
||||
.map((slot) => ({
|
||||
slot,
|
||||
label: uniqueItemSlotLabels[slot],
|
||||
items: status.value?.availableUnique.filter((item) => item.slot === slot) ?? [],
|
||||
}))
|
||||
.filter((group) => group.items.length > 0)
|
||||
);
|
||||
|
||||
const buffCost = (key: BuffKey, target: number): number => {
|
||||
const points = status.value?.inheritConst.inheritBuffPoints ?? [0, 0, 0, 0, 0, 0];
|
||||
@@ -518,9 +536,11 @@ onMounted(() => {
|
||||
<label for="specific-unique">유니크 경매</label>
|
||||
<select id="specific-unique" v-model="uniqueForm.itemId">
|
||||
<option disabled value="">유니크 선택</option>
|
||||
<option v-for="item in status.availableUnique" :key="item.key" :value="item.key">
|
||||
{{ item.name }}
|
||||
</option>
|
||||
<optgroup v-for="group in availableUniqueGroups" :key="group.slot" :label="group.label">
|
||||
<option v-for="item in group.items" :key="item.key" :value="item.key">
|
||||
{{ item.name }}
|
||||
</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
<div class="control-row">
|
||||
|
||||
Reference in New Issue
Block a user