Move game options to a map, clean ip index files.

This commit is contained in:
Trenton Zimmer 2024-10-14 13:01:43 -04:00
parent 4bbcbe0124
commit 64157dd2f2
5 changed files with 96 additions and 22 deletions

View File

@ -9,14 +9,14 @@
<style>
body {
background-color: #ffffff;
background-color: #1f2937;
}
@media (prefers-color-scheme: dark) {
/* @media (prefers-color-scheme: dark) {
body {
background-color: #1f2937;
}
}
} */
</style>
<script>
@ -56,7 +56,6 @@
image: "/assets/bats.png",
});
</script>
<!-- built files will be auto injected -->
<audio id="audio" src="/assets/sounds/konami.mp3" class="hidden">
</body>
</html>

View File

@ -329,6 +329,7 @@ export const gameData = [
icon: null,
cardBG: null,
noRivals: true,
useUnicode: true,
scoreHeaders: [
{ text: "Combos", value: "data.combo" },
{ text: "Medal", value: "data.medal" },
@ -376,6 +377,7 @@ export const gameData = [
noScores: true,
noRecords: true,
skip: true,
useUnicode: true,
playerHeaders: [
{ text: "Region", value: "region", sortable: true, width: 100 },
{ text: "Home Arcade", value: "homeArcade", sortable: true, width: 150 },
@ -400,6 +402,7 @@ export const gameData = [
noScores: true,
noRecords: true,
skip: true,
useUnicode: true,
},
{
id: GameConstants.DANCE_RUSH,
@ -896,6 +899,7 @@ export const gameData = [
noRivals: true,
noScores: true,
noRecords: true,
useUnicode: true,
versions: [
{
id: VersionConstants.FUTURETOMTOM,

View File

@ -0,0 +1,74 @@
export const GITADORAOptions = {
1: [
{
id: "title",
name: "Player Title",
help: 'Defaults to "PhaseII Player"',
type: "String",
},
],
2: [
{
id: "title",
name: "Player Title",
help: 'Defaults to "PhaseII Player"',
type: "String",
},
],
3: [
{
id: "title",
name: "Player Title",
help: 'Defaults to "PhaseII Player"',
type: "String",
},
],
4: [
{
id: "title",
name: "Player Title",
help: 'Defaults to "PhaseII Player"',
type: "String",
},
],
5: [
{
id: "title",
name: "Player Title",
help: 'Defaults to "PhaseII Player"',
type: "String",
},
],
6: [
{
id: "title",
name: "Player Title",
help: 'Defaults to "PhaseII Player"',
type: "String",
},
],
7: [
{
id: "title",
name: "Player Title",
help: 'Defaults to "PhaseII Player"',
type: "String",
},
],
8: [
{
id: "title",
name: "Player Title",
help: 'Defaults to "PhaseII Player"',
type: "String",
},
],
9: [
{
id: "title",
name: "Player Title",
help: 'Defaults to "PhaseII Player"',
type: "String",
},
],
};

View File

@ -2,6 +2,7 @@ import { GameConstants } from "..";
import { DDROptions } from "./ddrOptions";
import { SDVXOptions } from "./sdvxOptions";
import { IIDXOptions } from "./iidxOptions";
import { GITADORAOptions } from "./gitadoraOptions";
export function getGameOptions(game, version) {
var options = [
@ -10,28 +11,23 @@ export function getGameOptions(game, version) {
name: "Username",
help: "Set your username for this profile",
type: "String",
maxLength: 8,
},
];
if ([GameConstants.DDR, GameConstants.DDROMNI].includes(game.id)) {
const gameOptions = DDROptions[version];
if (gameOptions != undefined) {
options = options.concat(gameOptions);
}
}
const gameOptionsMap = {
[GameConstants.DDR]: DDROptions,
[GameConstants.DDROMNI]: DDROptions,
[GameConstants.IIDX]: IIDXOptions,
[GameConstants.IIDXCLASS]: IIDXOptions,
[GameConstants.GITADORA_GF]: GITADORAOptions,
[GameConstants.GITADORA_DM]: GITADORAOptions,
[GameConstants.SDVX]: SDVXOptions,
};
if ([GameConstants.IIDX, GameConstants.IIDXCLASS].includes(game.id)) {
const gameOptions = IIDXOptions[version];
if (gameOptions != undefined) {
options = options.concat(gameOptions);
}
}
if (game.id == GameConstants.SDVX) {
const gameOptions = SDVXOptions[version];
if (gameOptions != undefined) {
options = options.concat(gameOptions);
}
const gameOptions = gameOptionsMap[game.id]?.[version];
if (gameOptions) {
options.push(...gameOptions);
}
return options;

View File

@ -169,6 +169,7 @@ function getNestedValue(obj, path) {
v-if="setting.type == 'String'"
:name="setting.id"
:model-value="getNestedValue(optionForm, setting.id)"
:maxlength="setting.maxLength ?? 15"
/>
<FormControl