Confirm and cancel button implementations completed.

master
Joshua Sigona 3 years ago
parent 1a9841d2b9
commit 0a7a4977e3
  1. 39
      src/TestPanel.js

@ -389,7 +389,18 @@ function FoodPopupWindow(p) {
} }
} }
return <SelectorWindow title={"Food Menu"} modalOpen={p.foodMenuWindowOpen} setModalOpen={p.setFoodMenuWindowOpen} GetData={p.GetData} footer={<><div className="foodPoints"><div>Foods in Recipe</div><div>{FOODCOUNT}</div></div><div className="foodConfirm"><div>Confirm</div><div>Cancel</div></div></>} return <SelectorWindow title={"Food Menu"} modalOpen={p.foodMenuWindowOpen} setModalOpen={p.setFoodMenuWindowOpen} GetData={p.GetData}
footer={
<>
<div className="foodPoints">
<div>Foods in Recipe</div>
<div>{FOODCOUNT}</div>
</div>
<div className="foodConfirm">
<div onClick={()=>{p.setFoodMenuWindowOpen(false)}}>Confirm</div>
<div onClick={()=>{p.setFoodMenuWindowOpen(false);p.setFoodPointData(p.prevFoodPointData)}}>Cancel</div>
</div>
</>}
sortItems={["Standard Sort","Alphabetical","Food Name","Food Type","Popularity"]} sortItems={["Standard Sort","Alphabetical","Food Name","Food Type","Popularity"]}
filter={true} filter={true}
dataFunction={()=>{ dataFunction={()=>{
@ -460,6 +471,7 @@ const [classNameSetter,setClassNameSetter] = useState(0)
const [points,setPoints] = useState([]) const [points,setPoints] = useState([])
const [skillPointData,setSkillPointData] = useState([]) const [skillPointData,setSkillPointData] = useState([])
const [prevSkillPointData,setPrevSkillPointData] = useState([]) const [prevSkillPointData,setPrevSkillPointData] = useState([])
const [prevPoints,setPrevPoints] = useState([])
const [foodPointData,setFoodPointData] = useState({}) const [foodPointData,setFoodPointData] = useState({})
const [prevFoodPointData,setPrevFoodPointData] = useState({}) const [prevFoodPointData,setPrevFoodPointData] = useState({})
@ -468,13 +480,13 @@ const [BUFFS,setBUFFS] = useState({})
function CalculateBuffs(foodPointData) { function CalculateBuffs(foodPointData) {
var boost_prefixes = { const boost_prefixes = {
pp_consumption:"Rich", pp_consumption:"Rich",
pp_recovery:"Light", pp_recovery:"Light",
weak_point_dmg:"Crisp", weak_point_dmg:"Crisp",
hp_recovery:"Robust", hp_recovery:"Robust",
} }
var boost_suffixes = { const boost_suffixes = {
potency:"Meat", potency:"Meat",
pp:"Fruit", pp:"Fruit",
dmg_res:"Vegetable", dmg_res:"Vegetable",
@ -605,11 +617,19 @@ useEffect(()=>{
},[foodPointData]) },[foodPointData])
useEffect(()=>{ useEffect(()=>{
console.log(BUFFS) console.log(prevSkillPointData)
},[BUFFS]) },[prevSkillPointData])
//console.log(p.GetData("class",p.className,"icon")) //console.log(p.GetData("class",p.className,"icon"))
function deepCopySkills(skillData) {
var newSkillObj = []
for (var data of skillData) {
newSkillObj.push({...data})
}
return newSkillObj
}
return (<> return (<>
<Helmet> <Helmet>
@ -627,7 +647,7 @@ useEffect(()=>{
<div style={{gridArea:"author"}}>Author</div> <div style={{gridArea:"author"}}>Author</div>
<div style={{gridArea:"build"}}>Build Name</div> <div style={{gridArea:"build"}}>Build Name</div>
<div style={{gridArea:"class"}} onClick={()=>{setClassSelectWindowOpen(true)}}>Class</div> <div style={{gridArea:"class"}} onClick={()=>{setClassSelectWindowOpen(true)}}>Class</div>
<div style={{gridArea:"subclass"}} onClick={()=>{setClassSkillTreeWindowOpen(true)}}>Sub-Class</div> <div style={{gridArea:"subclass"}} onClick={()=>{setPrevPoints([...points]);setPrevSkillPointData(deepCopySkills(skillPointData));setClassSkillTreeWindowOpen(true)}}>Sub-Class</div>
<div style={{gridArea:"class2"}}><EditableClass editClass={0} setClassNameSetter={setClassNameSetter} GetData={p.GetData} setClassName={setClassName} name={className} setClassSelectWindowOpen={setClassSelectWindowOpen}></EditableClass></div> <div style={{gridArea:"class2"}}><EditableClass editClass={0} setClassNameSetter={setClassNameSetter} GetData={p.GetData} setClassName={setClassName} name={className} setClassSelectWindowOpen={setClassSelectWindowOpen}></EditableClass></div>
<div style={{gridArea:"subclass2"}}><EditableClass editClass={1} setClassNameSetter={setClassNameSetter} GetData={p.GetData} setClassName={setSubClassName} name={subclassName} setClassSelectWindowOpen={setClassSelectWindowOpen}></EditableClass></div> <div style={{gridArea:"subclass2"}}><EditableClass editClass={1} setClassNameSetter={setClassNameSetter} GetData={p.GetData} setClassName={setSubClassName} name={subclassName} setClassSelectWindowOpen={setClassSelectWindowOpen}></EditableClass></div>
@ -817,7 +837,7 @@ useEffect(()=>{
<div className="boxTitleBar"> <div className="boxTitleBar">
<h1>Current Effects</h1></div> <h1>Current Effects</h1></div>
<PageControl pages={2} currentPage={effectPage} setCurrentPage={setEffectPage}/> <PageControl pages={2} currentPage={effectPage} setCurrentPage={setEffectPage}/>
{effectPage===1?<><h3>Effect Name</h3><ul className="infoBuffs"><li onClick={()=>{setFoodMenuWindowOpen(true)}}>Food Boost Effect {effectPage===1?<><h3>Effect Name</h3><ul className="infoBuffs"><li onClick={()=>{setPrevFoodPointData({...foodPointData});setFoodMenuWindowOpen(true)}}>Food Boost Effect
<ul> <ul>
{Object.keys(BUFFS).length==0&&<li>Add Quick Food</li>} {Object.keys(BUFFS).length==0&&<li>Add Quick Food</li>}
{Object.keys(BUFFS).map((key)=><li><img alt="" src="https://i.imgur.com/TQ8EBW2.png" />&ensp;[{BUFFS[key].from}] {key} +{BUFFS[key].count}</li>)} {Object.keys(BUFFS).map((key)=><li><img alt="" src="https://i.imgur.com/TQ8EBW2.png" />&ensp;[{BUFFS[key].from}] {key} +{BUFFS[key].count}</li>)}
@ -905,7 +925,7 @@ useEffect(()=>{
<div>Your Skill Points<span>{20-points[treePage-1]}</span></div> <div>Your Skill Points<span>{20-points[treePage-1]}</span></div>
<div>SP<span></span>{points[treePage-1]}</div> <div>SP<span></span>{points[treePage-1]}</div>
</div> </div>
<div className="skillConfirm"><div>Confirm</div><div>Cancel</div></div> <div onClick={()=>{setClassSkillTreeWindowOpen(false)}} className="skillConfirm"><div>Confirm</div><div onClick={()=>{setPoints(prevPoints);setSkillPointData(prevSkillPointData);setClassSkillTreeWindowOpen(false)}}>Cancel</div></div>
</div> </div>
</Modal> </Modal>
@ -1000,7 +1020,8 @@ useEffect(()=>{
foodMenuWindowOpen={foodMenuWindowOpen} foodMenuWindowOpen={foodMenuWindowOpen}
setFoodMenuWindowOpen={setFoodMenuWindowOpen} setFoodMenuWindowOpen={setFoodMenuWindowOpen}
foodPointData={foodPointData} foodPointData={foodPointData}
setFoodPointData={setFoodPointData}/> setFoodPointData={setFoodPointData}
prevFoodPointData={prevFoodPointData}/>
<Modal ariaHideApp={false} isOpen={augmentSelectWindowOpen} onRequestClose={()=>{setAugmentSelectWindowOpen(false)}} shouldFocusAfterRender={true} shouldCloseOnOverlayClick={true} shouldCloseOnEsc={true} className="modal" overlayClassName="modalOverlay"> <Modal ariaHideApp={false} isOpen={augmentSelectWindowOpen} onRequestClose={()=>{setAugmentSelectWindowOpen(false)}} shouldFocusAfterRender={true} shouldCloseOnOverlayClick={true} shouldCloseOnEsc={true} className="modal" overlayClassName="modalOverlay">
<div className="box equipWindow"> <div className="box equipWindow">

Loading…
Cancel
Save