Skip to content
Merged

Deploy #1812

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
41 changes: 28 additions & 13 deletions apps/frontend/components/professions/recipes/AbilityRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
StaticDataSubProfession,
} from '@/shared/stores/static/types';
import type { Character } from '@/types/character';
import type { Icon } from '@/types/icons';

import FactionIcon from '@/shared/components/images/FactionIcon.svelte';
import IconifyWrapper from '@/shared/components/images/IconifyWrapper.svelte';
Expand All @@ -22,17 +23,27 @@
ability: StaticDataProfessionAbility;
characters: Character[];
profession: StaticDataProfession;
rank: number;
subProfession: StaticDataSubProfession;
};
let { ability, characters, profession, subProfession }: Props = $props();
let { ability, characters, profession, rank, subProfession }: Props = $props();

let recipes = $derived(wowthingData.static.skillLineAbilityItems[ability.id] || []);
let recipeItem = $derived(wowthingData.items.items[recipes[0]]);
let isHidden = $derived(hiddenSkillLineAbilitySpellIds.has(ability.spellId));
let isIgnored = $derived(
wowthingData.manual.ignoredSkillLineAbilitySpellIds.has(ability.spellId)
let [abilityId, spellId] = $derived(
rank > 1 ? ability.extraRanks[rank - 2] : [ability.id, ability.spellId]
);
let anyCharacterHas = $derived(characters.some((char) => char?.knownRecipes?.has(ability.id)));

let recipes = $derived(wowthingData.static.skillLineAbilityItems[abilityId] || []);
let recipeItem = $derived(wowthingData.items.items[recipes[0]]);
let isHidden = $derived(hiddenSkillLineAbilitySpellIds.has(spellId));
let isIgnored = $derived(wowthingData.manual.ignoredSkillLineAbilitySpellIds.has(spellId));
let anyCharacterHas = $derived(characters.some((char) => char?.knownRecipes?.has(abilityId)));

const rankIcons: Record<number, Icon> = {
1: iconLibrary.mynauiNumber1Circle,
2: iconLibrary.mynauiNumber2Circle,
3: iconLibrary.mynauiNumber3Circle,
4: iconLibrary.mynauiNumber4Circle,
};
</script>

<style lang="scss">
Expand All @@ -57,9 +68,9 @@
{/if}
</WowheadLink>
</span>
{:else if ability.spellId}
<WowheadLink type="spell" id={ability.spellId}>
<WowthingImage name="spell/{ability.spellId}" size={20} border={1} />
{:else if spellId}
<WowheadLink type="spell" id={spellId}>
<WowthingImage name="spell/{spellId}" size={20} border={1} />
</WowheadLink>
{:else}
<ProfessionIcon id={profession.id} border={1} />
Expand All @@ -70,12 +81,16 @@
? `quality${wowthingData.items.items[ability.itemIds[0]].quality}`
: undefined}"
>
<WowheadLink type="spell" id={ability.spellId}>
<WowheadLink type="spell" id={spellId}>
{#if ability.name}
{ability.name}
{:else}
{wowthingData.items.items[ability.itemIds[0] || 0]?.name}
{/if}

{#if ability.extraRanks.length > 0}
<IconifyWrapper cls="quality1" icon={rankIcons[rank]} scale="1.1" />
{/if}
</WowheadLink>
</td>
<td class="auctions">
Expand All @@ -85,7 +100,7 @@
target="_blank"
data-tooltip="Find auctions"
>
<IconifyWrapper icon={iconLibrary.mdiBank} />
<IconifyWrapper cls="quality1" icon={iconLibrary.mdiBank} />
</a>
{/if}
</td>
Expand All @@ -98,7 +113,7 @@
{:else}
{@const charProf =
character.professions[profession.id]?.subProfessions?.[subProfession.id]}
{@const charHas = charProf?.knownRecipes?.has?.(ability.id)}
{@const charHas = charProf?.knownRecipes?.has?.(abilityId)}
<td class="status" class:status-success={charHas} class:status-fail={!charHas}>
<YesNoIcon state={charHas} />
</td>
Expand Down
7 changes: 6 additions & 1 deletion apps/frontend/components/professions/recipes/View.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@
</tr>

{#each abilities as ability (ability.id)}
<AbilityRow {ability} {characters} {profession} {subProfession} />
{@const ranks = [1].concat(
ability.extraRanks.length > 0 ? ability.extraRanks.map((_, i) => i + 2) : []
)}
{#each ranks as rank}
<AbilityRow {ability} {rank} {characters} {profession} {subProfession} />
{/each}
{/each}
{/if}
{/each}
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/components/tooltips/reputation/hacks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function nazjatarHack(levelString: string): number {
const level = parseInt(levelString.split(' ')[1]);
const level = parseInt(levelString.split(' ').at(-1));
return level === 30 ? 0 : 6 - Math.max(0, Math.floor(level / 5));
}

Expand Down
8 changes: 4 additions & 4 deletions apps/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@iconify/json": "^2.2.537",
"@iconify/json": "^2.2.544",
"@iconify/svelte": "^5.2.2",
"@iconify/types": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^7.3.1",
Expand Down
4 changes: 4 additions & 0 deletions apps/frontend/shared/icons/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ export { default as mynauiLetterPSquare } from '~icons/mynaui/letter-p-square';
export { default as mynauiLetterRCircle } from '~icons/mynaui/letter-r-circle';
export { default as mynauiLetterSCircle } from '~icons/mynaui/letter-s-circle';
export { default as mynauiLetterWSquare } from '~icons/mynaui/letter-w-square';
export { default as mynauiNumber1Circle } from '~icons/mynaui/one-circle';
export { default as mynauiNumber2Circle } from '~icons/mynaui/two-circle';
export { default as mynauiNumber3Circle } from '~icons/mynaui/three-circle';
export { default as mynauiNumber4Circle } from '~icons/mynaui/four-circle';

export { default as notoAngryFaceWithHorns } from '~icons/noto/angry-face-with-horns';
export { default as notoBackpack } from '~icons/noto/backpack';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<script lang="ts">
import { getRenownData } from './get-renown-data';
import { Faction } from '@/enums/faction';
import { componentTooltip } from '@/shared/utils/tooltips';
import type { ManualDataReputationSet } from '@/types/data/manual';

import FactionIcon from '@/shared/components/images/FactionIcon.svelte';
import ProgressBar from '@/components/common/ProgressBar.svelte';
import TooltipReputation from '@/components/tooltips/reputation/TooltipReputation.svelte';
import WowheadLink from '@/shared/components/links/WowheadLink.svelte';
import WowthingImage from '@/shared/components/images/sources/WowthingImage.svelte';
import ProgressBar from '@/components/common/ProgressBar.svelte';

type Props = {
accountSets: [ManualDataReputationSet[], number][];
Expand Down Expand Up @@ -38,7 +40,14 @@
.icon {
flex-shrink: 0;
height: 50px;
position: relative;
width: 50px;

.faction {
top: -2px;
position: absolute;
left: 0;
}
}
.data {
--bar-height: 1.25rem;
Expand Down Expand Up @@ -87,6 +96,8 @@
reputationSetsIndex,
slug,
})}
{@const hasAlliance = !!reputationSet.alliance}
{@const hasHorde = !!reputationSet.horde}
{@const repId =
reputationSet.both?.id || reputationSet.alliance?.id || reputationSet.horde?.id}
{@const repIcon =
Expand All @@ -95,6 +106,7 @@
reputationSet.horde?.icon}
<div
class="account-rep {cls} flex-wrapper"
data-id={repId}
use:componentTooltip={{
component: TooltipReputation,
propsFunc: () => ({
Expand All @@ -109,6 +121,16 @@
<WowheadLink type="faction" id={repId}>
<WowthingImage name={repIcon} size={48} border={2} />
</WowheadLink>

{#if hasAlliance && !hasHorde}
<div class="faction drop-shadow">
<FactionIcon faction={Faction.Alliance} border={2} />
</div>
{:else if !hasAlliance && hasHorde}
<div class="faction drop-shadow">
<FactionIcon faction={Faction.Horde} border={2} />
</div>
{/if}
</div>
<div class="data">
<div class="flex-wrapper {cls}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
for (let setIndex = 0; setIndex < reputationSets.length; setIndex++) {
const reputationSet = reputationSets[setIndex];
const hasAccountWide = reputationSet.some(
(rep) => wowthingData.static.reputationById.get(rep.both?.id)?.accountWide
(rep) =>
wowthingData.static.reputationById.get(
rep.both?.id || rep.alliance?.id || rep.horde?.id
)?.accountWide
);
(hasAccountWide ? accountRet : characterRet).push([reputationSet, setIndex]);
}
Expand Down
32 changes: 23 additions & 9 deletions apps/frontend/user-home/components/reputations/get-renown-data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { brannHack, valeeraHack } from '@/components/tooltips/reputation/hacks';
import { brannHack, nazjatarHack, valeeraHack } from '@/components/tooltips/reputation/hacks';
import { Constants } from '@/data/constants';
import { wowthingData } from '@/shared/stores/data';
import { userState } from '@/user-home/state/user';
Expand Down Expand Up @@ -47,15 +47,17 @@ export function getRenownData({
character ||= userState.general.characters[0];

ret.characterRep = character.reputationData[slug].sets[reputationsIndex][reputationSetsIndex];
ret.dataRep = wowthingData.static.reputationById.get(ret.characterRep.reputationId);
ret.dataRep = wowthingData.static.reputationById.get(
ret.characterRep?.reputationId ||
reputation.both?.id ||
reputation.alliance?.id ||
reputation.horde?.id
);

const actualCharacter = ret.dataRep.accountWide
? userState.general.characterById[userState.reputations[ret.dataRep.id]?.characterId]
: character;

if (ret.dataRep.name === "Preyhunter's Journey")
console.log(ret, userState.reputations[ret.dataRep.id], actualCharacter.name);

ret.characterRep =
actualCharacter.reputationData[slug].sets[reputationsIndex][reputationSetsIndex];
const repValue =
Expand Down Expand Up @@ -88,15 +90,20 @@ export function getRenownData({
ret.repTier = findReputationTier(tiers, repValue);

if (
Constants.reputations.nazjatarFriends.includes(ret.dataRep.id) ||
ret.dataRep.id === Constants.reputations.delveBrann ||
ret.dataRep.id === Constants.reputations.delveValeera
) {
const levelMatch = ret.repTier.name.match(/(\d{1,3})$/);
if (levelMatch) {
const oof =
ret.dataRep.id === Constants.reputations.delveBrann
? brannHack(levelMatch[1])
: valeeraHack(levelMatch[1]);
let oof: number;
if (Constants.reputations.nazjatarFriends.includes(ret.dataRep.id)) {
oof = nazjatarHack(levelMatch[1]);
} else if (ret.dataRep.id === Constants.reputations.delveBrann) {
oof = brannHack(levelMatch[1]);
} else {
oof = valeeraHack(levelMatch[1]);
}
ret.cls = `reputation${oof} reputation${oof}-border`;

// Brann hack to treat him as blocks of 10 levels
Expand Down Expand Up @@ -128,5 +135,12 @@ export function getRenownData({
}
}

if (
(ret.dataRep?.id >= 2375 && ret.dataRep?.id <= 2377) ||
(ret.dataRep?.id >= 2388 && ret.dataRep?.id < 2390)
) {
console.log(ret);
}

return ret;
}
11 changes: 7 additions & 4 deletions apps/tool/Data/InstanceBonusIds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ public static partial class Hardcoded

private static readonly Dictionary<int, int> MidnightRaid = new()
{
{ 14, 13471 }, // Normal
{ 15, 13472 }, // Heroic
{ 16, 13473 }, // Mythic
{ 17, 13470 }, // LFR
{ (int)WowDifficulty.RaidLookingForRaid, 13470 },
{ (int)WowDifficulty.RaidWorld, 13470 },
{ (int)WowDifficulty.RaidNormal, 13471 },
{ (int)WowDifficulty.RaidHeroic, 13472 },
{ (int)WowDifficulty.RaidMythic, 13473 },
{ (int)WowDifficulty.RaidMythicFlex, 13473 },
};

private static readonly Dictionary<int, int> MidnightWorldBoss = new()
Expand Down Expand Up @@ -255,6 +257,7 @@ public static partial class Hardcoded
{ 1305, MidnightRaid }, // Sporefall
{ 1317, MidnightWorldBoss2 }, // The Tidebound Grotto (world boss lair)
{ 1320, MidnightRaid }, // The Venomous Abyss
{ 1324, MidnightRaid }, // The Unbinding of Kith'ix
};
}

36 changes: 19 additions & 17 deletions packages/csharp-lib/Enums/WowDifficulty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@

public enum WowDifficulty
{
NormalDungeon = 1,
HeroicDungeon = 2,
MythicKeystone = 8,
MythicDungeon = 23,
TimewalkingDungeon = 24,
DungeonNormal = 1,
DungeonHeroic = 2,
DungeonMythicKeystone = 8,
DungeonMythic = 23,
DungeonTimewalking = 24,

// Legacy Raids
Legacy10NRaid = 3,
Legacy25NRaid = 4,
Legacy10HRaid = 5,
Legacy25HRaid = 6,
LegacyLookingForRaid = 7,
Legacy40Raid = 9,
RaidLegacy10Normal = 3,
RaidLegacy25Normal = 4,
RaidLegacy10Heroic = 5,
RaidLegacy25Heroic = 6,
RaidLegacyLookingForRaid = 7,
RaidLegacy40 = 9,

// Raids
NormalRaid = 14,
HeroicRaid = 15,
MythicRaid = 16,
LookingForRaid = 17,
EventRaid = 18,
TimewalkingRaid = 33,
RaidNormal = 14,
RaidHeroic = 15,
RaidMythic = 16,
RaidLookingForRaid = 17,
RaidEvent = 18,
RaidTimewalking = 33,
RaidMythicFlex = 233,
RaidWorld = 250,
}
Loading