Skip to content

Commit dff4e8c

Browse files
committed
move campaign to subTab of Corruption
1 parent e2a3fd7 commit dff4e8c

9 files changed

Lines changed: 204 additions & 200 deletions

File tree

Synergism.css

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ body.loading {
140140
background-color: crimson;
141141
}
142142

143-
#corrStatsBtn.active-subtab,
144-
#corrLoadoutsBtn.active-subtab {
143+
#switchCorruptionSubTab1.active-subtab,
144+
#switchCorruptionSubTab2.active-subtab,
145+
#switchCorruptionSubTab3.active-subtab {
145146
background-color: dodgerblue;
146147
}
147148

@@ -722,12 +723,7 @@ button.isEvent:hover {
722723
color: red;
723724
}
724725

725-
#campaigntab {
726-
border-color: red;
727-
color: orange;
728-
}
729-
730-
#traitstab {
726+
#corruptiontab {
731727
border-color: orange;
732728
color: red;
733729
}
@@ -3148,8 +3144,9 @@ p#ascendHotKeys {
31483144

31493145
#campaigns {
31503146
justify-content: center;
3151-
align-items: start;
3147+
align-items: center;
31523148
margin-top: 10px;
3149+
width: 90%;
31533150
}
31543151

31553152
#campaignsMain {
@@ -3317,7 +3314,13 @@ p#ascendHotKeys {
33173314
margin-bottom: 1px;
33183315
}
33193316

3320-
#traits {
3317+
#corruption {
3318+
position: relative;
3319+
padding: 0;
3320+
text-align: center;
3321+
}
3322+
3323+
#corruptionContainer {
33213324
justify-content: center;
33223325
align-items: start;
33233326

@@ -3408,8 +3411,13 @@ p#ascendHotKeys {
34083411
text-align: center;
34093412
}
34103413

3411-
#corrStatsBtn,
3412-
#corrLoadoutsBtn {
3414+
#corruptionsubtab {
3415+
align-items: center;
3416+
}
3417+
3418+
#switchCorruptionSubTab1,
3419+
#switchCorruptionSubTab2,
3420+
#switchCorruptionSubTab3 {
34133421
min-width: 120px;
34143422
max-width: 100%;
34153423
border: 2px solid;

index.html

Lines changed: 125 additions & 121 deletions
Large diffs are not rendered by default.

src/EventListeners.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,9 @@ export const generateEventHandlers = () => {
920920

921921
// CORRUPTION TAB
922922
// Part 0: Subtabs
923-
DOMCacheGetOrSet('corrStatsBtn').addEventListener('click', () => changeSubTab(Tabs.Corruption, { page: 0 }))
924-
DOMCacheGetOrSet('corrLoadoutsBtn').addEventListener('click', () => changeSubTab(Tabs.Corruption, { page: 1 }))
923+
DOMCacheGetOrSet('switchCorruptionSubTab1').addEventListener('click', () => changeSubTab(Tabs.Corruption, { page: 0 }))
924+
DOMCacheGetOrSet('switchCorruptionSubTab2').addEventListener('click', () => changeSubTab(Tabs.Corruption, { page: 1 }))
925+
DOMCacheGetOrSet('switchCorruptionSubTab3').addEventListener('click', () => changeSubTab(Tabs.Corruption, { page: 2 }))
925926

926927
// Part 1: Displays
927928
DOMCacheGetOrSet('corruptionDisplays').addEventListener('click', () => corruptionDisplay('exit'))

src/Synergism.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ import {
152152
htmlInserts,
153153
Notification,
154154
revealStuff,
155-
showCorruptionStatsLoadouts,
156155
updateChallengeDisplay,
157156
updateChallengeLevel
158157
} from './UpdateHTML'
@@ -1581,7 +1580,6 @@ const loadSynergy = () => {
15811580
corruptionLoadoutTableUpdate(false, i)
15821581
}
15831582

1584-
showCorruptionStatsLoadouts()
15851583
updateCorruptionLoadoutNames()
15861584

15871585
// For blueberry upgrades!

src/Tabs.ts

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
toggleAchievementScreen,
1313
toggleBuildingScreen,
1414
toggleChallengesScreen,
15-
toggleCorruptionLoadoutsStats,
15+
toggleCorruptionScreen,
1616
toggleCubeSubTab,
1717
toggleRuneScreen,
1818
toggleSingularityScreen
@@ -30,13 +30,12 @@ export enum Tabs {
3030
Research = 5,
3131
AntHill = 6,
3232
WowCubes = 7,
33-
Campaign = 8,
34-
Corruption = 9,
35-
Singularity = 10,
36-
Settings = 11,
37-
Shop = 12,
38-
Event = 13,
39-
Purchase = 14
33+
Corruption = 8,
34+
Singularity = 9,
35+
Settings = 10,
36+
Shop = 11,
37+
Event = 12,
38+
Purchase = 13
4039
}
4140

4241
/**
@@ -270,24 +269,25 @@ const subtabInfo: Record<Tabs, SubTab> = {
270269
}
271270
]
272271
},
273-
[Tabs.Campaign]: {
274-
subTabList: [],
275-
subtabIndex: 0
276-
},
277272
[Tabs.Corruption]: {
278-
tabSwitcher: () => toggleCorruptionLoadoutsStats,
273+
tabSwitcher: () => toggleCorruptionScreen,
279274
subtabIndex: 0,
280275
subTabList: [
281276
{
282-
subTabID: 'true',
277+
subTabID: '0',
283278
unlocked: true,
284-
buttonID: 'corrStatsBtn'
279+
buttonID: 'switchCorruptionSubTab1'
285280
},
286281
{
287-
subTabID: 'false',
282+
subTabID: '1',
288283
unlocked: true,
289-
buttonID: 'corrLoadoutsBtn'
290-
}
284+
buttonID: 'switchCorruptionSubTab2'
285+
},
286+
{
287+
subTabID: '2',
288+
unlocked: true,
289+
buttonID: 'switchCorruptionSubTab3'
290+
},
291291
]
292292
},
293293
[Tabs.Singularity]: {
@@ -642,12 +642,7 @@ tabRow.appendButton(
642642
.setType(Tabs.WowCubes)
643643
.makeDraggable()
644644
.makeRemoveable(),
645-
new $Tab({ class: 'chal11', id: 'campaigntab', i18n: 'tabs.main.campaign' })
646-
.setUnlockedState(() => player.challengecompletions[11] > 0)
647-
.setType(Tabs.Campaign)
648-
.makeDraggable()
649-
.makeRemoveable(),
650-
new $Tab({ class: 'chal11', id: 'traitstab', i18n: 'tabs.main.corruption' })
645+
new $Tab({ class: 'chal11', id: 'corruptiontab', i18n: 'tabs.main.corruption' })
651646
.setUnlockedState(() => (player.challengecompletions[11] > 0))
652647
.setType(Tabs.Corruption)
653648
.makeDraggable()

src/Themes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const toggleTheme = (initial = false, themeNumber = 1, change = false) =>
7777
DOMCacheGetOrSet('corruptionDescription').style.color = 'darkviolet'
7878
DOMCacheGetOrSet('versionnumber').style.color = 'fuchsia'
7979
DOMCacheGetOrSet('singularitytab').style.color = 'red'
80-
DOMCacheGetOrSet('traitstab').style.color = 'red'
80+
DOMCacheGetOrSet('corruptiontab').style.color = 'red'
8181
DOMCacheGetOrSet('cubetab').style.color = 'red'
8282
DOMCacheGetOrSet('ascTimeAccel').style.color = 'royalblue'
8383
DOMCacheGetOrSet('buildinghotkeys').style.color = 'lightgray'
@@ -200,7 +200,7 @@ export const toggleTheme = (initial = false, themeNumber = 1, change = false) =>
200200
DOMCacheGetOrSet('antwelcome').style.color = '#b1b1b1'
201201
DOMCacheGetOrSet('versionnumber').style.color = '#ff5aff'
202202
DOMCacheGetOrSet('singularitytab').style.color = '#ff5252'
203-
DOMCacheGetOrSet('traitstab').style.color = '#ff5252'
203+
DOMCacheGetOrSet('corruptiontab').style.color = '#ff5252'
204204
DOMCacheGetOrSet('cubetab').style.color = '#ff5252'
205205
DOMCacheGetOrSet('antspecies').style.color = '#8da9ff'
206206
DOMCacheGetOrSet('ascTimeAccel').style.color = '#97b0ff'

src/Toggles.ts

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { updateSingularityElevator, updateSingularityElevatorVisibility } from '
1212
import { format, player, resetCheck } from './Synergism'
1313
import { getActiveSubTab, subTabsInMainTab, Tabs } from './Tabs'
1414
import type { BuildingSubtab, BuyAmount, Player } from './types/Synergism'
15-
import { Alert, Confirm, Prompt, showCorruptionStatsLoadouts, updateChallengeDisplay } from './UpdateHTML'
15+
import { Alert, Confirm, Prompt, updateChallengeDisplay } from './UpdateHTML'
1616
import { visualUpdateAmbrosia, visualUpdateCubes, visualUpdateOcteracts } from './UpdateVisuals'
1717
import { Globals as G } from './Variables'
1818

@@ -937,10 +937,36 @@ export const toggleCorruptionLevel = (corr: keyof Corruptions, value: number) =>
937937
corruptionLoadoutTableUpdate(true, 0)
938938
}
939939

940-
export const toggleCorruptionLoadoutsStats = (statsStr: string) => {
941-
const stats = statsStr === 'true'
942-
player.corruptions.showStats = stats
943-
showCorruptionStatsLoadouts()
940+
export const toggleCorruptionScreen = () => {
941+
const statsButton = DOMCacheGetOrSet('switchCorruptionSubTab1')
942+
const corrLoadoutsButton = DOMCacheGetOrSet('switchCorruptionSubTab2')
943+
const campaignBtn = DOMCacheGetOrSet('switchCorruptionSubTab3')
944+
945+
if (getActiveSubTab() === 0) {
946+
DOMCacheGetOrSet('corruptionsubtab').style.display = 'flex'
947+
DOMCacheGetOrSet('campaigns').style.display = 'none'
948+
DOMCacheGetOrSet('corruptionStats').style.display = 'flex'
949+
DOMCacheGetOrSet('corruptionLoadouts').style.display = 'none'
950+
statsButton.classList.add('subtab-active')
951+
corrLoadoutsButton.classList.remove('subtab-active')
952+
campaignBtn.classList.remove('subtab-active')
953+
}
954+
if (getActiveSubTab() === 1) {
955+
DOMCacheGetOrSet('corruptionsubtab').style.display = 'flex'
956+
DOMCacheGetOrSet('campaigns').style.display = 'none'
957+
DOMCacheGetOrSet('corruptionStats').style.display = 'none'
958+
DOMCacheGetOrSet('corruptionLoadouts').style.display = 'flex'
959+
statsButton.classList.remove('subtab-active')
960+
corrLoadoutsButton.classList.add('subtab-active')
961+
campaignBtn.classList.remove('subtab-active')
962+
}
963+
if (getActiveSubTab() === 2) {
964+
DOMCacheGetOrSet('corruptionsubtab').style.display = 'none'
965+
DOMCacheGetOrSet('campaigns').style.display = 'block'
966+
statsButton.classList.remove('subtab-active')
967+
corrLoadoutsButton.classList.remove('subtab-active')
968+
campaignBtn.classList.add('subtab-active')
969+
}
944970
}
945971

946972
export const toggleAscStatPerSecond = (id: number) => {

src/UpdateHTML.ts

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import {
3838
visualUpdateAchievements,
3939
visualUpdateAnts,
4040
visualUpdateBuildings,
41-
visualUpdateCampaign,
4241
visualUpdateChallenges,
4342
visualUpdateCorruptions,
4443
visualUpdateCubes,
@@ -531,11 +530,9 @@ export const hideStuff = () => {
531530
DOMCacheGetOrSet('ants').style.display = 'none'
532531
DOMCacheGetOrSet('anttab').style.backgroundColor = ''
533532
DOMCacheGetOrSet('cubetab').style.backgroundColor = ''
534-
DOMCacheGetOrSet('campaigntab').style.backgroundColor = ''
535-
DOMCacheGetOrSet('campaigns').style.display = 'none'
536-
DOMCacheGetOrSet('traitstab').style.backgroundColor = ''
533+
DOMCacheGetOrSet('corruptiontab').style.backgroundColor = ''
537534
DOMCacheGetOrSet('cubes').style.display = 'none'
538-
DOMCacheGetOrSet('traits').style.display = 'none'
535+
DOMCacheGetOrSet('corruption').style.display = 'none'
539536
DOMCacheGetOrSet('singularity').style.display = 'none'
540537
DOMCacheGetOrSet('singularitytab').style.backgroundColor = ''
541538
DOMCacheGetOrSet('event').style.display = 'none'
@@ -609,15 +606,10 @@ export const hideStuff = () => {
609606
DOMCacheGetOrSet('cubes').style.display = 'flex'
610607
DOMCacheGetOrSet('cubetab').style.backgroundColor = 'white'
611608
}
612-
if (G.currentTab === Tabs.Campaign) {
613-
DOMCacheGetOrSet('campaigns').style.display = 'block'
614-
DOMCacheGetOrSet('campaigntab').style.backgroundColor = 'red'
615-
}
616609
if (G.currentTab === Tabs.Corruption) {
617-
DOMCacheGetOrSet('traits').style.display = 'flex'
618-
DOMCacheGetOrSet('traitstab').style.backgroundColor = 'white'
610+
DOMCacheGetOrSet('corruption').style.display = 'block'
611+
DOMCacheGetOrSet('corruptiontab').style.backgroundColor = 'white'
619612
}
620-
621613
if (G.currentTab === Tabs.Singularity) {
622614
DOMCacheGetOrSet('singularity').style.display = 'block'
623615
DOMCacheGetOrSet('singularitytab').style.backgroundColor = 'lightgoldenrodyellow'
@@ -650,7 +642,6 @@ const visualTab: Record<Tabs, () => void> = {
650642
[Tabs.Shop]: visualUpdateShop,
651643
[Tabs.AntHill]: visualUpdateAnts,
652644
[Tabs.WowCubes]: visualUpdateCubes,
653-
[Tabs.Campaign]: visualUpdateCampaign,
654645
[Tabs.Corruption]: visualUpdateCorruptions,
655646
[Tabs.Singularity]: visualUpdateSingularity,
656647
[Tabs.Event]: visualUpdateEvent,
@@ -1037,23 +1028,6 @@ export const updateChallengeLevel = (k: number) => {
10371028
}
10381029
} */
10391030

1040-
export const showCorruptionStatsLoadouts = () => {
1041-
const statsButton = DOMCacheGetOrSet('corrStatsBtn')
1042-
const corrLoadoutsButton = DOMCacheGetOrSet('corrLoadoutsBtn')
1043-
1044-
if (player.corruptions.showStats) {
1045-
DOMCacheGetOrSet('corruptionStats').style.display = 'flex'
1046-
DOMCacheGetOrSet('corruptionLoadouts').style.display = 'none'
1047-
statsButton.classList.add('subtab-active')
1048-
corrLoadoutsButton.classList.remove('subtab-active')
1049-
} else {
1050-
DOMCacheGetOrSet('corruptionStats').style.display = 'none'
1051-
DOMCacheGetOrSet('corruptionLoadouts').style.display = 'flex'
1052-
statsButton.classList.remove('subtab-active')
1053-
corrLoadoutsButton.classList.add('subtab-active')
1054-
}
1055-
}
1056-
10571031
const updateAscensionStats = () => {
10581032
let t = player.ascensionCounter
10591033
// Division by 0 is not defined

src/UpdateVisuals.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,5 +2073,3 @@ export const visualUpdateEvent = () => {
20732073
}
20742074

20752075
export const visualUpdatePurchase = () => {}
2076-
2077-
export const visualUpdateCampaign = () => {}

0 commit comments

Comments
 (0)