Skip to content

Commit

Permalink
fix: fix summer body wrong variant
Browse files Browse the repository at this point in the history
  • Loading branch information
monodyle committed Aug 9, 2022
1 parent 72cfa47 commit 148200c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 17 deletions.
19 changes: 10 additions & 9 deletions components/axie-figure/AxieFigure.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { getSpineFromAdultCombo } from '@axieinfinity/mixer'
import * as PIXI from 'pixi.js'
import 'pixi-spine'
import React, { useEffect, useRef, useState } from 'react'
import { getSpineFromAdultCombo } from '@axieinfinity/mixer'

import { PuffLoading } from '../puff-loading/PuffLoading'
import { BodyOrAnimationDropdown } from './body-or-animation-dropdown/BodyOrAnimationDropdown'
import { ColorDropdown } from './color-dropdown/ColorDropdown'
import { animationList, colorsArray, summerColors } from './constants'
import key from './key.json'
import s from './styles.module.css'
import { colorsArray, animationList } from './constants'
import { Part, Color } from './types'
import { PlaygroundGame } from './PlaygroundGame'
import { PartsDropdown } from './parts-dropdown/PartsDropdown'
import { ColorDropdown } from './color-dropdown/ColorDropdown'
import { BodyOrAnimationDropdown } from './body-or-animation-dropdown/BodyOrAnimationDropdown'
import { PlaygroundGame } from './PlaygroundGame'
import s from './styles.module.css'
import { Color, Part } from './types'

import 'pixi-spine'

interface AxieParts {
ears: Part
Expand Down Expand Up @@ -235,7 +236,7 @@ export const AxieFigure = () => {
show={showHelperTextStatus.body}
/>
<ColorDropdown
options={colorsArray}
options={body === 'body-summer' ? summerColors : colorsArray}
setValue={setColor}
value={color}
title="Color"
Expand Down
7 changes: 3 additions & 4 deletions components/axie-figure/PlaygroundGame.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as PIXI from "pixi.js";

import { Key, contain } from "../../utils/helper";
import { Figure } from "./Figure";
import { contain, Key } from "../../utils/helper";
import { CurrentFigure } from "./CurrentFigure";
import { Figure } from "./Figure";
import { AxieDirection, Mixer } from "./types";

class ContainerWithVelocity extends PIXI.Container {
Expand Down Expand Up @@ -37,7 +37,7 @@ export class PlaygroundGame extends PIXI.Application {

this.loader.load(async () => {
const currentFigure = new CurrentFigure();
const figure = await Figure.fromAxieId(this.loader, "150");
const figure = await Figure.fromAxieId(this.loader, "11390642");
currentFigure.currentSpine = figure;
currentFigure.addChild(figure);
currentFigure.changeCurrentAnimation("action/idle/normal", true);
Expand All @@ -48,7 +48,6 @@ export class PlaygroundGame extends PIXI.Application {
this.stage?.addChild(currentFigure);
this.currentFigure = currentFigure;
this.currentFigure.registerKeyBoardController();

});

this.stage?.on("pointerdown", () => {
Expand Down
53 changes: 49 additions & 4 deletions components/axie-figure/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,56 @@
import animations from "../../node_modules/@axieinfinity/mixer/dist/data/axie-2d-v3-stuff-animations.json";

import { Color } from "./types";
import key from "./key.json";

import { Color } from "./types";

export const animationList: string[] = animations.items.header
.map((obj) => obj.name)
.filter((obj) => obj.substring(0, 10) !== "action/mix");

export const colorsArray: Color[] = key.items.colors;
export const colorsArray: Color[] = key.items.colors;
export const summerColors: Color[] = [
{
key: "aquatic-summer",
primary1: "Aquatic",
primary2: "",
},
{
key: "bird-summer",
primary1: "Bird",
primary2: "",
},
{
key: "dawn-summer",
primary1: "Dawn",
primary2: "",
},
{
key: "mech-summer",
primary1: "Mech",
primary2: "",
},
{
key: "reptile-summer",
primary1: "Reptile",
primary2: "",
},
{
key: "beast-summer",
primary1: "Beast",
primary2: "",
},
{
key: "bug-summer",
primary1: "Bug",
primary2: "",
},
{
key: "dusk-summer",
primary1: "Dusk",
primary2: "",
},
{
key: "plant-summer",
primary1: "Plant",
primary2: "",
},
];

0 comments on commit 148200c

Please sign in to comment.