|
|
|
|
@ -9,6 +9,7 @@ interface QuestLogProps {
|
|
|
|
|
onClaim: (heroQuestId: number) => void;
|
|
|
|
|
onAbandon: (heroQuestId: number) => void;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
claimDisabled?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ---- Quest Type Icons ----
|
|
|
|
|
@ -167,6 +168,15 @@ const claimBtnStyle: CSSProperties = {
|
|
|
|
|
animation: 'quest-claim-glow 1.5s ease-in-out infinite',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const claimBtnDisabledStyle: CSSProperties = {
|
|
|
|
|
...claimBtnStyle,
|
|
|
|
|
opacity: 0.45,
|
|
|
|
|
cursor: 'not-allowed',
|
|
|
|
|
animation: 'none',
|
|
|
|
|
boxShadow: 'none',
|
|
|
|
|
textShadow: 'none',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const abandonBtnStyle: CSSProperties = {
|
|
|
|
|
padding: '8px 14px',
|
|
|
|
|
border: '1px solid rgba(255, 80, 80, 0.3)',
|
|
|
|
|
@ -189,10 +199,12 @@ interface QuestLogListProps {
|
|
|
|
|
quests: HeroQuest[];
|
|
|
|
|
onClaim: (heroQuestId: number) => void;
|
|
|
|
|
onAbandon: (heroQuestId: number) => void;
|
|
|
|
|
/** When true, completed-quest claim is blocked (e.g. hero dead). */
|
|
|
|
|
claimDisabled?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Quest list body (embedded in Hero sheet or standalone panel). */
|
|
|
|
|
export function QuestLogList({ quests, onClaim, onAbandon }: QuestLogListProps) {
|
|
|
|
|
export function QuestLogList({ quests, onClaim, onAbandon, claimDisabled = false }: QuestLogListProps) {
|
|
|
|
|
const tr = useT();
|
|
|
|
|
const [expandedId, setExpandedId] = useState<number | null>(null);
|
|
|
|
|
|
|
|
|
|
@ -294,9 +306,13 @@ export function QuestLogList({ quests, onClaim, onAbandon }: QuestLogListProps)
|
|
|
|
|
<div style={actionRow}>
|
|
|
|
|
{isCompleted ? (
|
|
|
|
|
<button
|
|
|
|
|
style={claimBtnStyle}
|
|
|
|
|
type="button"
|
|
|
|
|
style={claimDisabled ? claimBtnDisabledStyle : claimBtnStyle}
|
|
|
|
|
disabled={claimDisabled}
|
|
|
|
|
title={claimDisabled ? tr.claimRewardsDisabledDead : undefined}
|
|
|
|
|
onClick={(e) => {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
if (claimDisabled) return;
|
|
|
|
|
onClaim(q.id);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
@ -325,7 +341,7 @@ export function QuestLogList({ quests, onClaim, onAbandon }: QuestLogListProps)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function QuestLog({ quests, onClaim, onAbandon, onClose }: QuestLogProps) {
|
|
|
|
|
export function QuestLog({ quests, onClaim, onAbandon, onClose, claimDisabled }: QuestLogProps) {
|
|
|
|
|
const tr = useT();
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const handleKey = (e: KeyboardEvent) => {
|
|
|
|
|
@ -350,7 +366,7 @@ export function QuestLog({ quests, onClaim, onAbandon, onClose }: QuestLogProps)
|
|
|
|
|
<span style={titleStyle}>{'\uD83D\uDCDC'} {tr.questLog}</span>
|
|
|
|
|
<button style={closeBtnStyle} onClick={onClose}>{'\u2715'}</button>
|
|
|
|
|
</div>
|
|
|
|
|
<QuestLogList quests={quests} onClaim={onClaim} onAbandon={onAbandon} />
|
|
|
|
|
<QuestLogList quests={quests} onClaim={onClaim} onAbandon={onAbandon} claimDisabled={claimDisabled} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
|