mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-25 07:32:19 -05:00
gear dropdown
This commit is contained in:
parent
434f05a1c2
commit
2d1c4a5802
7
react-ui/src/components/common/BuildCard.js
vendored
Normal file
7
react-ui/src/components/common/BuildCard.js
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import React from "react"
|
||||
|
||||
const BuildCard = () => {
|
||||
return <>build card here</>
|
||||
}
|
||||
|
||||
export default BuildCard
|
||||
|
|
@ -31,9 +31,7 @@ const WeaponDropdown = ({
|
|||
}
|
||||
: null
|
||||
}))}
|
||||
>
|
||||
{}
|
||||
</Dropdown>
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
4
react-ui/src/components/root/Routes.js
vendored
4
react-ui/src/components/root/Routes.js
vendored
|
|
@ -17,6 +17,7 @@ const TournamentDetailsPage = lazy(() =>
|
|||
const TournamentSearchPage = lazy(() =>
|
||||
import("../tournament/TournamentSearchPage")
|
||||
)
|
||||
const UserPage = lazy(() => import("../user/UserPage"))
|
||||
|
||||
const Routes = () => {
|
||||
return (
|
||||
|
|
@ -52,6 +53,9 @@ const Routes = () => {
|
|||
<Route path="/tournaments/:id">
|
||||
<TournamentDetailsPage />
|
||||
</Route>
|
||||
<Route path="/u/:id">
|
||||
<UserPage />
|
||||
</Route>
|
||||
<Route path="/404" render={() => <NotFound />} />
|
||||
<Route path="*" render={() => <NotFound />} />
|
||||
</Switch>
|
||||
|
|
|
|||
7
react-ui/src/components/user/AbilityButtons.js
vendored
Normal file
7
react-ui/src/components/user/AbilityButtons.js
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import React from "react"
|
||||
|
||||
const AbilityButtons = () => {
|
||||
return <>abilitybuttonshere</>
|
||||
}
|
||||
|
||||
export default AbilityButtons
|
||||
140
react-ui/src/components/user/AddBuildForm.js
vendored
Normal file
140
react-ui/src/components/user/AddBuildForm.js
vendored
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
import React, { useState } from "react"
|
||||
import { Form, Message, Button } from "semantic-ui-react"
|
||||
import BuildCard from "../common/BuildCard"
|
||||
import AbilityButtons from "./AbilityButtons"
|
||||
import WeaponDropdown from "../common/WeaponDropdown"
|
||||
import GearDropdown from "./GearDropdown"
|
||||
|
||||
const AddBuildForm = ({
|
||||
addBuild,
|
||||
setShowForm,
|
||||
setSuccessMsg,
|
||||
existingBuild,
|
||||
setShowEdit,
|
||||
editBuildFunction
|
||||
}) => {
|
||||
const [weapon, setWeapon] = useState(
|
||||
existingBuild ? existingBuild.weapon : ""
|
||||
)
|
||||
const [title, setTitle] = useState(
|
||||
existingBuild && existingBuild.title ? existingBuild.title : ""
|
||||
)
|
||||
const [abilities, setAbilities] = useState(
|
||||
existingBuild
|
||||
? [
|
||||
[...existingBuild.headgear],
|
||||
[...existingBuild.clothing],
|
||||
[...existingBuild.shoes]
|
||||
]
|
||||
: [["", "", "", ""], ["", "", "", ""], ["", "", "", ""]]
|
||||
)
|
||||
const [head, setHead] = useState("")
|
||||
|
||||
const build = {
|
||||
id: existingBuild ? existingBuild.id : null,
|
||||
weapon: weapon,
|
||||
title,
|
||||
headgear: abilities[0],
|
||||
clothing: abilities[1],
|
||||
shoes: abilities[2]
|
||||
}
|
||||
|
||||
const submit = async e => {
|
||||
e.preventDefault()
|
||||
|
||||
let buildToAdd = { ...build }
|
||||
if (buildToAdd.title === "") delete buildToAdd.title
|
||||
|
||||
await addBuild({
|
||||
variables: { ...buildToAdd }
|
||||
})
|
||||
|
||||
setWeapon("")
|
||||
setTitle("")
|
||||
setAbilities([["", "", "", ""], ["", "", "", ""], ["", "", "", ""]])
|
||||
setSuccessMsg("New build succesfully added!")
|
||||
setTimeout(() => {
|
||||
setSuccessMsg(null)
|
||||
}, 10000)
|
||||
setShowForm(false)
|
||||
}
|
||||
|
||||
function isBuildComplete() {
|
||||
if (title.length > 100) return false
|
||||
if (weapon === "") return false
|
||||
for (let i = 0; i < abilities.length; i++) {
|
||||
for (let j = 0; j < abilities[i].length; j++) {
|
||||
const element = abilities[i][j]
|
||||
if (element === "") {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
<BuildCard
|
||||
build={build}
|
||||
existingAbilities={abilities}
|
||||
setAbilities={setAbilities}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ paddingTop: "15px" }}>
|
||||
<WeaponDropdown
|
||||
value={weapon}
|
||||
onChange={(e, { value }) => setWeapon(value)}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ paddingTop: "15px" }}>
|
||||
<Form error={title.length > 100}>
|
||||
<Form.Field>
|
||||
<label>{"Choose title (optional)"}</label>
|
||||
<input value={title} onChange={e => setTitle(e.target.value)} />
|
||||
<Message
|
||||
error
|
||||
content={"Title can't be longer than 100 characters."}
|
||||
/>
|
||||
</Form.Field>
|
||||
<Form.Group widths="equal">
|
||||
<GearDropdown
|
||||
slot="head"
|
||||
value={head}
|
||||
onChange={(e, { value }) => console.log(value)}
|
||||
/>
|
||||
</Form.Group>
|
||||
</Form>
|
||||
</div>
|
||||
<div style={{ paddingTop: "10px" }}>
|
||||
<AbilityButtons abilities={abilities} setAbilities={setAbilities} />
|
||||
</div>
|
||||
<div style={{ paddingTop: "10px" }}>
|
||||
{editBuildFunction ? (
|
||||
<>
|
||||
<Button
|
||||
disabled={!isBuildComplete()}
|
||||
onClick={() => {
|
||||
editBuildFunction(build)
|
||||
setShowEdit(false)
|
||||
window.scrollTo(0, 0)
|
||||
}}
|
||||
>
|
||||
Edit build
|
||||
</Button>
|
||||
<Button negative onClick={() => setShowEdit(false)}>
|
||||
Cancel
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<Button disabled={!isBuildComplete()} onClick={submit}>
|
||||
Add build
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default AddBuildForm
|
||||
144
react-ui/src/components/user/BuildTab.js
vendored
Normal file
144
react-ui/src/components/user/BuildTab.js
vendored
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
import React, { useState } from "react"
|
||||
import { useQuery, useMutation } from "@apollo/react-hooks"
|
||||
import { Button, Message } from "semantic-ui-react"
|
||||
|
||||
import { addBuild } from "../../graphql/mutations/addBuild"
|
||||
import { searchForBuilds } from "../../graphql/queries/searchForBuilds"
|
||||
import { deleteBuild } from "../../graphql/mutations/deleteBuild"
|
||||
import { updateBuild } from "../../graphql/mutations/updateBuild"
|
||||
import AddBuildForm from "./AddBuildForm"
|
||||
import BuildCard from "../common/BuildCard"
|
||||
import Loading from "../common/Loading"
|
||||
import Error from "../common/Error"
|
||||
|
||||
const BuildTab = ({ user, userViewed }) => {
|
||||
const { data, error, loading } = useQuery(searchForBuilds, {
|
||||
variables: { discord_id: userViewed.discord_id }
|
||||
})
|
||||
const [errorMsg, setErrorMsg] = useState(null)
|
||||
const [successMsg, setSuccessMsg] = useState(null)
|
||||
const [showForm, setShowForm] = useState(false)
|
||||
|
||||
const handleError = error => {
|
||||
errorMsg(error.graphQLErrors[0].message)
|
||||
setTimeout(() => {
|
||||
setErrorMsg(null)
|
||||
}, 10000)
|
||||
}
|
||||
|
||||
const [addBuildMutation] = useMutation(addBuild, {
|
||||
onError: handleError,
|
||||
refetchQueries: [
|
||||
{
|
||||
query: searchForBuilds,
|
||||
variables: { discord_id: userViewed.discord_id }
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const [deleteBuildMutation] = useMutation(deleteBuild, {
|
||||
onError: handleError,
|
||||
refetchQueries: [
|
||||
{
|
||||
query: searchForBuilds,
|
||||
variables: { discord_id: userViewed.discord_id }
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const [editBuildMutation] = useMutation(updateBuild, {
|
||||
onError: handleError,
|
||||
refetchQueries: [
|
||||
{
|
||||
query: searchForBuilds,
|
||||
variables: { discord_id: userViewed.discord_id }
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const deleteBuildById = async ({ id, title, weapon }) => {
|
||||
await deleteBuildMutation({
|
||||
variables: { id }
|
||||
})
|
||||
|
||||
const buildTitle = title ? title : `${weapon} build`
|
||||
|
||||
setSuccessMsg(`Successfully deleted ${buildTitle}`)
|
||||
setTimeout(() => {
|
||||
setSuccessMsg(null)
|
||||
}, 10000)
|
||||
}
|
||||
|
||||
const editBuildById = async build => {
|
||||
await editBuildMutation({
|
||||
variables: { ...build }
|
||||
})
|
||||
|
||||
setSuccessMsg("Build successfully edited")
|
||||
setTimeout(() => {
|
||||
setSuccessMsg(null)
|
||||
}, 10000)
|
||||
}
|
||||
|
||||
if (loading) return <Loading />
|
||||
if (error) return <Error errorMessage={error.message} />
|
||||
|
||||
const removeBuildFunction =
|
||||
user && user.discord_id === userViewed.discord_id ? deleteBuildById : null
|
||||
const editBuildFunction =
|
||||
user && user.discord_id === userViewed.discord_id ? editBuildById : null
|
||||
|
||||
return (
|
||||
<div>
|
||||
{successMsg ? (
|
||||
<div style={{ paddingBottom: "10px" }}>
|
||||
<Message success content={successMsg} />
|
||||
</div>
|
||||
) : null}
|
||||
<div>
|
||||
{data.searchForBuilds.length >= 100 &&
|
||||
user &&
|
||||
user.discord_id === userViewed.discord_id
|
||||
? "Looks like you have 100 buids. Insane flex. Delete a build before adding a new one."
|
||||
: null}
|
||||
{/*TODO: put this back the right way */}
|
||||
{!user ||
|
||||
user.discord_id !== userViewed.discord_id ||
|
||||
data.searchForBuilds.length >= 100 ? (
|
||||
<Button
|
||||
circular
|
||||
size="tiny"
|
||||
icon={showForm ? "minus" : "plus"}
|
||||
onClick={() => setShowForm(!showForm)}
|
||||
/>
|
||||
) : null}
|
||||
{showForm ? (
|
||||
<div style={{ paddingTop: "10px" }}>
|
||||
<AddBuildForm
|
||||
addBuild={addBuildMutation}
|
||||
setShowForm={setShowForm}
|
||||
setSuccessMsg={setSuccessMsg}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
<div style={{ paddingTop: "10px" }}>
|
||||
{data.searchForBuilds.map(b => (
|
||||
<div key={b.id} style={{ paddingTop: "10px" }}>
|
||||
<BuildCard
|
||||
build={b}
|
||||
removeBuildFunction={removeBuildFunction}
|
||||
editBuildFunction={editBuildFunction}
|
||||
setSuccessMsg={setSuccessMsg}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
{data.searchForBuilds.length === 0
|
||||
? "So far this user has no builds!"
|
||||
: null}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default BuildTab
|
||||
33
react-ui/src/components/user/GearDropdown.js
vendored
Normal file
33
react-ui/src/components/user/GearDropdown.js
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import React from "react"
|
||||
import { Dropdown } from "semantic-ui-react"
|
||||
import { gearEnglish } from "../../utils/lists"
|
||||
|
||||
const GearDropdown = ({ value, onChange, slot = "head" }) => {
|
||||
return (
|
||||
<Dropdown
|
||||
className="selection"
|
||||
placeholder={`Choose ${slot}`}
|
||||
search
|
||||
closeOnEscape
|
||||
style={{ width: "270px" }}
|
||||
onChange={onChange}
|
||||
value={value}
|
||||
>
|
||||
<Dropdown.Menu>
|
||||
{gearEnglish.map(gears => {
|
||||
if (gears[slot].length === 0) return null
|
||||
return (
|
||||
<React.Fragment key={gears.brand}>
|
||||
<Dropdown.Header>{gears.brand}</Dropdown.Header>
|
||||
{gears[slot].map(gear => (
|
||||
<Dropdown.Item key={gear}>{gear}</Dropdown.Item>
|
||||
))}
|
||||
</React.Fragment>
|
||||
)
|
||||
})}
|
||||
</Dropdown.Menu>
|
||||
</Dropdown>
|
||||
)
|
||||
}
|
||||
|
||||
export default GearDropdown
|
||||
133
react-ui/src/components/user/UserPage.js
vendored
Normal file
133
react-ui/src/components/user/UserPage.js
vendored
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
import React, { useEffect } from "react"
|
||||
import { Tab, Image, List, Grid } from "semantic-ui-react"
|
||||
import { Redirect } from "react-router-dom"
|
||||
import { useQuery } from "@apollo/react-hooks"
|
||||
import { useParams } from "react-router-dom"
|
||||
import { searchForUser } from "../../graphql/queries/searchForUser"
|
||||
import { userLean } from "../../graphql/queries/userLean"
|
||||
import PlayerXRankStats from "../xsearch/PlayerXRankStats"
|
||||
import BuildTab from "./BuildTab"
|
||||
import Loading from "../common/Loading"
|
||||
import Error from "../common/Error"
|
||||
|
||||
const UserPage = () => {
|
||||
const { id } = useParams()
|
||||
const { data, error, loading } = useQuery(searchForUser, {
|
||||
variables: { discord_id: id }
|
||||
})
|
||||
const userLeanQuery = useQuery(userLean)
|
||||
|
||||
useEffect(() => {
|
||||
if (loading) return
|
||||
document.title = `${data.searchForUser.username} - sendou.ink`
|
||||
}, [loading, data])
|
||||
|
||||
if (loading || userLeanQuery.loading) return <Loading />
|
||||
|
||||
if (error) return <Error errorMessage={error.message} />
|
||||
|
||||
if (userLeanQuery.error)
|
||||
return <Error errorMessage={userLeanQuery.error.message} />
|
||||
|
||||
const userData = data.searchForUser
|
||||
if (!userData) return <Redirect to="/404" />
|
||||
|
||||
const twitchDiscord = () => {
|
||||
if (userData.twitch_name && userData.twitter_name) {
|
||||
return (
|
||||
<>
|
||||
<List.Item>
|
||||
<List.Icon name="twitter" size="large" />
|
||||
<List.Content>
|
||||
<a href={`https://twitter.com/${userData.twitter_name}`}>
|
||||
{userData.twitter_name}
|
||||
</a>
|
||||
</List.Content>
|
||||
</List.Item>
|
||||
<List.Item>
|
||||
<List.Icon name="twitch" size="large" />
|
||||
<List.Content>
|
||||
<a href={`https://www.twitch.tv/${userData.twitch_name}`}>
|
||||
{userData.twitch_name}
|
||||
</a>
|
||||
</List.Content>
|
||||
</List.Item>
|
||||
</>
|
||||
)
|
||||
} else if (userData.twitch_name) {
|
||||
return (
|
||||
<List.Item>
|
||||
<List.Icon name="twitch" size="large" />
|
||||
<List.Content>
|
||||
<a href={`https://www.twitch.tv/${userData.twitch_name}`}>
|
||||
{userData.twitch_name}
|
||||
</a>
|
||||
</List.Content>
|
||||
</List.Item>
|
||||
)
|
||||
} else if (userData.twitter_name) {
|
||||
return (
|
||||
<List.Item>
|
||||
<List.Icon name="twitter" size="large" />
|
||||
<List.Content>
|
||||
<a href={`https://twitter.com/${userData.twitter_name}`}>
|
||||
{userData.twitter_name}
|
||||
</a>
|
||||
</List.Content>
|
||||
</List.Item>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const panes = [
|
||||
{
|
||||
menuItem: "Builds",
|
||||
render: () => (
|
||||
<Tab.Pane>
|
||||
<BuildTab user={userLeanQuery.data.user} userViewed={userData} />
|
||||
</Tab.Pane>
|
||||
)
|
||||
},
|
||||
{
|
||||
menuItem: "X Rank",
|
||||
render: () => (
|
||||
<Tab.Pane>
|
||||
<PlayerXRankStats twitter={userData.twitter_name} tabMode />
|
||||
</Tab.Pane>
|
||||
)
|
||||
}
|
||||
]
|
||||
|
||||
return (
|
||||
<>
|
||||
<>
|
||||
<Grid stackable>
|
||||
<Grid.Column width={3}>
|
||||
<Image
|
||||
src={
|
||||
userData.avatar
|
||||
? `https://cdn.discordapp.com/avatars/${userData.discord_id}/${userData.avatar}.png`
|
||||
: "https://cdn.discordapp.com/avatars/455039198672453645/088ae3838cc3b08b73f79aab0fefec2f.png"
|
||||
}
|
||||
rounded
|
||||
/>
|
||||
</Grid.Column>
|
||||
<Grid.Column>
|
||||
<List>
|
||||
<List.Item>
|
||||
<List.Icon name="discord" size="large" />
|
||||
<List.Content>{`${userData.username}#${userData.discriminator}`}</List.Content>
|
||||
</List.Item>
|
||||
{twitchDiscord()}
|
||||
</List>
|
||||
</Grid.Column>
|
||||
</Grid>
|
||||
</>
|
||||
<div style={{ paddingTop: "1.5em" }}>
|
||||
<Tab panes={panes} />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default UserPage
|
||||
|
|
@ -117,7 +117,7 @@ const PlayerXRankStats = ({ twitter, tabMode = false }) => {
|
|||
) : null}
|
||||
</Header>
|
||||
) : null}
|
||||
{tabMode && playerData.discord_id ? (
|
||||
{!tabMode && playerData.discord_id ? (
|
||||
<>
|
||||
<Link to={`/u/${playerData.discord_id}`}>User page</Link>
|
||||
<br />
|
||||
|
|
|
|||
21
react-ui/src/graphql/mutations/addBuild.js
vendored
Normal file
21
react-ui/src/graphql/mutations/addBuild.js
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { gql } from 'apollo-boost'
|
||||
|
||||
export const addBuild = gql`
|
||||
mutation addBuild ($weapon: String!, $title: String, $headgear: [Ability!]!, $clothing: [Ability!]!, $shoes: [Ability!]!) {
|
||||
addBuild(
|
||||
weapon: $weapon,
|
||||
title: $title,
|
||||
headgear: $headgear,
|
||||
clothing: $clothing,
|
||||
shoes: $shoes
|
||||
) {
|
||||
id
|
||||
weapon
|
||||
title
|
||||
headgear
|
||||
clothing
|
||||
shoes
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
`
|
||||
7
react-ui/src/graphql/mutations/deleteBuild.js
vendored
Normal file
7
react-ui/src/graphql/mutations/deleteBuild.js
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { gql } from 'apollo-boost'
|
||||
|
||||
export const deleteBuild = gql`
|
||||
mutation deleteBuild ($id: ID!) {
|
||||
deleteBuild(id: $id)
|
||||
}
|
||||
`
|
||||
14
react-ui/src/graphql/mutations/updateBuild.js
vendored
Normal file
14
react-ui/src/graphql/mutations/updateBuild.js
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { gql } from 'apollo-boost'
|
||||
|
||||
export const updateBuild = gql`
|
||||
mutation updateBuild ($id: ID!, $weapon: String!, $title: String, $headgear: [Ability!]!, $clothing: [Ability!]!, $shoes: [Ability!]!) {
|
||||
updateBuild(
|
||||
id: $id,
|
||||
weapon: $weapon,
|
||||
title: $title,
|
||||
headgear: $headgear,
|
||||
clothing: $clothing,
|
||||
shoes: $shoes
|
||||
)
|
||||
}
|
||||
`
|
||||
10
react-ui/src/graphql/mutations/updateTwitter.js
vendored
Normal file
10
react-ui/src/graphql/mutations/updateTwitter.js
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { gql } from 'apollo-boost'
|
||||
|
||||
export const updateTwitter = gql`
|
||||
mutation updateTwitter ($unique_id: String!, $twitter: String!) {
|
||||
updateTwitter(
|
||||
unique_id: $unique_id,
|
||||
twitter: $twitter
|
||||
)
|
||||
}
|
||||
`
|
||||
586
react-ui/src/utils/lists.js
vendored
586
react-ui/src/utils/lists.js
vendored
|
|
@ -339,6 +339,592 @@ export const categoryKeys = [
|
|||
"Brellas"
|
||||
]
|
||||
|
||||
export const gearEnglish = [{'brand': 'amiibo',
|
||||
'clothes': ['Enchanted Robe',
|
||||
'Fresh Fish Gloves',
|
||||
'Marinated Top',
|
||||
'Pearlescent Hoodie',
|
||||
'Power Armor',
|
||||
'Power Armor Mk I',
|
||||
'Samurai Jacket',
|
||||
'School Cardigan',
|
||||
'School Uniform',
|
||||
'Squinja Suit',
|
||||
'Steel Platemail'],
|
||||
'head': ['Enchanted Hat',
|
||||
'Fresh Fish Head',
|
||||
'Marinated Headphones',
|
||||
'Pearlescent Crown',
|
||||
'Power Mask',
|
||||
'Power Mask Mk I',
|
||||
'Samurai Helmet',
|
||||
'Squid Clip-Ons',
|
||||
'Squid Hairclip',
|
||||
'Squinja Mask',
|
||||
'Steel Helm'],
|
||||
'shoes': ['Enchanted Boots',
|
||||
'Fresh Fish Feet',
|
||||
'Fringed Loafers',
|
||||
'Marinated Slip-Ons',
|
||||
'Pearlescent Kicks',
|
||||
'Power Boots',
|
||||
'Power Boots Mk I',
|
||||
'Samurai Shoes',
|
||||
'School Shoes',
|
||||
'Squinja Boots',
|
||||
'Steel Greaves']},
|
||||
{'brand': 'Annaki',
|
||||
'clothes': ['Annaki Blue Cuff',
|
||||
'Annaki Drive Tee ',
|
||||
'Annaki Evolution Tee',
|
||||
'Annaki Flannel Hoodie',
|
||||
'Annaki Polpo-Pic Tee',
|
||||
'Annaki Red Cuff',
|
||||
'Annaki Yellow Cuff',
|
||||
'Crimson Parashooter',
|
||||
'Hula Punk Shirt',
|
||||
'Prune Parashooter',
|
||||
'Red Hula Punk with Tie',
|
||||
"Rockin' Leather Jacket"],
|
||||
'head': ['Annaki Beret', 'Annaki Beret & Glasses', 'Annaki Mask'],
|
||||
'shoes': ['Annaki Arachno Boots', 'Annaki Habaneros', 'Annaki Tigers']},
|
||||
{'brand': 'Cuttlegear',
|
||||
'clothes': ['Armor Jacket Replica',
|
||||
'Black Cuttlegear LS',
|
||||
'Fresh Octo Tee',
|
||||
'Hero Hoodie Replica',
|
||||
'Hero Jacket Replica',
|
||||
'Neo Octoling Armor',
|
||||
'Null Armor Replica',
|
||||
'Octarian Retro',
|
||||
'Octo Layered LS',
|
||||
'Octo Tee',
|
||||
'Old-Timey Clothes',
|
||||
'Red Cuttlegear LS',
|
||||
'Sennyu Suit'],
|
||||
'head': ['Armor Helmet Replica',
|
||||
'Conductor Cap',
|
||||
'Golden Toothpick',
|
||||
'Hero Headphones Replica',
|
||||
'Hero Headset Replica',
|
||||
'Null Visor Replica',
|
||||
'Octoling Shades',
|
||||
'Old-Timey Hat',
|
||||
'Studio Octophones'],
|
||||
'shoes': ['Armor Boot Replicas',
|
||||
'Hero Runner Replicas',
|
||||
'Hero Snowboots Replicas',
|
||||
'Neo Octoling Boots',
|
||||
'Null Boots Replica',
|
||||
'Old-Timey Shoes']},
|
||||
{'brand': 'Enperry',
|
||||
'clothes': ['Black Velour Octoking Tee ',
|
||||
'Grape Hoodie',
|
||||
'Green Velour Octoking Tee',
|
||||
'King Jersey',
|
||||
'Milky Eminence Jacket',
|
||||
'N-Pacer Sweat',
|
||||
'Navy Eminence Jacket',
|
||||
'Navy King Tank',
|
||||
'Octoking HK Jersey',
|
||||
'Slash King Tank',
|
||||
'White King Tank'],
|
||||
'head': ['Eminence Cuff',
|
||||
'King Facemask',
|
||||
'King Flip Mesh',
|
||||
'Octoking Facemask'],
|
||||
'shoes': ['Black & Blue Squidkid V',
|
||||
'Blue & Black Squidkid IV',
|
||||
'Honey & Orange Squidkid V',
|
||||
'Milky Enperrials',
|
||||
'N-Pacer Ag',
|
||||
'N-Pacer Au',
|
||||
'N-Pacer CaO',
|
||||
'Navy Enperrials',
|
||||
'Online Squidkid V',
|
||||
'Pearlescent Squidkid IV',
|
||||
'Red & Black Squidkid IV',
|
||||
'Red & White Squidkid V',
|
||||
'Rina Squidkid IV',
|
||||
'Sun & Shade Squidkid IV']},
|
||||
{'brand': 'Firefin',
|
||||
'clothes': ['Baseball Jersey',
|
||||
'Black 8-Bit FishFry',
|
||||
'Blue 16-Bit FishFry',
|
||||
'Camo Zip Hoodie',
|
||||
'Carnivore Tee',
|
||||
'Dark Urban Vest',
|
||||
'Firefin Navy Sweat',
|
||||
'Fugu Tee',
|
||||
'Gray 8-Bit FishFry',
|
||||
'Green Zip Hoodie',
|
||||
'Herbivore Tee',
|
||||
'Khaki 16-Bit FishFry',
|
||||
'White 8-Bit FishFry',
|
||||
'Yellow Urban Vest',
|
||||
'ω-3 Tee'],
|
||||
'head': ['Black FishFry Bandana',
|
||||
'Blowfish Bell Hat',
|
||||
'Blowfish Newsie',
|
||||
'Camo Mesh',
|
||||
'Firefin Facemask',
|
||||
'FishFry Biscuit Bandana',
|
||||
'FishFry Visor',
|
||||
'Fugu Bell Hat',
|
||||
'Jet Cap',
|
||||
'Jungle Hat',
|
||||
'Knitted Hat',
|
||||
'Octoglasses'],
|
||||
'shoes': ['Red FishFry Sandals', 'Yellow FishFry Sandals']},
|
||||
{'brand': 'Forge',
|
||||
'clothes': ['Aloha Shirt',
|
||||
'Blue Sailor Suit',
|
||||
'Brown FA-11 Bomber',
|
||||
'Custom Painted F-3 ',
|
||||
'FA-01 Jacket',
|
||||
'FA-01 Reversed',
|
||||
'Forge Inkling Parka',
|
||||
'Forge Octarian Jacket',
|
||||
'Gray FA-11 Bomber',
|
||||
'Green Tee',
|
||||
'Moist Ghillie Suit',
|
||||
'White Leather F-3',
|
||||
'White Sailor Suit'],
|
||||
'head': ['Deca Tackle Visor Helmet',
|
||||
'Designer Headphones',
|
||||
'Digi-Camo Forge Mask',
|
||||
'Forge Mask',
|
||||
'Gas Mask',
|
||||
'Hockey Helmet',
|
||||
'Moist Ghillie Helmet',
|
||||
'Motocross Nose Guard',
|
||||
'Noise Cancelers',
|
||||
'Octo Tackle Helmet Deco',
|
||||
'Paintball Mask',
|
||||
'Pilot Goggles',
|
||||
'Safari Hat',
|
||||
'Sennyu Goggles',
|
||||
'Sennyu Headphones',
|
||||
'Skull Bandana',
|
||||
'Snorkel Mask',
|
||||
'Special Forces Beret',
|
||||
'Splash Goggles',
|
||||
'Squidfin Hook Cans',
|
||||
'Squidlife Headphones',
|
||||
'Stealth Goggles',
|
||||
'Studio Headphones',
|
||||
'Treasure Hunter'],
|
||||
'shoes': ['Moist Ghillie Boots']},
|
||||
{'brand': 'Grizzco',
|
||||
'clothes': ['Anchor Life Vest',
|
||||
'Crustwear XXL',
|
||||
'Dev Uniform',
|
||||
'Garden Gear',
|
||||
'Juice Parka',
|
||||
'North-Country Parka',
|
||||
'Octoleet Armor',
|
||||
'Office Attire',
|
||||
'Online Jersey',
|
||||
'Record Shop Look EP',
|
||||
'Squiddor Polo',
|
||||
'SRL Coat'],
|
||||
'head': ['Beekeeper Hat',
|
||||
'Cap of Legend',
|
||||
'Dust Blocker 2000',
|
||||
'Headlamp Helmet',
|
||||
'Oceanic Hard Hat',
|
||||
'Octoleet Goggles',
|
||||
'Sailor Cap',
|
||||
'Welding Mask',
|
||||
"Worker's Head Towel"],
|
||||
'shoes': ['Angry Rain Boots',
|
||||
'Flipper Floppers',
|
||||
'Non-slip Senseis',
|
||||
'Octoleet Boots',
|
||||
'Wooden Sandals']},
|
||||
{'brand': 'Inkline',
|
||||
'clothes': ['Berry Ski Jacket',
|
||||
'Blue Peaks Tee',
|
||||
'Chili-Pepper Ski Jacket',
|
||||
'Chilly Mountain Coat',
|
||||
'Eggplant Mountain Coat',
|
||||
'Fishing Vest',
|
||||
'Forest Vest',
|
||||
'Green Striped LS',
|
||||
'Ivory Peaks Tee',
|
||||
'Matcha Down Jacket',
|
||||
'Mountain Vest',
|
||||
'Olive Ski Jacket',
|
||||
'Striped Peaks LS'],
|
||||
'head': ['Bamboo Hat',
|
||||
'Camping Hat',
|
||||
'Lightweight Cap',
|
||||
'Mountie Hat',
|
||||
'Seashell Bamboo Hat',
|
||||
'Short Beanie',
|
||||
'Tulip Parasol',
|
||||
'Yamagiri Beanie'],
|
||||
'shoes': ['Acerola Rain Boots',
|
||||
'Birch Climbing Shoes',
|
||||
'Bubble Rain Boots',
|
||||
'Custom Trail Boots',
|
||||
'Green Rain Boots',
|
||||
'Luminous Delta Straps',
|
||||
'Musselforge Flip-Flops',
|
||||
'Neon Delta Straps',
|
||||
'Pro Trail Boots',
|
||||
'Snow Delta Straps',
|
||||
'Sunny Climbing Shoes',
|
||||
'Trail Boots']},
|
||||
{'brand': 'Krak-On',
|
||||
'clothes': ['Chili Octo Aloha',
|
||||
'Krak-On 528',
|
||||
'Missus Shrug Tee',
|
||||
'Mister Shrug Tee',
|
||||
'Octobowler Shirt',
|
||||
'Rainy-Day Tee',
|
||||
'Rodeo Shirt',
|
||||
'Squid-Pattern Waistcoat',
|
||||
'Squidstar Waistcoat',
|
||||
'Sunny-Day Tee'],
|
||||
'head': ['Full Moon Glasses',
|
||||
'Hickory Work Cap',
|
||||
'Long-Billed Cap',
|
||||
'Paisley Bandana',
|
||||
'Two-Stripe Mesh',
|
||||
'Woolly Urchins Classic'],
|
||||
'shoes': ['Banana Basics',
|
||||
'Blue Slip-Ons',
|
||||
'Blueberry Casuals',
|
||||
'Choco Clogs',
|
||||
'Clownfish Basics',
|
||||
'Cream Basics',
|
||||
'Cream Hi-Tops',
|
||||
'Hunter Hi-Tops',
|
||||
'Midnight Slip-Ons',
|
||||
'Oyster Clogs',
|
||||
'Plum Casuals',
|
||||
'Polka-dot Slip-Ons',
|
||||
'Red Hi-Tops',
|
||||
'Red Slip-Ons',
|
||||
'Squid-Stitch Slip-Ons',
|
||||
'Truffle Canvas Hi-Tops']},
|
||||
{'brand': 'Rockenberg',
|
||||
'clothes': ['Black Baseball LS',
|
||||
'Black Inky Rider',
|
||||
'Black Urchin Rock Tee',
|
||||
'Chirpy Chips Band Tee',
|
||||
'Hightide Era Band Tee',
|
||||
'Lumberjack Shirt',
|
||||
'Rockenberg Black',
|
||||
'Rockenberg White',
|
||||
'Round-Collar Shirt',
|
||||
'Squid Squad Band Tee',
|
||||
'Vintage Check Shirt',
|
||||
'Wet Floor Band Tee',
|
||||
'White Baseball LS',
|
||||
'White Inky Rider',
|
||||
'White Urchin Rock Tee'],
|
||||
'head': ['18K Aviators', 'SV925 Circle Shades'],
|
||||
'shoes': ['Blue Moto Boots',
|
||||
'Cherry Kicks',
|
||||
'Deepsea Leather Boots',
|
||||
'Gray Yellow-Soled Wingtips',
|
||||
'Inky Kid Clams',
|
||||
'Kid Clams',
|
||||
'Moto Boots',
|
||||
'Navy Red-Soled Wingtips',
|
||||
'New-Leaf Leather Boots',
|
||||
'Pearl Punk Crowns',
|
||||
'Punk Blacks',
|
||||
'Punk Cherries',
|
||||
'Punk Whites',
|
||||
'Punk Yellows',
|
||||
'Red Work Boots',
|
||||
'Roasted Brogues',
|
||||
'Sennyu Inksoles',
|
||||
'Smoky Wingtips',
|
||||
'Squink Wingtips',
|
||||
'Tan Work Boots',
|
||||
'Turquoise Kicks',
|
||||
'White Kicks']},
|
||||
{'brand': 'Skalop',
|
||||
'clothes': ['Black Hoodie',
|
||||
'Dots-On-Dots Shirt',
|
||||
'Firewave Tee',
|
||||
'Grape Tee',
|
||||
'Gray Hoodie',
|
||||
'Hothouse Hoodie',
|
||||
'Icewave Tee',
|
||||
'Mint Tee',
|
||||
'Pearl Tee',
|
||||
'Reggae Tee',
|
||||
'Squid-Stitch Tee'],
|
||||
'head': ['Bike Helmet',
|
||||
'Classic Straw Boater',
|
||||
'Do-Rag, Cap, & Glasses',
|
||||
'Hothouse Hat',
|
||||
'Jellyvader Cap',
|
||||
'Patched Hat',
|
||||
'Skate Helmet',
|
||||
'Sneaky Beanie',
|
||||
'Sporty Bobble Hat',
|
||||
'Squid Nordic',
|
||||
'Squid-Stitch Cap',
|
||||
'Squidvader Cap',
|
||||
'Straw Boater',
|
||||
'Streetstyle Cap',
|
||||
'Urchins Cap',
|
||||
'Visor Skate Helmet'],
|
||||
'shoes': []},
|
||||
{'brand': 'Splash Mob',
|
||||
'clothes': ['Baby-Jelly Shirt',
|
||||
'Baby-Jelly Shirt & Tie',
|
||||
'Gray College Sweat',
|
||||
'Green Cardigan',
|
||||
'Lime Easy-Stripe Shirt',
|
||||
'Linen Shirt',
|
||||
'Navy College Sweat',
|
||||
'Navy Striped LS',
|
||||
'Orange Cardigan',
|
||||
'Pink Easy-Stripe Shirt',
|
||||
'Pink Hoodie',
|
||||
'Pirate-Stripe Tee',
|
||||
'Sage Polo',
|
||||
'Sailor-Stripe Tee',
|
||||
'Shirt & Tie',
|
||||
'Shirt with Blue Hoodie',
|
||||
'Shrimp-Pink Polo',
|
||||
'Striped Shirt',
|
||||
'Varsity Baseball LS',
|
||||
'Whale-Knit Sweater',
|
||||
'White Shirt',
|
||||
'White Striped LS'],
|
||||
'head': ['Bobble Hat',
|
||||
'Half-Rim Glasses',
|
||||
'House-Tag Denim Cap',
|
||||
'Pilot Hat',
|
||||
'Retro Specs',
|
||||
'Sennyu Bon Bon Beanie',
|
||||
'Sennyu Specs',
|
||||
'Striped Beanie'],
|
||||
'shoes': ['Green Laceups',
|
||||
'Hunting Boots',
|
||||
'Mawcasins',
|
||||
'Piranha Moccasins',
|
||||
'Shark Moccasins',
|
||||
'Strapping Reds',
|
||||
'Strapping Whites',
|
||||
'Tea-Green Hunting Boots']},
|
||||
{'brand': 'SquidForce',
|
||||
'clothes': ['Anchor Sweat',
|
||||
'Basic Tee',
|
||||
'Black Anchor Tee',
|
||||
'Black Layered LS',
|
||||
'Black Tee',
|
||||
'Black V-Neck Tee',
|
||||
'Camo Layered LS',
|
||||
'Friend Tee',
|
||||
'Green V-Neck Limited Tee',
|
||||
'Layered Anchor LS',
|
||||
'League Tee',
|
||||
'Mecha Body - AKM',
|
||||
'Octo Support Hoodie',
|
||||
'Red V-Neck Limited Tee',
|
||||
'Retro Sweat',
|
||||
'Splatfest Tee',
|
||||
'Squid Yellow Layered LS',
|
||||
'Squidmark LS',
|
||||
'Squidmark Sweat',
|
||||
'SWC Logo Tee',
|
||||
'White Anchor Tee',
|
||||
'White Layered LS',
|
||||
'White LS',
|
||||
'White Tee',
|
||||
'White V-Neck Tee',
|
||||
'Yellow Layered LS'],
|
||||
'head': ['Anglerfish Mask',
|
||||
'Bucket Hat',
|
||||
'Eel-Cake Hat',
|
||||
'Festive Party Cone',
|
||||
'Hockey Mask',
|
||||
'Koshien Bandana',
|
||||
'Kyonshi Hat',
|
||||
"Li'l Devil Horns",
|
||||
'Mecha Head - HTR',
|
||||
"New Year's Glasses DX",
|
||||
"Painter's Mask",
|
||||
'Squid Facemask',
|
||||
'Twisty Headband',
|
||||
'White Headband'],
|
||||
'shoes': ['Mecha Legs - LBS']},
|
||||
{'brand': 'Takoroka',
|
||||
'clothes': ['Choco Layered LS',
|
||||
'FC Albacore',
|
||||
'Gray Vector Tee',
|
||||
'Layered Vector LS',
|
||||
'Purple Camo LS',
|
||||
'Red Vector Tee',
|
||||
'Slipstream United',
|
||||
'Striped Rugby',
|
||||
'Takoroka Crazy Baseball LS',
|
||||
'Takoroka Galactic Tie Dye',
|
||||
'Takoroka Jersey',
|
||||
'Takoroka Nylon Vintage',
|
||||
'Takoroka Rainbow Tie Dye',
|
||||
'Takoroka Windcrusher',
|
||||
'Tricolor Rugby'],
|
||||
'head': ['Takoroka Mesh', 'Takoroka Visor'],
|
||||
'shoes': ['Athletic Arrows',
|
||||
'Blue Power Stripes',
|
||||
'Crazy Arrows',
|
||||
'LE Soccer Shoes',
|
||||
'New-Day Arrows',
|
||||
'Orange Arrows',
|
||||
'Orca Hi-Tops',
|
||||
'Orca Passion Hi-Tops',
|
||||
'Orca Woven Hi-Tops',
|
||||
'Red Power Stripes',
|
||||
'Soccer Shoes',
|
||||
'Sunset Orca Hi-Tops',
|
||||
'Trooper Power Stripes',
|
||||
'White Arrows']},
|
||||
{'brand': 'Tentatek',
|
||||
'clothes': ['Black Squideye',
|
||||
'Blue Tentatek Tee',
|
||||
'Cycle King Jersey',
|
||||
'Lob-Stars Jersey',
|
||||
'Part-Time Pirate',
|
||||
'Red Tentatek Tee',
|
||||
'Silver Tentatek Vest',
|
||||
'Sky-Blue Squideye',
|
||||
'Tentatek Slogan Tee'],
|
||||
'head': ['Cycle King Cap',
|
||||
'Fake Contacts',
|
||||
'Green Novelty Visor',
|
||||
'Orange Novelty Visor',
|
||||
'Pink Novelty Visor',
|
||||
'Purple Novelty Visor',
|
||||
'Soccer Headband',
|
||||
'Sun Visor',
|
||||
'Tennis Headband'],
|
||||
'shoes': ['Amber Sea Slug Hi-Tops',
|
||||
'Black Norimaki 750s',
|
||||
'Black Trainers',
|
||||
'Blue Iromaki 750s',
|
||||
'Blue Sea Slugs',
|
||||
'Canary Trainers',
|
||||
'Cyan Trainers',
|
||||
'Gray Sea-Slug Hi-Tops',
|
||||
'Green Iromaki 750s',
|
||||
'Icy Down Boots',
|
||||
'Neon Sea Slugs',
|
||||
'Orange Iromaki 750s',
|
||||
'Pink Trainers',
|
||||
'Purple Iromaki 750s',
|
||||
'Purple Sea Slugs',
|
||||
'Red Iromaki 750s',
|
||||
'Red Sea Slugs',
|
||||
'Red-Mesh Sneakers',
|
||||
'Sea Slug Volt 95s',
|
||||
'Sesame Salt 270s',
|
||||
'Snowy Down Boots',
|
||||
'Violet Trainers',
|
||||
'White Norimaki 750s',
|
||||
'Yellow Iromaki 750s',
|
||||
'Yellow-Mesh Sneakers']},
|
||||
{'brand': 'Toni Kensa',
|
||||
'clothes': ['Dark Bomber Jacket',
|
||||
'Front Zip Vest',
|
||||
'Half-Sleeve Sweater',
|
||||
'Ink-Wash Shirt',
|
||||
'Inkfall Shirt',
|
||||
'Kensa Coat',
|
||||
'Kung-Fu Zip-Up',
|
||||
'Light Bomber Jacket',
|
||||
'Negative Longcuff Sweater',
|
||||
'Panda Kung-Fu Zip-Up',
|
||||
'Positive Longcuff Sweater',
|
||||
'Pullover Coat',
|
||||
'Short Knit Layers',
|
||||
'Toni K. Baseball Jersey'],
|
||||
'head': ['Face Visor', 'Ink-Guard Goggles', 'Toni Kensa Goggles'],
|
||||
'shoes': ['Arrow Pull-Ons',
|
||||
'Toni Kensa Black Hi-Tops',
|
||||
'Toni Kensa Soccer Shoes']},
|
||||
{'brand': 'Zekko',
|
||||
'clothes': ['Birded Corduroy Jacket',
|
||||
'Black LS',
|
||||
'Black Polo',
|
||||
'Deep-Octo Satin Jacket',
|
||||
'Gray Mixed Shirt',
|
||||
'Green-Check Shirt',
|
||||
'Logo Aloha Shirt',
|
||||
'Olive Zekko Parka',
|
||||
'Red-Check Shirt',
|
||||
'Reel Sweat',
|
||||
'Squid Satin Jacket',
|
||||
'Tumeric Zekko Coat',
|
||||
'Varsity Jacket',
|
||||
'Zapfish Satin Jacket',
|
||||
'Zekko Baseball LS',
|
||||
'Zekko Hoodie',
|
||||
'Zekko Jade Coat',
|
||||
'Zekko Long Carrot Tee',
|
||||
'Zekko Long Radish Tee',
|
||||
'Zekko Redleaf Coat'],
|
||||
'head': ['Backwards Cap',
|
||||
'Black Arrowbands',
|
||||
'Double Egg Shades',
|
||||
'Five-Panel Cap',
|
||||
'Jogging Headband',
|
||||
'Matte Bike Helmet',
|
||||
'MTB Helmet',
|
||||
'Tinted Shades',
|
||||
'White Arrowbands',
|
||||
'Zekko Cap',
|
||||
'Zekko Mesh'],
|
||||
'shoes': ['Black Flip-Flops',
|
||||
'Blue Lo-Tops',
|
||||
'LE Lo-Tops',
|
||||
'Marination Lace-Ups',
|
||||
'Orange Lo-Tops',
|
||||
'Pearl-Scout Lace-Ups',
|
||||
'Suede Gray Lace-Ups',
|
||||
'Suede Marine Lace-Ups',
|
||||
'Suede Nation Lace-Ups']},
|
||||
{'brand': 'Zink',
|
||||
'clothes': ['B-ball Jersey (Away)',
|
||||
'B-ball Jersey (Home)',
|
||||
'Cycling Shirt',
|
||||
'Dakro Golden Tee',
|
||||
'Dakro Nana Tee',
|
||||
'Inkopolis Squaps Jersey',
|
||||
'Navy Deca Logo Tee',
|
||||
'Retro Gamer Jersey',
|
||||
'School Jersey',
|
||||
'Urchins Jersey',
|
||||
'White Deca Logo Tee',
|
||||
'Zink Layered LS',
|
||||
'Zink LS'],
|
||||
'head': ['B-ball Headband',
|
||||
'Cycling Cap',
|
||||
'Golf Visor',
|
||||
'Squash Headband',
|
||||
'Swim Goggles'],
|
||||
'shoes': ['Black Dakroniks',
|
||||
'Black Seahorses',
|
||||
'Blue Laceless Dakroniks',
|
||||
'Chocolate Dakroniks',
|
||||
'Gold Hi-Horses',
|
||||
'Mint Dakroniks',
|
||||
'Purple Hi-Horses',
|
||||
'Red Hi-Horses',
|
||||
'White Laceless Dakroniks',
|
||||
'White Seahorses',
|
||||
'Yellow Seahorses',
|
||||
'Zombie Hi-Horses']}]
|
||||
|
||||
export const clothingGear = [
|
||||
"Clt_AMB000",
|
||||
"Clt_AMB001",
|
||||
|
|
|
|||
1
scripts/GearInfo_Clothes.json
Normal file
1
scripts/GearInfo_Clothes.json
Normal file
File diff suppressed because one or more lines are too long
1
scripts/GearInfo_Head.json
Normal file
1
scripts/GearInfo_Head.json
Normal file
File diff suppressed because one or more lines are too long
1
scripts/GearInfo_Shoes.json
Normal file
1
scripts/GearInfo_Shoes.json
Normal file
File diff suppressed because one or more lines are too long
54
scripts/generate_gear_json.py
Normal file
54
scripts/generate_gear_json.py
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import json
|
||||
from pprint import pprint
|
||||
|
||||
head = {}
|
||||
clothes = {}
|
||||
shoes = {}
|
||||
|
||||
with open("lang_dict_EUen.json") as f:
|
||||
lang_dict = json.load(f)
|
||||
|
||||
with open("GearInfo_Head.json") as f:
|
||||
data = json.load(f)
|
||||
for obj in data:
|
||||
if obj["ModelName"] in lang_dict:
|
||||
brand = lang_dict[obj["Brand"]]
|
||||
lista = head.get(brand, [])
|
||||
lista.append(lang_dict[obj["ModelName"]])
|
||||
head[brand] = lista
|
||||
|
||||
with open("GearInfo_Shoes.json") as f:
|
||||
data = json.load(f)
|
||||
for obj in data:
|
||||
if obj["ModelName"] in lang_dict:
|
||||
brand = lang_dict[obj["Brand"]]
|
||||
lista = shoes.get(brand, [])
|
||||
lista.append(lang_dict[obj["ModelName"]])
|
||||
shoes[brand] = lista
|
||||
|
||||
with open("GearInfo_Clothes.json") as f:
|
||||
data = json.load(f)
|
||||
for obj in data:
|
||||
if obj["ModelName"] in lang_dict:
|
||||
brand = lang_dict[obj["Brand"]]
|
||||
lista = clothes.get(brand, [])
|
||||
lista.append(lang_dict[obj["ModelName"]])
|
||||
clothes[brand] = lista
|
||||
|
||||
to_file = []
|
||||
brands = sorted(
|
||||
list(set(list(head.keys()) + list(clothes.keys()) + list(shoes.keys()))),
|
||||
key=str.casefold,
|
||||
)
|
||||
|
||||
for b in brands:
|
||||
to_file.append(
|
||||
{
|
||||
"brand": b,
|
||||
"head": sorted(head.get(b, []), key=str.casefold),
|
||||
"clothes": sorted(clothes.get(b, []), key=str.casefold),
|
||||
"shoes": sorted(shoes.get(b, []), key=str.casefold),
|
||||
}
|
||||
)
|
||||
|
||||
pprint(to_file)
|
||||
Loading…
Reference in New Issue
Block a user