diff --git a/brush/src/components/Map/OAMLayer/index.js b/brush/src/components/Map/OAMLayer/index.js index f16f371..a1f83af 100644 --- a/brush/src/components/Map/OAMLayer/index.js +++ b/brush/src/components/Map/OAMLayer/index.js @@ -1,48 +1,30 @@ import React from 'react' import PropTypes from 'prop-types' import { Layer } from 'react-konva' +import { range } from 'ramda' import PointOam from '../Point/PointOam' -const OAMLayer = ({ setSelectedPointInfos, vision }) => { +const OAMLayer = ({ setSelectedPointInfos, totalStages, vision }) => { const { oam } = vision const oamList = oam .map(oamEntry => oamEntry.data) - .map(({ - kind, - xStage1, - xStage2, - xStage3, - yStage1, - yStage2, - yStage3, - }) => - [ - , - , - , - ]) + .map(oamData => + range(1, totalStages + 1).map((i) => { + const x = oamData[`xStage${i}`] + const y = oamData[`yStage${i}`] + + return ( + + ) + })) return ( @@ -53,6 +35,7 @@ const OAMLayer = ({ setSelectedPointInfos, vision }) => { OAMLayer.propTypes = { setSelectedPointInfos: PropTypes.func, + totalStages: PropTypes.number.isRequired, vision: PropTypes.shape({ oam: PropTypes.arrayOf(PropTypes.shape({ data: PropTypes.object.isRequired, diff --git a/brush/src/components/Map/index.js b/brush/src/components/Map/index.js index 03f12c9..65ce195 100644 --- a/brush/src/components/Map/index.js +++ b/brush/src/components/Map/index.js @@ -21,6 +21,7 @@ const Map = ({ infos: { tilemap: { height, + totalStages, width, }, }, @@ -47,6 +48,7 @@ const Map = ({ /> {optShowOAM && } diff --git a/scissors/src/visionManager.js b/scissors/src/visionManager.js index 6f2cbca..0fa7ce8 100644 --- a/scissors/src/visionManager.js +++ b/scissors/src/visionManager.js @@ -31,7 +31,13 @@ const extractOAM = (romBuffer, [addressStart, addressEnd]) => .skip(4) .word16lu('xStage3') .word16lu('yStage3') - .skip(21) + .skip(4) + .word16lu('xStage4') + .word16lu('yStage4') + .skip(4) + .word16lu('xStage5') + .word16lu('yStage5') + .skip(5) .word8lu('kind') .vars, memory, diff --git a/scissors/src/visions/1-1.js b/scissors/src/visions/1-1.js index 6133b32..b5c36bc 100644 --- a/scissors/src/visions/1-1.js +++ b/scissors/src/visions/1-1.js @@ -4,6 +4,7 @@ export default { oam: [0xE2B90, 0xE2F59], }, tilemap: { + totalStages: 3, height: 60, width: 420, scheme: [ diff --git a/scissors/src/visions/1-2.js b/scissors/src/visions/1-2.js index f9c195a..6e7ab8d 100644 --- a/scissors/src/visions/1-2.js +++ b/scissors/src/visions/1-2.js @@ -4,6 +4,7 @@ export default { oam: [0xE3CC0, 0xE3FAC], }, tilemap: { + totalStages: 3, height: 60, width: 300, scheme: [