Skip to content

Commit 3f77b00

Browse files
committed
feat: 3.0.31 + steam login
1 parent 9951d28 commit 3f77b00

File tree

230 files changed

+1108
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+1108
-162
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Stack } from '@mui/material';
2+
import { CardTitleAndValue } from '@components/common/styles';
3+
4+
const Evertree = ({ hole }) => {
5+
return <>
6+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
7+
<CardTitleAndValue title={'Chopping eff req'} value={hole?.caverns?.evertree?.choppingEff}/>
8+
<CardTitleAndValue title={'Layer'} value={hole?.caverns?.evertree?.layer}/>
9+
<CardTitleAndValue title={'Logs'} icon={'data/MotherlodeTREE_x1.png'}
10+
imgStyle={{ width: 24, height: 24, objectFit: 'contain' }}
11+
value={`${hole?.caverns?.evertree?.logs?.chopped} / ${hole?.caverns?.evertree?.logs?.required}`}/>
12+
</Stack>
13+
</>
14+
};
15+
16+
export default Evertree;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Typography } from '@mui/material';
2+
import React from 'react';
3+
4+
const Gambit = () => {
5+
return <>
6+
<Typography textAlign={'center'} variant={'h4'}>No content for gambit yet</Typography>
7+
</>
8+
};
9+
10+
export default Gambit;
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { Card, CardContent, Divider, Stack, Typography } from '@mui/material';
2+
import { cleanUnderscore, msToDate, notateNumber, numberWithCommas, prefix } from '@utility/helpers';
3+
import { CardTitleAndValue } from '@components/common/styles';
4+
import { IconInfoCircleFilled } from '@tabler/icons-react';
5+
import Tooltip from '@components/Tooltip';
6+
7+
const TheJars = ({ hole }) => {
8+
return <>
9+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
10+
{hole?.caverns?.theJars?.rupies?.map((amount, index) => <CardTitleAndValue
11+
title={''} key={`rupie-${index}`} stackProps icon={`data/HoleJarR${index}.png`}
12+
value={amount}/>)}
13+
</Stack>
14+
<Divider sx={{ mt: 1 }}/>
15+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
16+
<CardTitleAndValue title={'Progress per hour'}
17+
value={notateNumber(hole?.caverns?.theJars?.perHour, 'Big')}/>
18+
<CardTitleAndValue title={'Progress per minute'}
19+
value={notateNumber(hole?.caverns?.theJars?.perHour / 60, 'Big')}/>
20+
<CardTitleAndValue title={'Rupie value'}
21+
value={notateNumber(hole?.caverns?.theJars?.rupieValue, 'Big')}/>
22+
<Divider orientation={'vertical'} sx={{ my: 2 }} flexItem/>
23+
{hole?.caverns?.theJars?.activeSlots?.map(({ progress, req, jarType }, index) => <CardTitleAndValue
24+
title={'Rupie value'} key={`slots-${index}`}
25+
icon={`etc/Jar_${jarType}.png`}
26+
imgStyle={{ width: 26, height: 26 }}
27+
value={`${numberWithCommas(Math.floor(progress))} / ${numberWithCommas(Math.floor(req))}`}/>)}
28+
</Stack>
29+
<Divider sx={{ mb: 2 }}/>
30+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
31+
{hole?.caverns?.theJars?.jars?.map(({ name, unlocked, req, effect, perHour }, index) => {
32+
return <Card key={`jar-${index}`}>
33+
<CardContent sx={{
34+
width: 350,
35+
minHeight: 215,
36+
opacity: unlocked ? 1 : .5
37+
}}>
38+
<Stack direction={'row'} alignItems={'center'} gap={1}>
39+
<img style={{ width: 26, height: 26, objectFit: 'contain' }} src={`${prefix}etc/Jar_${index}.png`}
40+
alt={`jar-${index}`}/>
41+
<Typography variant={'body1'}>{cleanUnderscore(name)}</Typography>
42+
</Stack>
43+
<Typography sx={{ height: 41, display: 'flex', alignItems: 'center' }}
44+
variant={'body1'}>{effect}</Typography>
45+
<Divider sx={{ mt: .5, mb: 1 }}/>
46+
<Stack direction={'row'} alignItems={'center'} gap={1}>
47+
<Typography variant={'body1'}>Jars per
48+
hour: {Math.floor(hole?.caverns?.theJars?.perHour / req)}</Typography>
49+
<Tooltip title={<Stack>
50+
<Typography variant={'body2'}>2
51+
slots: {Math.floor((hole?.caverns?.theJars?.perHour * 2) / req)} / hr</Typography>
52+
<Typography variant={'body2'}>3
53+
slots: {Math.floor((hole?.caverns?.theJars?.perHour * 3) / req)} / hr</Typography>
54+
</Stack>}>
55+
<IconInfoCircleFilled size={18}/>
56+
</Tooltip>
57+
</Stack>
58+
<Typography variant={'body1'}>Time to
59+
full: {msToDate(req / hole?.caverns?.theJars?.perHour * 1000 * 3600)}</Typography>
60+
<Typography variant={'body1'}>Req: {numberWithCommas(Math.floor(req))}</Typography>
61+
</CardContent>
62+
</Card>
63+
})}
64+
</Stack>
65+
</>
66+
};
67+
68+
export default TheJars;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Card, CardContent, Divider, Stack, Typography } from '@mui/material';
2+
import { CardTitleAndValue } from '@components/common/styles';
3+
import { cleanUnderscore, commaNotation } from '@utility/helpers';
4+
import React from 'react';
5+
6+
const TheTemple = ({ hole }) => {
7+
return <>
8+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
9+
<CardTitleAndValue title={'Torches'} value={Math.floor(hole?.caverns?.theTemple?.torches)}
10+
imgStyle={{ width: 32, height: 32, marginBottom: -10, marginRight: -10 }} icon={'data/HoleUIbuildUpg77.png'}/>
11+
<CardTitleAndValue title={'Layer'} value={hole?.caverns?.theTemple?.layer}/>
12+
</Stack>
13+
<Divider sx={{ my: 2 }}/>
14+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
15+
{hole?.caverns?.theTemple?.bonuses?.map(({ name, description, cost }, index) => {
16+
return <Card key={`bonus-${index}`}>
17+
<CardContent sx={{ width: 300 }}>
18+
<Typography variant={'body1'} sx={{ fontWeight: 'bold' }}>{cleanUnderscore(name)}</Typography>
19+
<Typography mt={2}>{cleanUnderscore(description)}</Typography>
20+
<Stack direction={'row'} alignItems={'center'} mt={2} gap={1}>
21+
<Typography variant={'body2'}>Cost: {commaNotation(cost)}</Typography>
22+
</Stack>
23+
</CardContent>
24+
</Card>
25+
})}
26+
</Stack>
27+
</>
28+
};
29+
30+
export default TheTemple;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Typography } from '@mui/material';
2+
import React from 'react';
3+
4+
const Wisdom = () => {
5+
return <>
6+
<Typography textAlign={'center'} variant={'h4'}>No content for wisdom yet</Typography>
7+
</>
8+
};
9+
10+
export default Wisdom;

components/account/Worlds/World5/Hole/Engineer.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { Card, CardContent, Checkbox, FormControlLabel, Stack, Typography } from
44
import { cleanUnderscore, commaNotation, msToDate, notateNumber, prefix } from '@utility/helpers';
55

66
const Engineer = ({ hole }) => {
7-
const [,engineer] = hole?.villagers || [];
7+
const [, engineer] = hole?.villagers || [];
88
const [showAll, setShowAll] = useState(false);
99
return <>
1010
<Stack mb={1} direction={'row'} gap={{ xs: 1, md: 3 }} flexWrap={'wrap'}>
1111
<CardTitleAndValue title={'Level'} value={engineer?.level}/>
1212
<CardTitleAndValue title={'Exp'} value={`${engineer?.exp} / ${engineer?.expReq}`}/>
1313
<CardTitleAndValue title={'Exp rate'} value={`${commaNotation(engineer?.expRate)} / hr`}/>
14-
<CardTitleAndValue title={'Time to level'} value={engineer?.timeLeft >= 0 && engineer?.expRate > 0 ? msToDate(engineer?.timeLeft) : '0'}/>
14+
<CardTitleAndValue title={'Time to level'}
15+
value={engineer?.timeLeft >= 0 && engineer?.expRate > 0 ? msToDate(engineer?.timeLeft) : '0'}/>
1516
<CardTitleAndValue title={'Unlocked schematics'} value={`${hole?.unlockedSchematics} / 56`}/>
1617
<CardTitleAndValue title={'Opals invested'} value={engineer?.opalInvested || '0'} icon={'data/Opal.png'}
1718
imgStyle={{ width: 22, height: 22 }}/>
@@ -23,7 +24,7 @@ const Engineer = ({ hole }) => {
2324
<Stack direction={'row'} gap={{ xs: 1, md: 3 }} flexWrap={'wrap'}>
2425
{hole?.engineerBonuses?.map(({ index, name, description, unlocked, owned, cost, x2 }, order) => {
2526
if (!showAll && unlocked) return null;
26-
const img = x2 >= 10 ? `HoleHarpNote${x2 - 10}` : `HoleWellFill${x2 + 1}`;
27+
const img = x2 >= 20 ? `HoleJarR${x2 - 20}` : x2 >= 10 ? `HoleHarpNote${x2 - 10}` : `HoleWellFill${x2 + 1}`;
2728
return <Card key={`upgrade-${index}`}>
2829
<CardContent sx={{ width: 400, opacity: hole?.unlockedSchematics > order ? 1 : 0.5 }}>
2930
<Stack direction={'row'} alignItems={'center'}>

components/account/Worlds/World5/Hole/Explore.jsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Divider, Stack } from '@mui/material';
2+
import { Divider, Stack, useMediaQuery } from '@mui/material';
33
import { CardTitleAndValue } from '@components/common/styles';
44
import { commaNotation, fillArrayToLength, getTabs, msToDate } from '@utility/helpers';
55
import Tabber from '@components/common/Tabber';
@@ -14,10 +14,16 @@ import TheHive from '@components/account/Worlds/World5/Hole/Caverns/TheHive';
1414
import Grotto from '@components/account/Worlds/World5/Hole/Caverns/Grotto';
1515
import Justice from '@components/account/Worlds/World5/Hole/Caverns/Justice';
1616
import { PAGES } from '@components/constants';
17+
import TheJars from '@components/account/Worlds/World5/Hole/Caverns/TheJars';
18+
import Evertree from '@components/account/Worlds/World5/Hole/Caverns/Evertree';
19+
import Wisdom from '@components/account/Worlds/World5/Hole/Caverns/Wisdom';
20+
import Gambit from '@components/account/Worlds/World5/Hole/Caverns/Gambit';
21+
import TheTemple from '@components/account/Worlds/World5/Hole/Caverns/TheTemple';
1722

1823
const Explore = ({ hole }) => {
24+
const breakpoint = useMediaQuery('(max-width: 1600px)', { noSsr: true });
1925
const [explore] = hole?.villagers || [];
20-
const caverns = fillArrayToLength(10);
26+
const caverns = fillArrayToLength(15);
2127
return <>
2228
<Stack mb={1} direction={'row'} gap={{ xs: 1, md: 3 }} flexWrap={'wrap'}>
2329
<CardTitleAndValue title={'Level'} value={explore?.level}/>
@@ -32,6 +38,7 @@ const Explore = ({ hole }) => {
3238
<Tabber
3339
queryKey={'nt'}
3440
iconsOnly
41+
forceScroll={breakpoint}
3542
tabs={getTabs(PAGES.ACCOUNT['world 5'].categories, 'hole', 'Explore')}
3643
icons={caverns.map((a, index) => `etc/Cavern_${index}`)}
3744
>
@@ -45,7 +52,11 @@ const Explore = ({ hole }) => {
4552
<TheHive hole={hole} />
4653
<Grotto hole={hole} />
4754
<Justice hole={hole} />
48-
55+
<TheJars hole={hole}/>
56+
<Evertree hole={hole}/>
57+
<Wisdom hole={hole}/>
58+
<Gambit hole={hole}/>
59+
<TheTemple hole={hole}/>
4960
</Tabber>
5061
</>
5162
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import React from 'react';
2+
import { Card, CardContent, Divider, Stack, Typography } from '@mui/material';
3+
import { CardTitleAndValue } from '@components/common/styles';
4+
import { cleanUnderscore, commaNotation, msToDate } from '@utility/helpers';
5+
6+
const colors = {
7+
0: '#c471d2',
8+
1: 'warning.light',
9+
2: 'success.light'
10+
}
11+
12+
const Study = ({ hole }) => {
13+
const [, , , , study] = hole?.villagers || [];
14+
return <>
15+
<Stack mb={1} direction={'row'} gap={{ xs: 1, md: 3 }} flexWrap={'wrap'}>
16+
<CardTitleAndValue title={'Study rate'} value={`${hole?.studies?.studyPerHour} / hr` || '0'} icon={'etc/Study_Rate.png'}
17+
imgStyle={{ width: 22, height: 22 }}/>
18+
<CardTitleAndValue title={'Level'} value={study?.level}/>
19+
<CardTitleAndValue title={'Exp'} value={`${study?.exp} / ${study?.expReq}`}/>
20+
<CardTitleAndValue title={'Exp rate'} value={`${commaNotation(study?.expRate)} / hr`}/>
21+
<CardTitleAndValue title={'Time to level'}
22+
value={study?.timeLeft >= 0 && study?.expRate > 0 ? msToDate(study?.timeLeft) : '0'}/>
23+
<CardTitleAndValue title={'Opals invested'} value={study?.opalInvested || '0'} icon={'data/Opal.png'}
24+
imgStyle={{ width: 22, height: 22 }}/>
25+
</Stack>
26+
<Divider sx={{ mb: 3 }}/>
27+
<Stack direction={'row'} gap={2} flexWrap={'wrap'} alignItems={'center'}>
28+
{hole?.studies?.studies?.map(({ name, description, level, active, progress, req, listIndex }, index) => {
29+
const nextLv = (req - progress) / hole?.studies?.studyPerHour * 1000 * 3600;
30+
return <Card key={`bonus-${index}`}>
31+
<CardContent sx={{ width: 300, height: 250 }}>
32+
<Stack direction={'row'} justifyContent={'space-between'} alignItems={'center'}>
33+
<Typography color={colors?.[listIndex]} variant={'body1'} sx={{ fontWeight: 'bold' }}>{cleanUnderscore(name)} (Lv. {level})</Typography>
34+
{active ? <Typography color={'success.light'} variant={'caption'}>ACTIVE</Typography> : null}
35+
</Stack>
36+
<Typography mt={2}>{cleanUnderscore(description)}</Typography>
37+
<Stack mt={2} gap={1}>
38+
<Typography variant={'body2'}>Progress: {commaNotation(progress)} / {commaNotation(req)}</Typography>
39+
<Typography variant={'body2'}>Next lv: {msToDate(nextLv)}</Typography>
40+
</Stack>
41+
</CardContent>
42+
</Card>
43+
})}
44+
</Stack>
45+
</>
46+
};
47+
48+
export default Study;
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { Divider, Stack, TextField, Typography } from '@mui/material';
2+
import { useContext, useState } from 'react';
3+
import { AppContext } from '@components/common/context/AppProvider';
4+
import { getSteamParams } from '../../../logins/steam';
5+
import { isValidUrl } from '@utility/helpers';
6+
import { LoadingButton } from '@mui/lab';
7+
8+
const SteamLogin = ({ setOpen }) => {
9+
const { state, dispatch, waitingForAuth, setWaitingForAuth } = useContext(AppContext);
10+
const [steamUrl, setSteamUrl] = useState('');
11+
const [error, setError] = useState('');
12+
13+
const handleOpen = () => {
14+
window.open('https://steamcommunity.com/openid/login?' +
15+
'openid.ns=http://specs.openid.net/auth/2.0&' +
16+
'openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&' +
17+
'openid.identity=http://specs.openid.net/auth/2.0/identifier_select&' +
18+
`openid.return_to=https://www.legendsofidleon.com/steamsso/&` +
19+
`openid.realm=https://www.legendsofidleon.com/steamsso/&` +
20+
'openid.mode=checkid_setup',
21+
'_blank',
22+
'popup'
23+
);
24+
}
25+
26+
return <Stack>
27+
<Typography variant={'body1'}>Click the Steam login button below to open a new tab, then sign in to your Steam
28+
account.</Typography>
29+
<img style={{ alignSelf: 'center', cursor: 'pointer' }} onClick={handleOpen}
30+
src={'https://community.fastly.steamstatic.com/public/images/signinthroughsteam/sits_01.png'}
31+
alt={'steam-login'}/>
32+
<Divider sx={{ my: 2 }}/>
33+
<Typography variant={'body1'}>After signing in, you'll be redirected to a Legend of Idleon page. Do not take any
34+
action on this page. Simply copy the URL from your browser’s address bar, return here, paste it into the box, and
35+
click 'Login'.</Typography>
36+
<Typography sx={{ mt: 1 }} variant={'caption'}>* Do not click the big blue button before copying the
37+
URL.</Typography>
38+
<TextField sx={{ mt: 2 }} error={!!error} helperText={error} value={steamUrl} onChange={(e) => {
39+
setError('');
40+
setSteamUrl(e.target.value)
41+
}} size={'small'} label={'Steam popup url'}/>
42+
<LoadingButton sx={{ mt: 2 }} loading={waitingForAuth} variant="contained" onClick={async () => {
43+
if (!isValidUrl(steamUrl)) {
44+
return setError('Please enter a valid steam url')
45+
}
46+
const token = await getSteamParams(steamUrl);
47+
if (Object.keys(token || {}).length === 0) {
48+
return setError('An error occurred while trying to login')
49+
}
50+
if (token && !token?.error) {
51+
setWaitingForAuth(true);
52+
dispatch({ type: 'login', data: { loginData: { token }, loginType: 'steam' } })
53+
} else {
54+
setError(`An error occurred while trying to login ${`- ${token?.message}` || ''}`)
55+
}
56+
}}>Login</LoadingButton>
57+
</Stack>;
58+
};
59+
60+
export default SteamLogin;
61+

components/common/Logins/SteamWorkaround.jsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)