diff --git a/public/goldboi.jpg b/public/goldboi.jpg new file mode 100644 index 0000000..e54ced2 Binary files /dev/null and b/public/goldboi.jpg differ diff --git a/src/App.js b/src/App.js index edf4d95..1744e5f 100644 --- a/src/App.js +++ b/src/App.js @@ -778,7 +778,7 @@ function App() { setDATAID(data.data) }) } - },[update]) + },[update,TESTMODE]) useEffect(()=>{ axios.get(GetBackendURL({TESTMODE:TESTMODE})+"/data") diff --git a/src/TestPanel.js b/src/TestPanel.js index 11ab10b..4f213a9 100644 --- a/src/TestPanel.js +++ b/src/TestPanel.js @@ -1,4 +1,4 @@ -import React, { useEffect,useState,useRef } from 'react'; +import React, { useEffect,useState } from 'react'; import Modal from 'react-modal' import { DisplayIcon } from './DEFAULTS'; import { ExpandTooltip } from './components/ExpandTooltip'; @@ -7,29 +7,6 @@ import { SkillTree } from './skilltree/skillTree'; //Helper variables for Weapon selector with structure: [weapon_type,weapon,potential,potential_tooltip,weapon_existence_data] const WEAPON_WEAPONTYPE=0;const WEAPON_WEAPON=1;const WEAPON_POTENTIAL=2;const WEAPON_POTENTIAL_TOOLTIP=3;const WEAPON_EXISTENCE_DATA=4; -/** - * Hook that alerts clicks outside of the passed ref - */ - function useOutsideAlerter(ref,setEdit) { - useEffect(() => { - /** - * Alert if clicked on outside of element - */ - function handleClickOutside(event) { - if (ref.current && !ref.current.contains(event.target)) { - setEdit(false) - } - } - - // Bind the event listener - document.addEventListener("mousedown", handleClickOutside); - return () => { - // Unbind the event listener on clean up - document.removeEventListener("mousedown", handleClickOutside); - }; - }, [ref,setEdit]); -} - function EditBox(p) { useEffect(()=>{ var timer1 = setTimeout(()=>{ @@ -89,23 +66,6 @@ function Class(p) { return class_obj?<>{class_obj.name}:<> } -function ClassSelector(p){ - const CLASSES = p.GetData("class") - const wrapperRef = useRef(null); - useOutsideAlerter(wrapperRef,p.setEdit); - return <>
- Class Selector
-
- {Object.keys(CLASSES).map((cl,i)=>{ - return - })} -
-
- -} - - - function EditableClass(p){ return <>
{p.setClassNameSetter(p.editClass);p.setClassSelectWindowOpen(true)}}>