@@ -64,7 +64,7 @@ import { buyGoldenQuarks, getLastUpgradeInfo, singularityPerks } from './singula
64
64
import { displayStats } from './Statistics'
65
65
import { generateExportSummary } from './Summary'
66
66
import { player , resetCheck , saveSynergy } from './Synergism'
67
- import { changeSubTab , changeTab } from './Tabs'
67
+ import { changeSubTab , Tabs } from './Tabs'
68
68
import {
69
69
buyAllTalismanResources ,
70
70
buyTalismanEnhance ,
@@ -117,7 +117,7 @@ import {
117
117
updateRuneBlessingBuyAmount
118
118
} from './Toggles'
119
119
import type { OneToFive , Player } from './types/Synergism'
120
- import { changeTabColor , Confirm } from './UpdateHTML'
120
+ import { Confirm } from './UpdateHTML'
121
121
import { shopMouseover } from './UpdateVisuals'
122
122
import {
123
123
buyConstantUpgrades ,
@@ -215,29 +215,14 @@ export const generateEventHandlers = () => {
215
215
DOMCacheGetOrSet ( 'ascendChallengeBtn' ) . addEventListener ( 'click' , ( ) => resetCheck ( 'ascensionChallenge' ) )
216
216
DOMCacheGetOrSet ( 'ascendbtn' ) . addEventListener ( 'click' , ( ) => resetCheck ( 'ascension' ) )
217
217
DOMCacheGetOrSet ( 'singularitybtn' ) . addEventListener ( 'click' , ( ) => resetCheck ( 'singularity' ) )
218
- // Part 2: Tabs (sucks)
219
- // Onmouseover Events
220
- DOMCacheGetOrSet ( 'buildingstab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'buildings' ) )
221
- DOMCacheGetOrSet ( 'upgradestab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'upgrades' ) )
222
- DOMCacheGetOrSet ( 'settingstab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'settings' ) )
223
- DOMCacheGetOrSet ( 'achievementstab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'achievements' ) )
224
- DOMCacheGetOrSet ( 'runestab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'runes' ) )
225
- DOMCacheGetOrSet ( 'challengetab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'challenge' ) )
226
- DOMCacheGetOrSet ( 'researchtab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'research' ) )
227
- DOMCacheGetOrSet ( 'shoptab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'shop' ) )
228
- DOMCacheGetOrSet ( 'anttab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'ant' ) )
229
- DOMCacheGetOrSet ( 'cubetab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'cube' ) )
230
- DOMCacheGetOrSet ( 'traitstab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'traits' ) )
231
- DOMCacheGetOrSet ( 'singularitytab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'singularity' ) )
232
- DOMCacheGetOrSet ( 'eventtab' ) . addEventListener ( 'click' , ( ) => changeTab ( 'event' ) )
233
218
234
219
// BUILDINGS TAB
235
220
// Part 1: Upper portion (Subtab toggle)
236
221
const buildingTypes = [ 'Coin' , 'Diamond' , 'Mythos' , 'Particle' , 'Tesseract' ]
237
222
for ( let index = 0 ; index < buildingTypes . length ; index ++ ) {
238
223
DOMCacheGetOrSet ( `switchTo${ buildingTypes [ index ] } Building` ) . addEventListener (
239
224
'click' ,
240
- ( ) => changeSubTab ( 'buildings' , { page : index } )
225
+ ( ) => changeSubTab ( Tabs . Buildings , { page : index } )
241
226
)
242
227
}
243
228
// Part 2: Building Amount Toggles
@@ -377,7 +362,7 @@ export const generateEventHandlers = () => {
377
362
for ( let index = 0 ; index < 4 ; index ++ ) {
378
363
DOMCacheGetOrSet ( `toggleRuneSubTab${ index + 1 } ` ) . addEventListener (
379
364
'click' ,
380
- ( ) => changeSubTab ( 'runes' , { page : index } )
365
+ ( ) => changeSubTab ( Tabs . Runes , { page : index } )
381
366
)
382
367
}
383
368
@@ -563,7 +548,7 @@ export const generateEventHandlers = () => {
563
548
for ( let index = 0 ; index < 7 ; index ++ ) {
564
549
DOMCacheGetOrSet ( `switchCubeSubTab${ index + 1 } ` ) . addEventListener (
565
550
'click' ,
566
- ( ) => changeSubTab ( 'cube' , { page : index } )
551
+ ( ) => changeSubTab ( Tabs . WowCubes , { page : index } )
567
552
)
568
553
}
569
554
@@ -754,8 +739,8 @@ export const generateEventHandlers = () => {
754
739
755
740
// CORRUPTION TAB
756
741
// Part 0: Subtabs
757
- DOMCacheGetOrSet ( 'corrStatsBtn' ) . addEventListener ( 'click' , ( ) => changeSubTab ( 'traits' , { page : 0 } ) )
758
- DOMCacheGetOrSet ( 'corrLoadoutsBtn' ) . addEventListener ( 'click' , ( ) => changeSubTab ( 'traits' , { page : 1 } ) )
742
+ DOMCacheGetOrSet ( 'corrStatsBtn' ) . addEventListener ( 'click' , ( ) => changeSubTab ( Tabs . Corruption , { page : 0 } ) )
743
+ DOMCacheGetOrSet ( 'corrLoadoutsBtn' ) . addEventListener ( 'click' , ( ) => changeSubTab ( Tabs . Corruption , { page : 1 } ) )
759
744
760
745
// Part 1: Displays
761
746
DOMCacheGetOrSet ( 'corruptionDisplays' ) . addEventListener ( 'click' , ( ) => corruptionDisplay ( 10 ) )
@@ -770,7 +755,7 @@ export const generateEventHandlers = () => {
770
755
// Part 0: Subtabs
771
756
const settingSubTabs = Array . from < HTMLElement > ( document . querySelectorAll ( '[id^="switchSettingSubTab"]' ) )
772
757
for ( const subtab of settingSubTabs ) {
773
- subtab . addEventListener ( 'click' , ( ) => changeSubTab ( 'settings' , { page : settingSubTabs . indexOf ( subtab ) } ) )
758
+ subtab . addEventListener ( 'click' , ( ) => changeSubTab ( Tabs . Settings , { page : settingSubTabs . indexOf ( subtab ) } ) )
774
759
}
775
760
776
761
const t = Array . from ( document . querySelectorAll < HTMLElement > ( 'button.statsNerds' ) )
@@ -969,13 +954,10 @@ TODO: Fix this entire tab it's utter shit
969
954
for ( let index = 0 ; index < 5 ; index ++ ) {
970
955
DOMCacheGetOrSet ( `toggleSingularitySubTab${ index + 1 } ` ) . addEventListener (
971
956
'click' ,
972
- ( ) => changeSubTab ( 'singularity' , { page : index } )
957
+ ( ) => changeSubTab ( Tabs . Singularity , { page : index } )
973
958
)
974
959
}
975
960
976
- const tabs = document . querySelectorAll < HTMLElement > ( '#tabrow > button' )
977
- tabs . forEach ( ( b ) => b . addEventListener ( 'click' , ( ) => changeTabColor ( ) ) )
978
-
979
961
// EVENT TAB (Replace as events are created)
980
962
DOMCacheGetOrSet ( 'unsmith' ) . addEventListener ( 'click' , ( ) => clickSmith ( ) )
981
963
0 commit comments