update relic bar
All checks were successful
Gitea Auto Deploy / Deploy-Container (push) Successful in 2m22s

This commit is contained in:
2025-08-19 09:46:57 +07:00
parent 2b1d0b39a6
commit badd66daaf
8 changed files with 136 additions and 84 deletions

View File

@@ -242,6 +242,9 @@
"hardMode": "困难模式", "hardMode": "困难模式",
"selectPEAKEvent": "选择 PEAK 事件", "selectPEAKEvent": "选择 PEAK 事件",
"mode": "模式", "mode": "模式",
"selectMode": "选择模式" "selectMode": "选择模式",
"rollBack": "回到之前的状态",
"upRoll": "增加副属性",
"downRoll": "减少副属性"
} }
} }

View File

@@ -243,7 +243,10 @@
"hardMode": "Hard Mode", "hardMode": "Hard Mode",
"selectPEAKEvent": "Select PEAK Event", "selectPEAKEvent": "Select PEAK Event",
"mode": "Mode", "mode": "Mode",
"selectMode": "Select a mode" "selectMode": "Select a mode",
"rollBack": "Roll Back",
"upRoll": "Up Roll",
"downRoll": "Down Roll"
} }
} }

View File

@@ -242,6 +242,9 @@
"hardMode": "困難モード", "hardMode": "困難モード",
"selectPEAKEvent": "PEAK イベントを選択", "selectPEAKEvent": "PEAK イベントを選択",
"mode": "モード", "mode": "モード",
"selectMode": "モードを選択" "selectMode": "モードを選択",
"rollBack": "前の状態に戻る",
"upRoll": "サブステータスを増やす",
"downRoll": "サブステータスを減らす"
} }
} }

View File

@@ -242,6 +242,9 @@
"hardMode": "어려움 모드", "hardMode": "어려움 모드",
"selectPEAKEvent": "PEAK 이벤트 선택", "selectPEAKEvent": "PEAK 이벤트 선택",
"mode": "모드", "mode": "모드",
"selectMode": "모드를 선택" "selectMode": "모드를 선택",
"rollBack": "이전 상태로 되돌리기",
"upRoll": "부옵션 추가",
"downRoll": "부옵션 감소"
} }
} }

View File

@@ -163,15 +163,15 @@
"set": "Bộ", "set": "Bộ",
"pleaseSelectASet": "Vui lòng chọn một bộ", "pleaseSelectASet": "Vui lòng chọn một bộ",
"effectBonus": "Hiệu ứng cộng thêm", "effectBonus": "Hiệu ứng cộng thêm",
"totalRoll": "Tổng lượt lăn", "totalRoll": "Tổng số dòng",
"randomizeStats": "Ngẫu nhiên chỉ số", "randomizeStats": "Ngẫu nhiên chỉ số",
"randomizeRolls": "Ngẫu nhiên lượt lăn", "randomizeRolls": "Ngẫu nhiên số dòng",
"selectASubStat": "Chọn chỉ số phụ", "selectASubStat": "Chọn chỉ số phụ",
"selectASet": "Chọn một bộ", "selectASet": "Chọn một bộ",
"selectAMainStat": "Chọn chỉ số chính", "selectAMainStat": "Chọn chỉ số chính",
"save": "Lưu", "save": "Lưu",
"reset": "Đặt lại", "reset": "Đặt lại toàn bộ",
"roll": "Sô lượt", "roll": "Số dòng",
"step": "Bước nhảy", "step": "Bước nhảy",
"memoryOfChaos": "Hồi ức hỗn độn", "memoryOfChaos": "Hồi ức hỗn độn",
"pureFiction": "Kể chuyện hư cấu", "pureFiction": "Kể chuyện hư cấu",
@@ -242,6 +242,9 @@
"hardMode": "Chế độ khó", "hardMode": "Chế độ khó",
"selectPEAKEvent": "Chọn sự kiện", "selectPEAKEvent": "Chọn sự kiện",
"mode": "Chế độ", "mode": "Chế độ",
"selectMode": "Chọn chế độ" "selectMode": "Chọn chế độ",
"rollBack": "Quay lại bước trước",
"upRoll": "Tăng dòng",
"downRoll": "Giảm dòng"
} }
} }

View File

@@ -242,6 +242,9 @@
"hardMode": "困难模式", "hardMode": "困难模式",
"selectPEAKEvent": "选择 PEAK 事件", "selectPEAKEvent": "选择 PEAK 事件",
"mode": "模式", "mode": "模式",
"selectMode": "选择模式" "selectMode": "选择模式",
"rollBack": "回到之前的状态",
"upRoll": "增加副属性",
"downRoll": "减少副属性"
} }
} }

View File

@@ -74,7 +74,7 @@ export default function CopyImport() {
} }
setMessage({ setMessage({
type: "success", type: "success",
text: transI18n("selectedAll") text: transI18n("selectAll")
}) })
}; };

View File

@@ -13,6 +13,7 @@ import useRelicMakerStore from '@/stores/relicMakerStore';
import { toast } from 'react-toastify'; import { toast } from 'react-toastify';
import { useTranslations } from 'next-intl'; import { useTranslations } from 'next-intl';
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
import { ChevronDown, ChevronUp } from 'lucide-react';
export default function RelicMaker() { export default function RelicMaker() {
const { avatars, setAvatars } = useUserDataStore() const { avatars, setAvatars } = useUserDataStore()
@@ -344,85 +345,118 @@ export default function RelicMaker() {
</div> </div>
</div> </div>
{listSelectedSubStats.map((v, index) => ( {listSelectedSubStats.map((v, index) => (
<div key={index} className={`bg-base-100 rounded-xl p-4 border border-slate-700`}> <div key={index} className={`bg-base-100 rounded-xl p-4 border border-slate-700`}>
<div className="grid grid-cols-12 gap-2 items-center"> <div className="grid grid-cols-12 gap-2 items-center">
{/* Stat Selection */} {/* Stat Selection */}
<div className="col-span-8"> <div className="col-span-8">
<SelectCustomImage <SelectCustomImage
customSet={Object.entries(subAffixOptions).map(([key, value]) => ({ customSet={Object.entries(subAffixOptions).map(([key, value]) => ({
value: key, value: key,
label: mappingStats[value.property].name + " " + mappingStats[value.property].unit, label: mappingStats[value.property].name + " " + mappingStats[value.property].unit,
imageUrl: mappingStats[value.property].icon imageUrl: mappingStats[value.property].icon
}))} }))}
excludeSet={Object.entries(exSubAffixOptions).map(([key, value]) => ({ excludeSet={Object.entries(exSubAffixOptions).map(([key, value]) => ({
value: key, value: key,
label: mappingStats[value.property].name + " " + mappingStats[value.property].unit, label: mappingStats[value.property].name + " " + mappingStats[value.property].unit,
imageUrl: mappingStats[value.property].icon imageUrl: mappingStats[value.property].icon
}))} }))}
selectedCustomSet={v.affixId} selectedCustomSet={v.affixId}
placeholder={transI18n("selectASubStat")} placeholder={transI18n("selectASubStat")}
setSelectedCustomSet={(key) => handleSubStatChange(key, index, 0, 0)} setSelectedCustomSet={(key) => handleSubStatChange(key, index, 0, 0)}
/> />
</div> </div>
{/* Current Value */} {/* Current Value */}
<div className="col-span-4 text-center flex items-center justify-center gap-2"> <div className="col-span-4 text-center flex items-center justify-center gap-2">
<span className="text-2xl font-mono">+{ }</span> <span className="text-2xl font-mono">+{ }</span>
<div className="text-xl font-bold text-info">{calcAffixBonus(subAffixOptions[v.affixId], v.stepCount, v.rollCount)}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""}</div> <div className="text-xl font-bold text-info">{calcAffixBonus(subAffixOptions[v.affixId], v.stepCount, v.rollCount)}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""}</div>
</div> </div>
{/* Roll Values */} {/* Up Roll Values */}
<div className="col-span-12 grid grid-cols-3 gap-1"> <div className="col-span-12">
<button <div className="flex items-center gap-2 mb-2">
onClick={() => handleSubStatChange(v.affixId, index, v.rollCount + 1, v.stepCount + 0)} <ChevronUp className="w-4 h-4 text-success" />
className="btn btn-sm bg-white text-slate-800 hover:bg-gray-200 border-0" <span className="text-sm font-semibold text-success">{transI18n("upRoll")}</span>
> </div>
{calcAffixBonus(subAffixOptions[v.affixId], 0 , v.rollCount + 1)}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""} <div className="grid grid-cols-3 gap-1">
</button> <button
<button onClick={() => handleSubStatChange(v.affixId, index, v.rollCount + 1, v.stepCount + 0)}
onClick={() => handleSubStatChange(v.affixId, index, v.rollCount + 1, v.stepCount + 1)} className="btn btn-sm bg-white text-slate-800 hover:bg-gray-200 border-0"
className="btn btn-sm bg-white text-slate-800 hover:bg-gray-200 border-0" >
> {calcAffixBonus(subAffixOptions[v.affixId], 0 , v.rollCount + 1)}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""}
{calcAffixBonus(subAffixOptions[v.affixId], v.stepCount + 1, v.rollCount + 1)}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""} </button>
</button> <button
<button onClick={() => handleSubStatChange(v.affixId, index, v.rollCount + 1, v.stepCount + 1)}
onClick={() => handleSubStatChange(v.affixId, index, v.rollCount + 1, v.stepCount + 2)} className="btn btn-sm bg-white text-slate-800 hover:bg-gray-200 border-0"
className="btn btn-sm bg-white text-slate-800 hover:bg-gray-200 border-0" >
> {calcAffixBonus(subAffixOptions[v.affixId], v.stepCount + 1, v.rollCount + 1)}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""}
{calcAffixBonus(subAffixOptions[v.affixId], v.stepCount + 2, v.rollCount + 1)}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""} </button>
</button> <button
</div> onClick={() => handleSubStatChange(v.affixId, index, v.rollCount + 1, v.stepCount + 2)}
className="btn btn-sm bg-white text-slate-800 hover:bg-gray-200 border-0"
>
{calcAffixBonus(subAffixOptions[v.affixId], v.stepCount + 2, v.rollCount + 1)}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""}
</button>
</div>
</div>
{/* Reset Button & Roll Info */} {/* Down Roll Values */}
<div className="col-span-12 text-center"> <div className="col-span-12">
<div className="grid grid-cols-2 gap-1 items-center justify-items-start"> <div className="flex items-center gap-2 mb-2">
<div className="flex items-center gap-2"> <ChevronDown className="w-4 h-4 text-error" />
<button <span className="text-sm font-semibold text-error">{transI18n("downRoll")}</span>
className="btn btn-error btn-sm mb-1" </div>
onClick={() => resetSubStat(index)} <div className="grid grid-cols-3 gap-1">
> <button
{transI18n("reset")} onClick={() => handleSubStatChange(v.affixId, index, Math.max(v.rollCount - 1, 0), Math.max(v.stepCount, 0))}
</button> className="btn btn-sm bg-white text-slate-800 hover:bg-gray-200 border-0"
<button >
className="btn btn-warning btn-sm mb-1" {calcAffixBonus(subAffixOptions[v.affixId], 0 , Math.max(v.rollCount - 1, 0))}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""}
onClick={() => handlerRollback(index)} </button>
> <button
- onClick={() => handleSubStatChange(v.affixId, index, Math.max(v.rollCount - 1, 0), Math.max(v.stepCount - 1, 0))}
</button> className="btn btn-sm bg-white text-slate-800 hover:bg-gray-200 border-0"
</div> >
{calcAffixBonus(subAffixOptions[v.affixId], Math.max(v.stepCount - 1, 0), Math.max(v.rollCount - 1, 0))}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""}
</button>
<button
onClick={() => handleSubStatChange(v.affixId, index, Math.max(v.rollCount - 1, 0), Math.max(v.stepCount - 2, 0))}
className="btn btn-sm bg-white text-slate-800 hover:bg-gray-200 border-0"
>
{calcAffixBonus(subAffixOptions[v.affixId], Math.max(v.stepCount - 2, 0), Math.max(v.rollCount - 1, 0))}{mappingStats?.[subAffixOptions[v.affixId]?.property]?.unit || ""}
</button>
</div>
</div>
<div className="text-lg flex items-center gap-2 text-gray-400"> {/* Reset Button & Roll Info */}
<span className="font-bold">{transI18n("roll")}: <span className="text-info">{v.rollCount}</span></span> <div className="col-span-12 text-center">
<span className="font-bold">{transI18n("step")}: <span className="text-info">{v.stepCount}</span></span> <div className="grid grid-cols-2 gap-1 items-center justify-items-start">
</div> <div className="flex items-center gap-2">
</div> <button
className="btn btn-error btn-sm mb-1"
onClick={() => resetSubStat(index)}
>
{transI18n("reset")}
</button>
<button
className="btn btn-warning btn-sm mb-1"
onClick={() => handlerRollback(index)}
>
{transI18n("rollBack")}
</button>
</div>
</div> <div className="text-lg flex items-center gap-2 text-gray-400">
<span className="font-bold">{transI18n("roll")}: <span className="text-info">{v.rollCount}</span></span>
<span className="font-bold">{transI18n("step")}: <span className="text-info">{v.stepCount}</span></span>
</div>
</div>
</div>
</div> </div>
</div> </div>
))} ))}
</div> </div>