-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Improve Gamemodes structure
Tried to get as close to what Goc asked for in #23 This fixes an issue with panel IDs bugging out because the shortName was used as an ID and Pano doesn't like it containing a hash
- Loading branch information
Showing
6 changed files
with
54 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,92 @@ | ||
'use strict'; | ||
|
||
const Gamemodes = { | ||
1: { | ||
const GameMode = { | ||
SURF: 1, | ||
BHOP: 2, | ||
CLIMB: 3, | ||
RJ: 4, | ||
SJ: 5, | ||
TRICKSURF: 6, | ||
AHOP: 7, | ||
PARKOUR: 8, | ||
CONC: 9, | ||
DEFRAG: 10 | ||
}; | ||
|
||
const GameModeWithNull = { | ||
UNKNOWN: 0, | ||
...GameMode | ||
}; | ||
|
||
const GameModeInfo = { | ||
[GameMode.SURF]: { | ||
idName: 'Surf', | ||
name: '#Gamemode_Surf', | ||
shortName: '#Gamemode_Surf_Short', | ||
prefix: 'surf_' | ||
}, | ||
2: { | ||
[GameMode.BHOP]: { | ||
idName: 'Bhop', | ||
name: '#Gamemode_Bhop', | ||
shortName: '#Gamemode_Bhop_Short', | ||
prefix: 'bhop_' | ||
}, | ||
3: { | ||
[GameMode.CLIMB]: { | ||
idName: 'Climb', | ||
name: '#Gamemode_Climb', | ||
shortName: '#Gamemode_Climb_Short', | ||
prefix: 'climb_' | ||
}, | ||
4: { | ||
[GameMode.RJ]: { | ||
idName: 'RJ', | ||
name: '#Gamemode_RJ', | ||
shortName: '#Gamemode_RJ_Short', | ||
prefix: 'rj_' | ||
}, | ||
5: { | ||
[GameMode.SJ]: { | ||
idName: 'SJ', | ||
name: '#Gamemode_SJ', | ||
shortName: '#Gamemode_SJ_Short', | ||
prefix: 'sj_' | ||
}, | ||
6: { | ||
[GameMode.TRICKSURF]: { | ||
idName: 'Tricksurf', | ||
name: '#Gamemode_Tricksurf', | ||
shortName: '#Gamemode_Tricksurf_Short', | ||
prefix: 'tsurf_' | ||
}, | ||
7: { | ||
[GameMode.AHOP]: { | ||
idName: 'Ahop', | ||
name: '#Gamemode_Ahop', | ||
shortName: '#Gamemode_Ahop_Short', | ||
prefix: 'ahop_' | ||
}, | ||
8: { | ||
[GameMode.PARKOUR]: { | ||
idName: 'Parkour', | ||
name: '#Gamemode_Parkour', | ||
shortName: '#Gamemode_Parkour_Short', | ||
prefix: 'pk_' | ||
}, | ||
9: { | ||
[GameMode.CONC]: { | ||
idName: 'Conc', | ||
name: '#Gamemode_Conc', | ||
shortName: '#Gamemode_Conc_Short', | ||
prefix: 'conc_' | ||
}, | ||
10: { | ||
[GameMode.DEFRAG]: { | ||
idName: 'Defrag', | ||
name: '#Gamemode_Defrag', | ||
shortName: '#Gamemode_Defrag_Short', | ||
prefix: 'df_' | ||
} | ||
}; | ||
|
||
const GamemodesWithNull = { | ||
0: { | ||
const GameModeInfoWithNull = { | ||
[GameModeWithNull.UNKNOWN]: { | ||
idName: 'Unknown', | ||
name: '#Gamemode_Unknown', | ||
shortName: '#Unknown', | ||
shortName: '#Gamemode_Unknown', | ||
prefix: '' | ||
}, | ||
...Gamemodes | ||
...GameModeInfo | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters