It's not an array anymore halleluiah.

master
Joshua Sigona 3 years ago
parent 8461019940
commit dd21de6a64
  1. 14
      src/TestPanel.js

@ -184,10 +184,7 @@ function SkillBox(p) {
return <div className={p.className} style={{ gridArea: ConvertCoordinate(Number(p.skill[0]),Number(p.skill[1])) }}><img className="skillIcon" alt="" src={DisplayIcon(p.GetData("class_skill",p.skill[2],"icon",true))} /><span className="skillAllocated">{(p.skillPointData[p.page-1][p.boxId]?p.skillPointData[p.page-1][p.boxId]:0)+"/"+p.maxPoints}</span><em className="skillName">{typeof p.GetData("class_skill",p.skill[2],"name",true)==="string"&&p.GetData("class_skill",p.skill[2],"name",true)}</em><div className="skillButtons"> return <div className={p.className} style={{ gridArea: ConvertCoordinate(Number(p.skill[0]),Number(p.skill[1])) }}><img className="skillIcon" alt="" src={DisplayIcon(p.GetData("class_skill",p.skill[2],"icon",true))} /><span className="skillAllocated">{(p.skillPointData[p.page-1][p.boxId]?p.skillPointData[p.page-1][p.boxId]:0)+"/"+p.maxPoints}</span><em className="skillName">{typeof p.GetData("class_skill",p.skill[2],"name",true)==="string"&&p.GetData("class_skill",p.skill[2],"name",true)}</em><div className="skillButtons">
<LeftButton onClick={()=>{ <LeftButton onClick={()=>{
var temp=[...p.points] var temp=[...p.points]
var tempData={...p.skillPointData} var tempData=[...p.skillPointData]
if (!tempData[p.page-1]) {
tempData[p.page-1]={}
}
if (!tempData[p.page-1][p.boxId]) { if (!tempData[p.page-1][p.boxId]) {
tempData[p.page-1][p.boxId]=0 tempData[p.page-1][p.boxId]=0
} }
@ -199,10 +196,7 @@ function SkillBox(p) {
}}}/> }}}/>
<RightButton onClick={()=>{ <RightButton onClick={()=>{
var temp=[...p.points] var temp=[...p.points]
var tempData={...p.skillPointData} var tempData=[...p.skillPointData]
if (!tempData[p.page-1]) {
tempData[p.page-1]={}
}
if (!tempData[p.page-1][p.boxId]) { if (!tempData[p.page-1][p.boxId]) {
tempData[p.page-1][p.boxId]=0 tempData[p.page-1][p.boxId]=0
} }
@ -329,7 +323,7 @@ const [armorSlotSelection,setArmorSlotSelection] = useState(1)
const [classNameSetter,setClassNameSetter] = useState(0) const [classNameSetter,setClassNameSetter] = useState(0)
const [points,setPoints] = useState([]) const [points,setPoints] = useState([])
const [skillPointData,setSkillPointData] = useState({}) const [skillPointData,setSkillPointData] = useState([])
useEffect(()=>{ useEffect(()=>{
console.log(skillPointData) console.log(skillPointData)
@ -386,7 +380,7 @@ useEffect(()=>{
var pointsDataArr = [] var pointsDataArr = []
for (var i=0;i<keys.length;i++) { for (var i=0;i<keys.length;i++) {
pointsArr.push(0) pointsArr.push(0)
pointsDataArr.push([]) pointsDataArr.push({})
if (keys[i]===className) { if (keys[i]===className) {
setTreePage(i+1) setTreePage(i+1)
} }

Loading…
Cancel
Save