diff --git a/src/TestPanel.js b/src/TestPanel.js index ef1343c..4f29298 100644 --- a/src/TestPanel.js +++ b/src/TestPanel.js @@ -134,6 +134,40 @@ function PopupWindow(p) { } +function SelectorWindow(p) { + + const [itemList,setItemList] = useState([]) + + const [tabPage,setTabPage] = useState(1) + const [sortSelector,setSortSelector] = useState(p.sortItems[0]) + const [filter,setFilter] = useState("") + + useEffect(()=>{ + setItemList(p.dataFunction()) + },[p]) + + return +
+
+ +
+
+ {p.filter&&{setFilter(f.currentTarget.value)}} />} +
+
+
+ +
+
+} + function TestPanel(p) { const [bpGraphMax,setbpGraphMax] = useState(1000) const [hpGraphMax,sethpGraphMax] = useState(1000) @@ -152,16 +186,7 @@ const [effectPage,setEffectPage] = useState(1) const [weaponPage,setWeaponPage] = useState(1) const [statPage,setStatPage] = useState(1) -const [modalOpen,setModalOpen] = useState(false) -const [tabPage,setTabPage] = useState(1) -const [sortSelector,setSortSelector] = useState("Standard Sort") -const sortItems=[ - {name:"Standard Sort",value:"id"}, - {name:"Rarity",value:"rarity"}, - {name:"Attack",value:"atk"}, - {name:"Potency",value:"potency"}] -const [filter,setFilter] = useState("") -const filterEnabled=true +const [weaponSelectWindowOpen,setWeaponSelectWindowOpen] = useState(false) useEffect(()=>{ if (p.bp>1000) { @@ -179,20 +204,6 @@ useEffect(()=>{ } },[p.bp]) -const [itemList,setItemList] = useState([]) - -useEffect(()=>{ - var dat1=p.GetData("weapon_existence_data") - if (Array.isArray(dat1)) { - setItemList(dat1.map((we)=>{ - var weapon_type=p.GetData("weapon_type",we.weapon_type_id,undefined,true) - var weapon=p.GetData("weapon",we.weapon_id,undefined,true) - var potential=p.GetData("potential",weapon.potential_id,undefined,true) - return [weapon_type,weapon,potential] - })) - } -},[p]) - //console.log(p.GetData("class",p.className,"icon")) return (<> @@ -264,7 +275,7 @@ useEffect(()=>{

Equip

-
{setModalOpen(true)}} className="equipPaletteSlot">

Weapons

1
+
{setWeaponSelectWindowOpen(true)}} className="equipPaletteSlot">

Weapons

1

Armor 1

Armor 2

Armor 3

@@ -423,67 +434,38 @@ useEffect(()=>{
- -
-
- -
-
- {filterEnabled&&{setFilter(f.currentTarget.value)}} />} -
-
-
- -
-
+ }} + searchFieldFunction={(searchText,item)=>searchText.length>0?(item[1].name.toLowerCase()+" "+item[0].name.toLowerCase()).includes(searchText.toLowerCase()):true} + sortOrderFunction={(sort,itemA,itemB)=>{ + switch (sort) { + case "Rarity":return itemB[1].rarity-itemA[1].rarity + case "Attack":return itemB[1].atk-itemA[1].atk + default:return 0 + } + }} + displayFunction={(item)=>
  • {item[1].name} {item[0].name}
    {item[1].atk} {item[2].name}Lv.4: Potency +24%/
    20% chance of Restasigne not being consumed on use. Effect starts 10 sec after equip
  • } + /> )