mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: more robust xp
This commit is contained in:
1 parent
c2abc94241
commit
09848c7b21
1 file changed
+40
-33
@@ -64,7 +64,12 @@ export function TechTreeSection() {
|
|||||||
[master, lineIndex],
|
[master, lineIndex],
|
||||||
);
|
);
|
||||||
const totalXp = line.reduce(
|
const totalXp = line.reduce(
|
||||||
(xp, id) => xp + (awaitedTankDefinitions[id].xp ?? 0),
|
(xp, id) =>
|
||||||
|
xp +
|
||||||
|
(awaitedTankDefinitions[id].xp === undefined ||
|
||||||
|
awaitedTankDefinitions[id].tier === 1
|
||||||
|
? 0
|
||||||
|
: awaitedTankDefinitions[id].xp),
|
||||||
0,
|
0,
|
||||||
);
|
);
|
||||||
const totalCredits = line.reduce(
|
const totalCredits = line.reduce(
|
||||||
@@ -100,39 +105,41 @@ export function TechTreeSection() {
|
|||||||
<Flex direction="column" align="center">
|
<Flex direction="column" align="center">
|
||||||
<Heading size="6">Tech tree</Heading>
|
<Heading size="6">Tech tree</Heading>
|
||||||
|
|
||||||
<Flex gap="4" align="center">
|
{master.tier > 1 && (
|
||||||
<Text color="gray" wrap="nowrap">
|
<Flex gap="4" align="center">
|
||||||
<Flex gap="1" align="center">
|
<Text color="gray" wrap="nowrap">
|
||||||
<img
|
<Flex gap="1" align="center">
|
||||||
alt="XP"
|
<img
|
||||||
src={asset('icons/currencies/xp.webp')}
|
alt="XP"
|
||||||
style={{
|
src={asset('icons/currencies/xp.webp')}
|
||||||
width: '1em',
|
style={{
|
||||||
height: '1em',
|
width: '1em',
|
||||||
objectFit: 'contain',
|
height: '1em',
|
||||||
objectPosition: 'center',
|
objectFit: 'contain',
|
||||||
}}
|
objectPosition: 'center',
|
||||||
/>
|
}}
|
||||||
{totalXp.toLocaleString()}
|
/>
|
||||||
</Flex>
|
{totalXp.toLocaleString()}
|
||||||
</Text>
|
</Flex>
|
||||||
|
</Text>
|
||||||
|
|
||||||
<Text color="gray" wrap="nowrap">
|
<Text color="gray" wrap="nowrap">
|
||||||
<Flex gap="1" align="center">
|
<Flex gap="1" align="center">
|
||||||
<img
|
<img
|
||||||
alt="Silver"
|
alt="Silver"
|
||||||
src={asset('icons/currencies/silver.webp')}
|
src={asset('icons/currencies/silver.webp')}
|
||||||
style={{
|
style={{
|
||||||
width: '1em',
|
width: '1em',
|
||||||
height: '1em',
|
height: '1em',
|
||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
objectPosition: 'center',
|
objectPosition: 'center',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{totalCredits.toLocaleString()}
|
{totalCredits.toLocaleString()}
|
||||||
</Flex>
|
</Flex>
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<ScrollArea type="hover" scrollbars="horizontal" ref={container}>
|
<ScrollArea type="hover" scrollbars="horizontal" ref={container}>
|
||||||
|
|||||||
Reference in new issue
Block a user