Skip to content

Commit

Permalink
use correct tags.json (genshinsim#2144)
Browse files Browse the repository at this point in the history
  • Loading branch information
srliao authored Apr 5, 2024
1 parent 0f78658 commit 8d9160b
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 218 deletions.
63 changes: 32 additions & 31 deletions ui/packages/data/src/tags.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
{
"0": {
"display_name": "Invalid"
},
"1": {
"display_name": "gcsim",
"blurb": "These untagged simulations are simulations that are meant to serve as examples for users looking for similar simulations to write their own. There are no rules or criteria for these simulations and any simultation that are different from what exists already will qualify."
},
"2": {
"display_name": "Internal Test"
},
"5": {
"display_name": "Itto Simps",
"blurb": "Itto doing Itto things (maintained by Tris)"
},
"6": {
"display_name": "Random Frame Delays",
"blurb": "Collection of simulationsi that utilize random delays in their rotation"
},
"7": {
"display_name": "Arfoire for Newbies",
"blurb": "Arfoire's collection of simulations targetted towards new players"
},
"8": {
"display_name": "APL",
"blurb": "Collection of simulations with rotation written as a priority list (also frequently know as action priority list, or APL)"
},
"9": {
"display_name": "Guides",
"blurb": "Collection of simulations used by various guide writers for KQM, etc..."
}
}
"0": {
"display_name": "Invalid"
},
"1": {
"display_name": "gcsim",
"blurb": "The default unnamed tag contains hundreds of interesting sims meant as examples for users to search for a team and have something to work with. There's no requirement to follow any sort of standardization, and the level of optimization or reasonable application to in-game can vary wildly."
},
"2": {
"display_name": "Internal Test"
},
"5": {
"display_name": "Itto Simps",
"blurb": "Sims of Itto doing Itto things (maintained by Tris)."
},
"6": {
"display_name": "Action Execution Delays",
"blurb": "Sims that utilize a lot of delays before executing actions, or have variance in their swap_delay instead of fixed. Usually involving randomized distributions. They are trying to model what happens when sims are not frame-perfectly executed, especially for reaction heavy teams that are sensitive to timing."
},
"7": {
"display_name": "Arfoire for Newbies",
"blurb": "Arfoire's collection of sims targetted towards new players."
},
"8": {
"display_name": "APL",
"blurb": "Sims with all their actions written as a priority list instead of looping the same set of actions repeatedly."
},
"9": {
"display_name": "Guides",
"blurb": "Sims used by various guide writers for KQM, etc.",
"default_exclude": true
}
}
32 changes: 16 additions & 16 deletions ui/packages/db/src/Pages/Home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
import { Button, ButtonGroup } from "@blueprintjs/core";
import { useTranslation } from "react-i18next";
import tagData from "tags.json";
import { useLocation } from "wouter";
import {Button, ButtonGroup} from '@blueprintjs/core';
import tagData from '@gcsim/data/src/tags.json';
import {useTranslation} from 'react-i18next';
import {useLocation} from 'wouter';

export const Home = () => {
const { t } = useTranslation();
const {t} = useTranslation();

const [_, to] = useLocation();
const sortedTagnames = Object.keys(tagData)
.filter((key) => {
return key !== "0" && key != "2";
return key !== '0' && key != '2';
})
.map((key) => {
let name = tagData[key]["display_name"];
if (key == "1") {
name = "(Not Tagged)";
let name = tagData[key]['display_name'];
if (key == '1') {
name = '(Not Tagged)';
}
return (
<li key={key}>
<span className="font-semibold text-rose-700">{name}</span>
{`: ${t<string>("db.home.tag_desc_" + key)}`}
{`: ${t<string>('db.home.tag_desc_' + key)}`}
</li>
);
});
return (
<div className="ml-2 mr-2 mt-2">
<div className="text-center text-lg font-semibold text-indigo-600">
{t<string>("db.home.welcome")}{" "}
{t<string>('db.home.welcome')}{' '}
</div>
<div className="mb-4">
<p className="m-2">{t<string>("db.home.simpact_desc")}</p>
<p className="m-2">{t<string>("db.home.simpact_tag_desc")} </p>
<p className="m-2">{t<string>("db.home.simpact_tag_list_header")} </p>
<p className="m-2">{t<string>('db.home.simpact_desc')}</p>
<p className="m-2">{t<string>('db.home.simpact_tag_desc')} </p>
<p className="m-2">{t<string>('db.home.simpact_tag_list_header')} </p>
<ul className="list-disc m-4 ml-8">{sortedTagnames}</ul>
</div>
<ButtonGroup fill className="mb-4">
<Button intent="primary" onClick={() => to("/database")}>
{t<string>("db.home.get_started")}
<Button intent="primary" onClick={() => to('/database')}>
{t<string>('db.home.get_started')}
</Button>
</ButtonGroup>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import tagData from "@gcsim/db/src/tags.json";
import { model } from "@gcsim/types";
import { useLocation } from "wouter";
import tagData from '@gcsim/db/src/tags.json';
import {model} from '@gcsim/types';
import {useLocation} from 'wouter';

export default function DBEntryTags({
tags,
Expand All @@ -14,7 +14,7 @@ export default function DBEntryTags({
const [_, setLocation] = useLocation();

return (
<div className={"flex flex-row overflow-hidden"}>
<div className={'flex flex-row overflow-hidden'}>
{tags
?.filter((tag) => tag !== 1)
.map((tag) => (
Expand All @@ -23,8 +23,7 @@ export default function DBEntryTags({
key={tag}
onClick={() => {
setLocation(`/tag/${tag}`);
}}
>
}}>
{tagData[tag].display_name}
</div>
))}
Expand Down
Loading

0 comments on commit 8d9160b

Please sign in to comment.