Skip to content
Merged

Deploy #1724

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@
{@const currency =
currencyId < 1000000 ? wowthingData.static.currencyById.get(currencyId) : undefined}
{@const itemId = currencyId > 1000000 ? currencyId - 1000000 : 0}
{@const { amount, amountRaw, percent, tooltip } = getCurrencyData(
{@const { amount, amountRaw, percent, tooltip, weekAmount, weekMax } = getCurrencyData(
$timeStore,
character,
currency,
itemId
)}
{#if amount}
{@const good = currencyGood[currencyId]}
{@const checkAmount = weekMax ? weekAmount : amountRaw}
{@const good = currencyGood[currencyId] || weekMax || 0}
<td
class="max-width"
class:status-success={good && amountRaw >= good}
class:status-success={good && checkAmount >= good}
class:status-shrug={percent >= 50 && percent < 100}
class:status-fail={percent >= 100}
class:got-none={amount === '0' && percent === 0}
Expand Down
56 changes: 56 additions & 0 deletions apps/frontend/components/tooltips/reputation/RenownRewards.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<script lang="ts">
import type { StaticDataRenownReward } from '@/shared/stores/static/types';

type Props = { reputationId: number; rewards: StaticDataRenownReward[] };
let { reputationId, rewards }: Props = $props();

// Prey: Season 1 has "New Quest Unlocked" descriptions, useful
const useName = (level: number, index: number) =>
reputationId === 2764 &&
((level === 1 && index === 0) ||
(level === 3 && index === 0) ||
(level === 4 && index === 0));
</script>

<style lang="scss">
table {
font-size: 95%;
margin-top: 0.5rem;
width: 24rem;
}
.level {
--width: 2rem;

text-align: right;
}
.text {
--width: 100%;

text-align: left;
}
</style>

<table class="table table-striped b-t b-b">
<tbody>
{#each rewards as { level, names, toastDescriptions } (level)}
<tr>
<td class="level">{level}</td>
<td class="text">
{#each { length: names.length }, index}
{@const name = names[index]}
{@const desc = toastDescriptions[index]}
<div class="reward">
{#if useName(level, index)}
Quests - {name}
{:else if desc}
{desc}
{:else}
{name || '???'} - ???
{/if}
</div>
{/each}
</td>
</tr>
{/each}
</tbody>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,39 @@
import { Constants } from '@/data/constants';
import { wowthingData } from '@/shared/stores/data';
import type { StaticDataReputation } from '@/shared/stores/static/types';
import type { Character, CharacterReputationParagon } from '@/types';
import type { CharacterReputationParagon } from '@/types';
import type { ManualDataReputationSet } from '@/types/data/manual';
import type { CharacterProps } from '@/types/props';

import ProgressBar from '@/components/common/ProgressBar.svelte';
import RenownRewards from './RenownRewards.svelte';
import WowthingImage from '@/shared/components/images/sources/WowthingImage.svelte';

export let character: Character;
export let characterParagon: CharacterReputationParagon = undefined;
export let characterRep: number;
export let dataRep: StaticDataReputation;
export let reputation: ManualDataReputationSet = undefined;
type Props = CharacterProps & {
characterRep: number;
dataRep: StaticDataReputation;
characterParagon?: CharacterReputationParagon;
reputation?: ManualDataReputationSet;
};
let { character, characterRep, dataRep, characterParagon, reputation }: Props = $props();

let progress: number;
let tier: number;
let maxRenown = $derived(
wowthingData.static.currencyById.get(dataRep.renownCurrencyId)?.maxTotal || 1
);
let renownValue = $derived(dataRep.maxValues[0] || 2500);
let tier = $derived(Math.floor(characterRep / renownValue));
let progress = $derived(
tier < maxRenown ? characterRep % renownValue : characterParagon?.current || 0
);

$: maxRenown = wowthingData.static.currencyById.get(dataRep.renownCurrencyId)?.maxTotal || 1;
$: renownValue = dataRep.maxValues[0] || 2500;
$: {
tier = Math.floor(characterRep / renownValue);
progress = tier < maxRenown ? characterRep % renownValue : characterParagon?.current || 0;
}
let upcomingRewards = $derived(
(wowthingData.static.renownRewards[dataRep.id] || []).filter(
(reward) => reward.level > tier
)
);
</script>

<style lang="scss">
.wowthing-tooltip {
width: 15rem;
}
.tooltip-body {
padding: 0.5rem;
}
Expand All @@ -37,7 +43,7 @@
}
</style>

<div class="wowthing-tooltip">
<div class="wowthing-tooltip" style:width={upcomingRewards.length > 0 ? '25rem' : '15rem'}>
<h4 class="text-overflow">
{#if reputation?.both === undefined && character}
<WowthingImage
Expand All @@ -60,5 +66,9 @@
total={tier < maxRenown ? renownValue : characterParagon?.max}
shortText={true}
/>

{#if upcomingRewards.length > 0}
<RenownRewards reputationId={dataRep.id} rewards={upcomingRewards} />
{/if}
</div>
</div>
18 changes: 11 additions & 7 deletions apps/frontend/components/tooltips/task/TooltipTaskRow.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { Strings } from '@/data/constants';
import { taskChoreMap, taskMap } from '@/data/tasks';
import { QuestStatus } from '@/enums/quest-status';
import { iconLibrary, uiIcons } from '@/shared/icons';
Expand Down Expand Up @@ -196,13 +197,16 @@
{/if}
</td>
{:else if chore.questCount > 1}
{@const cls = getPercentStatusClass(
((chore.alwaysStarted
? Math.max(1, charTaskChore.progressCurrent)
: charTaskChore.progressCurrent) /
charTaskChore.progressTotal) *
100
)}
{@const cls =
charTaskChore.statusTexts[0] === Strings.doUnlockQuests
? 'status-fail'
: getPercentStatusClass(
((chore.alwaysStarted
? Math.max(1, charTaskChore.progressCurrent)
: charTaskChore.progressCurrent) /
charTaskChore.progressTotal) *
100
)}
<td class="error-text">
<ParsedText
text={`[|${cls}|${charTaskChore.progressCurrent}/${charTaskChore.progressTotal}]`}
Expand Down
9 changes: 9 additions & 0 deletions apps/frontend/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export abstract class Constants {
loammNiffen: 2564,
delveBrann: 2640,
delveValeera: 2744,

midnightAmani: 2696,
midnightHarati: 2704,
midnightSingulatity: 2699,
midnightSilvermoon: 2710,
};

// static JSON -> itemBonusListGroups -> match upgradeTiers IDs
Expand Down Expand Up @@ -91,3 +96,7 @@ export abstract class Constants {
armorPlate: 'item/102268',
};
}

export abstract class Strings {
static readonly doUnlockQuests = 'Do unlock quests!';
}
9 changes: 9 additions & 0 deletions apps/frontend/data/tasks/11-midnight/12-0-0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ export const midChores12_0_0: Task = {
},
],
},
{
key: 'midLostLegends',
name: 'Lost Legends',
icon: iconLibrary.gameSecretBook,
minimumLevel: 83,
accountWide: true,
questReset: DbResetType.Weekly,
questIds: [89268],
},
{
key: 'midDungeon',
name: 'Dungeon',
Expand Down
Loading
Loading