From d595aa932d10983575a65314b0a44944f2fc036e Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Fri, 13 Aug 2021 06:06:28 +0000 Subject: [PATCH] Implemented some editor features --- src/skilltree/skillTree.js | 2 +- src/skilltree/skillTreeEditor.js | 31 ++++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/skilltree/skillTree.js b/src/skilltree/skillTree.js index a676f5a..1558e03 100644 --- a/src/skilltree/skillTree.js +++ b/src/skilltree/skillTree.js @@ -47,7 +47,7 @@ function SkillTree(p) { return + height={height} ref={canvasRef} {...p}>{p.children} } export {SkillTree} \ No newline at end of file diff --git a/src/skilltree/skillTreeEditor.js b/src/skilltree/skillTreeEditor.js index 8861ef8..77aa1e9 100644 --- a/src/skilltree/skillTreeEditor.js +++ b/src/skilltree/skillTreeEditor.js @@ -1,12 +1,37 @@ import { SkillTree } from "./skillTree"; -import { useState } from "react"; +import { useEffect, useState } from "react"; function SkillTreeEditor(p) { const [lineColor,setLineColor] = useState("#000000") + const [lineWidth,setLineWidth] = useState(3) + const [dimensionX,setDimensionX] = useState(6) + const [dimensionY,setDimensionY] = useState(6) + const [gridSizeX,setGridSizeX] = useState(80) + const [gridSizeY,setGridSizeY] = useState(60) + const [gridPaddingX,setGridPaddingX] = useState(10) + const [gridPaddingY,setGridPaddingY] = useState(10) + const [renderedInputs,setRenderedInputs] = useState([]) + + useEffect(()=>{ + var controls = [] + for (var x=0;x) + } + } + },[dimensionX,dimensionY,gridSizeX,gridSizeY,gridPaddingX,gridPaddingY]) return <> - {setLineColor(f.currentTarget.value)}}/> + {setLineWidth(f.currentTarget.value)}}/> + {setDimensionX(f.currentTarget.value)}}/> + {setDimensionY(f.currentTarget.value)}}/> + {setGridSizeX(f.currentTarget.value)}}/> + {setGridSizeY(f.currentTarget.value)}}/> + {setGridPaddingX(f.currentTarget.value)}}/> + {setGridPaddingY(f.currentTarget.value)}}/> +