Skip to content
Merged

Deploy #1730

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
3 changes: 3 additions & 0 deletions apps/frontend/components/home/HomeTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import RowProfessionConcentration from './table/row/HomeTableRowProfessionConcentration.svelte';
import RowProfessionCooldowns from './table/row/HomeTableRowProfessionCooldowns.svelte';
import RowProfessionMoxie from './table/row/HomeTableRowProfessionMoxie.svelte';
import RowProfessionsV2 from './table/row/HomeTableRowProfessionsV2.svelte';
import RowProfessionWorkOrders from './table/row/HomeTableRowProfessionWorkOrders.svelte';
import RowProgress from './table/row/HomeTableRowProgress.svelte';
import RowRestedExperience from './table/row/HomeTableRowRestedExperience.svelte';
Expand Down Expand Up @@ -131,6 +132,8 @@
<RowProfessions {character} />
{:else if field === 'professionsSecondary'}
<RowProfessions {character} professionType={1} />
{:else if field === 'professionsV2'}
<RowProfessionsV2 {character} />
{:else if field === 'progress'}
<RowProgress {character} />
{:else if field === 'restedExperience'}
Expand Down
2 changes: 2 additions & 0 deletions apps/frontend/components/home/table/HomeTableGroupHead.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@
>
{:else if field === 'professions'}
<td>Professions</td>
{:else if field === 'professionsV2'}
<td>Professions</td>
{:else if field === 'professionsSecondary'}
<td>Secondary Profs</td>
{:else if field === 'progress'}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
<script lang="ts">
import { Constants } from '@/data/constants';
import { imageStrings } from '@/data/icons';
import { expansionProfessionConcentration } from '@/data/professions/cooldowns';
import { professionMoxie } from '@/data/professions/moxie';
import { ProfessionType } from '@/enums/profession-type';
import { Region } from '@/enums/region';
import { settingsState } from '@/shared/state/settings.svelte';
import { wowthingData } from '@/shared/stores/data';
import { timeStore } from '@/shared/stores/time';
import { componentTooltip } from '@/shared/utils/tooltips/component-tooltip.svelte';
import { getCurrencyData } from '@/utils/characters/get-currency-data';
import { getProfessionSortKey } from '@/utils/professions/get-profession-sort-key';
import type { StaticDataProfession } from '@/shared/stores/static/types/profession';
import type { CharacterSubProfession } from '@/types/character/profession.svelte';
import type { CharacterProps } from '@/types/props';

import Tooltip from '@/components/tooltips/professions/TooltipProfessions.svelte';
import WowthingImage from '@/shared/components/images/sources/WowthingImage.svelte';

let { character }: CharacterProps = $props();

let concentrationData = $derived(expansionProfessionConcentration[Constants.expansion]);
let professions = $derived.by(() => {
const ret: [StaticDataProfession, CharacterSubProfession, boolean][] = [];

for (const staticProfession of wowthingData.static.professionById.values()) {
if (staticProfession?.type !== ProfessionType.Primary) {
continue;
}

let best: [CharacterSubProfession, number];
for (const expansion of settingsState.expansions) {
const subProfession = staticProfession.expansionSubProfession[expansion.id];
if (subProfession) {
const characterSubProfession =
character.professions[staticProfession.id]?.subProfessions?.[
subProfession.id
];
if (characterSubProfession && expansion.id >= (best?.[1] || 0)) {
best = [characterSubProfession, expansion.id];
}
}
}

if (best) {
ret.push([staticProfession, best[0], best[1] === Constants.expansion]);
}
}

ret.sort((a, b) => getProfessionSortKey(a[0]).localeCompare(getProfessionSortKey(b[0])));

return ret;
});

let fields = $derived(['concentration', 'moxie']);

function statusClass(fullIsBad: boolean, percent: number) {
if (percent >= 100) {
return fullIsBad ? 'status-fail' : 'status-success';
} else if (percent >= 75) {
return fullIsBad ? 'status-warn' : 'status-shrug';
} else if (percent > 25 && percent < 75) {
return fullIsBad ? 'status-shrug' : 'status-warn';
} else {
return fullIsBad ? 'status-success' : 'status-fail';
}
}
</script>

<style lang="scss">
td {
padding-left: 0;
padding-right: 0;
}
.flex-wrapper {
flex-wrap: nowrap;
gap: 0.3rem;
width: 100%;
}
.professions {
display: grid;
grid-template-columns: 1fr 1fr;
width: 100%;
}
.profession {
align-items: center;
align-self: center;
display: grid;
flex-wrap: nowrap;
gap: 0.4rem;
grid-template-columns: repeat(var(--columns), 1fr);
padding: 0 0.3rem;
}
a {
--image-margin-top: 0;

align-items: center;
color: var(--color-body-text);
display: flex;
justify-content: space-between;
}
.concentration,
.moxie {
align-items: center;
display: flex;
gap: 0.2rem;
justify-content: space-between;

&:not(:first-child) {
--image-margin-top: 0;
}
}
</style>

<td class="b-l">
<div class="professions">
{#each professions as [profession, charProfession, current], index (profession.id)}
{@const currentSkill = charProfession?.skillCurrent || 0}
<div
class="profession"
class:b-l={index > 0}
style:--columns={1 + fields.length}
data-id={profession.id}
>
<a
href="#/characters/{Region[character.realm.region].toLowerCase()}-{character
.realm.slug}/{character.name}/professions/{profession.slug}"
use:componentTooltip={{
component: Tooltip,
props: {
character,
profession,
},
}}
>
<WowthingImage name={imageStrings[profession.slug]} size={20} border={1} />
<span
class:status-fail={!current || currentSkill === 0}
class:status-success={current &&
currentSkill > 0 &&
currentSkill >= charProfession.skillMax}
>
{currentSkill || '---'}
</span>
</a>

{#if current}
{#each fields as field (field)}
{#if field === 'concentration'}
{@const concCurrency = wowthingData.static.currencyById.get(
concentrationData[profession.id]
)}
{#if concCurrency}
{@const { amount, percent, tooltip } = getCurrencyData(
$timeStore,
character,
concCurrency
)}
{@const status = statusClass(
settingsState.value.professions.fullConcentrationIsBad,
percent
)}
<div class="concentration {status}" data-tooltip={tooltip}>
<WowthingImage
name="currency/{concCurrency.id}"
size={20}
border={1}
/>
<span>{amount}</span>
</div>
{:else}
<div class="concentration"></div>
{/if}
{:else if field === 'moxie'}
{@const moxieCurrency = wowthingData.static.currencyById.get(
professionMoxie[profession.id]
)}
{#if moxieCurrency}
{@const { amount, tooltip } = getCurrencyData(
$timeStore,
character,
moxieCurrency
)}
<div class="moxie" data-tooltip={tooltip}>
<WowthingImage
name="currency/{moxieCurrency.id}"
size={20}
border={1}
/>
<span>{amount}</span>
</div>
{:else}
<div class="moxie"></div>
{/if}
{/if}
{/each}
{/if}
</div>
{/each}
</div>
</td>
11 changes: 10 additions & 1 deletion apps/frontend/components/vendors/VendorsOptions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@
byType2 = ['ALL'];
}

if (browserState.current.vendors.showDragonriding) {
if (browserState.current.vendors.showDecor) {
byThing.push('D');
}
if (browserState.current.vendors.showDragonriding) {
byThing.push('F');
}
if (browserState.current.vendors.showIllusions) {
byThing.push('I');
}
Expand Down Expand Up @@ -217,6 +220,12 @@
<div class="options-container filters-container">
<span>Things:</span>

<button>
<CheckboxInput name="show_decor" bind:value={browserState.current.vendors.showDecor}
>Decor</CheckboxInput
>
</button>

<button>
<CheckboxInput
name="show_dragonriding"
Expand Down
12 changes: 10 additions & 2 deletions apps/frontend/data/tasks/11-midnight/12-0-0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const specialAssignmentUnlockToQuest: Record<number, number> = {
94743: 93438, // Special Assignment: Precision Excision
};

const specialAssignmentQuestToUnlock: Record<number, number> = Object.fromEntries(
Object.entries(specialAssignmentUnlockToQuest).map(([k, v]) => [v, parseInt(k)])
);

const specialAssignmentFunc = (index: number, isQuest: boolean) => {
return (char: Character, chore: Chore) => {
const now = timeState.slowTime;
Expand Down Expand Up @@ -57,7 +61,8 @@ const specialAssignmentFunc = (index: number, isQuest: boolean) => {

const specialAssignmentExpiry: Chore['customExpiryFunc'] = (char, scannedAt, questIds) => {
const allWorldQuests = worldQuestStore.getCachedQuests(char.region);
const worldQuest = allWorldQuests.find((wq) => wq.questId === questIds[0]);
const findQuestId = specialAssignmentQuestToUnlock[questIds[0]] || questIds[0];
const worldQuest = allWorldQuests.find((wq) => wq.questId === findQuestId);
return worldQuest?.expires || Constants.defaultTime;
};

Expand Down Expand Up @@ -248,7 +253,10 @@ export const midChores12_0_0: Task = {
accountWide: true,
questReset: DbResetType.Weekly,
questIds: [
92127, // Tracking quest?
92127,
92128,
92129, // probably
92130,
],
},
{
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/data/tasks/events/bonus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export const eventBonus: Task = {
{
key: 'delves',
name: 'Delves',
minimumLevel: 10,
minimumLevel: 90,
requiredHolidays: [Holiday.BonusDelve],
questReset: DbResetType.Weekly,
questResetForced: true,
questIds: [84776], // A Call to Delves
questIds: [93595], // A Call to Delves
},
{
key: 'dungeons',
Expand Down
4 changes: 4 additions & 0 deletions apps/frontend/enums/profession-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum ProfessionType {
Primary = 0,
Secondary = 1,
}
2 changes: 2 additions & 0 deletions apps/frontend/shared/state/browser.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ interface BrowserStateIdk {
showCosmetics: boolean;
showWeapons: boolean;

showDecor: boolean;
showDragonriding: boolean;
showIllusions: boolean;
showMounts: boolean;
Expand Down Expand Up @@ -297,6 +298,7 @@ const initialState: BrowserStateIdk = {
showCosmetics: true,
showWeapons: true,

showDecor: true,
showDragonriding: true,
showIllusions: true,
showMounts: true,
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/shared/stores/settings/types/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface SettingsView {
homeCurrencies: number[];
homeItems: number[];
homeLockouts: number[];
homeProfessionsV2: string[];
homeProgress: string[];
homeTasks: string[];

Expand Down
1 change: 1 addition & 0 deletions apps/frontend/user-home/components/settings/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const homeChoices: SettingsChoice[] = [
{ id: 'mythicPlusScore', name: 'Mythic+ score' },
{ id: 'playedTime', name: 'Played time' },
{ id: 'professions', name: 'Professions - Primary' },
{ id: 'professionsV2', name: 'Professions - Primary (V2)' },
{ id: 'professionsSecondary', name: 'Professions - Secondary' },
{ id: 'professionConcentration', name: 'Profession Concentration [Mid]' },
{ id: 'professionConcentrationTWW', name: 'Profession Concentration [TWW]' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
homeCurrencies: [],
homeItems: [],
homeLockouts: [],
homeProfessionsV2: [],
homeProgress: [],
homeTasks: [],
disabledChores: {},
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/user-home/state/lazy/vendors.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ class LazyVendorsProcessor {
);

if (
(!vendorState.showDecor && lookupType === LookupType.Decor) ||
(!vendorState.showIllusions && lookupType === LookupType.Illusion) ||
(!vendorState.showMounts && lookupType === LookupType.Mount) ||
(!vendorState.showPets && lookupType === LookupType.Pet) ||
Expand Down
Loading
Loading