From f45b173986ca021d10d77311627bdf12357f500d Mon Sep 17 00:00:00 2001 From: dudleycu Date: Mon, 16 Aug 2021 22:12:56 +0900 Subject: [PATCH] Sig rewrote Class Selector OwO --- src/TestPanel.js | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/TestPanel.js b/src/TestPanel.js index 37fe5a8..f380b60 100644 --- a/src/TestPanel.js +++ b/src/TestPanel.js @@ -104,11 +104,22 @@ function ClassSelector(p){ } +function ClassSelectorWindow(p) { + return { + var dat1 = p.GetData("class") + return Object.keys(dat1) + } + } + displayFunction={(key) => { + return
  • { if (p.editClass===0){p.setClassName(key)}else{p.setSubClassName(key)}; p.setModalOpen(false) }}> {p.GetData("class", key, "name")}
  • + }} +/> +} + function EditableClass(p){ - const [edit,setEdit] = useState(false) - return <>
    {setEdit(!edit)}}> + return <>
    {p.setClassNameSetter(p.editClass);p.setClassSelectWindowOpen(true)}}>
    - {edit&&} } @@ -179,8 +190,8 @@ const [defGraphMax,setdefGraphMax] = useState(1000) const [author,setauthor] = useState("Player") const [buildName,setbuildName] = useState("Character") -const [className,setclassName] = useState("Hunter") -const [subclassName,setsubclassName] = useState("Force") +const [className,setClassName] = useState("Hunter") +const [subclassName,setSubClassName] = useState("Force") const [level,setLevel] = useState(20) const [secondaryLevel,setsecondaryLevel] = useState(20) @@ -211,6 +222,8 @@ const [skillTreeGridSizeY,setSkillTreeGridSizeY] = useState(148) const [skillTreeGridPaddingX,setSkillTreeGridPaddingX] = useState(10) const [skillTreeGridPaddingY,setSkillTreeGridPaddingY] = useState(48) +const [classNameSetter,setClassNameSetter] = useState(0) + function rarityCheck(v) { return v!==undefined?v.rarity!==undefined?" r"+v.rarity:"":"" @@ -255,9 +268,9 @@ useEffect(()=>{ - {setClassSelectWindowOpen(true)}} >Class + Class - + @@ -266,7 +279,7 @@ useEffect(()=>{ {setClassSkillTreeWindowOpen(true)}}>Sub-Class - + @@ -517,16 +530,7 @@ AUGMENT
    - { - var mythraSux = p.GetData("class") - return Object.keys(mythraSux) - } - } - displayFunction={(key) => { - return
  • { setclassName(key); setClassSelectWindowOpen(false) }}> {p.GetData("class", key, "name")}
  • - }} - /> + {setClassSkillTreeWindowOpen(false)}} shouldFocusAfterRender={true} shouldCloseOnOverlayClick={true} shouldCloseOnEsc={true} className="modalSkillTree" overlayClassName="modalOverlaySkillTree">