Skip to content

Commit

Permalink
add arena
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkIntaqt committed Dec 8, 2023
1 parent cca6bb0 commit 12e9718
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ const config = {
"4": "https://cdn.darkintaqt.com/lol/static/challenges/teamwork.svg",
"600006": legacy,
"0": legacy,
"601000": "https://lolcdn.darkintaqt.com/cdn/arena.png",
"2022000": "https://cdn.darkintaqt.com/lol/static/challenges/2022seasonal.svg",
"seasonal-retired": "https://cdn.darkintaqt.com/lol/static/challenges/retired.svg",
"2023000": "https://cdn.darkintaqt.com/lol/static/challenges/2023seasonal.svg",
"summonersrift": "https://lolcdn.darkintaqt.com/cdn/sr.svg",
"aram": "https://lolcdn.darkintaqt.com/cdn/ha.svg",
"bot": "https://lolcdn.darkintaqt.com/cdn/bot.png"
"bot": "https://lolcdn.darkintaqt.com/cdn/bot.png",
"arena": "https://lolcdn.darkintaqt.com/cdn/arena.png"
}
}

Expand Down
24 changes: 20 additions & 4 deletions src/module/Challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ class Challenges extends Component {
let enabled = {
isAram: false,
isSR: false,
isBot: false
isBot: false,
isArena: false
}

for (let i = 0; i < challenge.queueIds.length; i++) {
Expand All @@ -218,29 +219,40 @@ class Challenges extends Component {
if ([830, 840, 850].includes(queue)) {
enabled["isBot"] = true;
}
if ([1700, 1701, 1704].includes(queue)) {
enabled["isArena"] = true;
}
}

if (enabled["isAram"] && enabled["isSR"]) {
if (enabled["isAram"] && enabled["isSR"] && enabled["isAram"]) {
queueIds.push(<div key={"all " + i}>
<p>All modes</p>
<img key={0} src="https://cdn.darkintaqt.com/lol/static/lanes/FILL.png" alt="All modes" />
</div>)
} else if (enabled["isAram"] && !enabled["isSR"]) {
} else if (enabled["isAram"] && !enabled["isSR"] && !enabled["isArena"]) {
if (this.filter.gamemode.length > 0 && !this.filter.gamemode.includes("aram")) {
continue
}
queueIds.push(<div key={"aram " + i}>
<p>ARAM games only</p>
<img key={1} src={config.images.aram} alt="Aram games only" />
</div>)
} else if (!enabled["isAram"] && enabled["isSR"]) {
} else if (!enabled["isAram"] && enabled["isSR"] && !enabled["isArena"]) {
if (this.filter.gamemode.length > 0 && !this.filter.gamemode.includes("summonersrift")) {
continue
}
queueIds.push(<div key={"sr " + i}>
<p>Summoners Rift only</p>
<img key={2} src={config.images.summonersrift} alt="Summoners Rift games only" />
</div>)
} else if (enabled["isArena"] && !enabled["isSR"] && !enabled["isAram"]) {
if (this.filter.gamemode.length > 0 && !this.filter.gamemode.includes("arena")) {
continue
}
queueIds.push(<div key={"arena " + i}>
<p>Arena only</p>
<img key={2} src={config.images.arena} alt="Arena games only" />
</div>)
} else {
if (this.filter.gamemode.length > 0 && !this.filter.gamemode.includes("bot")) {
continue
Expand Down Expand Up @@ -478,6 +490,10 @@ class Challenges extends Component {
<img src={config.images.aram} alt="ARAM" />
ARAM
</button>
<button onClick={this.changeFilter} data-id="arena">
<img src={config.images.arena} alt="Arena Games" />
Arena
</button>
<button onClick={this.changeFilter} data-id="bot">
<img src={config.images.bot} alt="Bot Games" />
Bot
Expand Down

0 comments on commit 12e9718

Please sign in to comment.