From 6204fc70b1c8b5cd74892cc1bdcbfa2772df2630 Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Tue, 17 Aug 2021 21:22:48 +0900 Subject: [PATCH 1/3] class selector window is back. And now with swapping --- src/TestPanel.js | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/TestPanel.js b/src/TestPanel.js index 4f213a9..65fdcaa 100644 --- a/src/TestPanel.js +++ b/src/TestPanel.js @@ -125,6 +125,19 @@ function SelectorWindow(p) { } +function ClassSelectorWindow(p) { + return { + var dat1 = p.GetData("class") + return Object.keys(dat1) + } + } + displayFunction={(key) => { + return
  • {if (p.editClass===0){p.setClassName(key);p.setSubClassName(p.subClass===key?p.class:p.subClass)}else{p.setSubClassName(key);p.setClassName(p.class===key?p.subClass:p.class)}; p.setModalOpen(false) }}> {p.GetData("class", key, "name")}
  • + }} +/> +} + function GetSpecialWeaponName(item) { return item[WEAPON_EXISTENCE_DATA]!==undefined?(item[WEAPON_EXISTENCE_DATA].special_name?.length>0)?item[WEAPON_EXISTENCE_DATA].special_name:(item[WEAPON_WEAPON].name+" "+item[WEAPON_WEAPONTYPE].name):"" } @@ -501,25 +514,7 @@ AUGMENT -{setClassSelectWindowOpen(false)}} shouldFocusAfterRender={true} shouldCloseOnOverlayClick={true} shouldCloseOnEsc={true} className="modal" overlayClassName="modalOverlay"> -
    -
    -

    Select Main Class

    -
    { setClassSkillTreeWindowOpen(false) }}>
    -
    -
    -
      -
    • Hunter
    • -
    • Fighter
    • -
    • Ranger
    • -
    • Gunner
    • -
    • Force
    • -
    • Techter
    • -
    • Braver
    • -
    -
    -
    -
    + From 2d76fb3b9592e402074a2270ad5a3d60598ac670 Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Tue, 17 Aug 2021 21:52:53 +0900 Subject: [PATCH 2/3] Sub and main class are now selectable in the popup --- src/TestPanel.js | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/TestPanel.js b/src/TestPanel.js index 65fdcaa..306a601 100644 --- a/src/TestPanel.js +++ b/src/TestPanel.js @@ -43,13 +43,13 @@ function EditBoxInput(p) { } function PageControlButton(p) { - return
  • {p.setCurrentPage(p.page)}} className={(p.currentPage===p.page)?"selected":"unselected"}>{p.pageName?p.pageName:p.page}
  • + return
  • {if (p.onPageChange) {p.onPageChange(p.pageName)} p.setCurrentPage(p.page)}} className={(p.currentPage===p.page)?"selected":"unselected"}>{p.pageName?p.pageName:p.page}
  • } function PageControl(p) { var pages = [] for (var i=0;i) + pages.push() } if (p.children!==undefined) { pages.push(
  • {p.children}
  • ) @@ -80,7 +80,7 @@ function PopupWindow(p) {

    {p.title}

    {p.showCloseButton&&
    {p.setModalOpen(false)}}>
    } - + {p.children} @@ -100,10 +100,17 @@ function SelectorWindow(p) { setItemList(p.dataFunction()) } },[p]) + + useEffect(()=>{ + if (p.onModalOpen) { + p.onModalOpen(setTabPage) + } + },[p.modalOpen]) return {(p.sortItems||p.filter)&&
    @@ -126,7 +133,22 @@ function SelectorWindow(p) { } function ClassSelectorWindow(p) { - return { + setTitle((p.editClass)?"Select Sub Class":"Select Main Class") + },[p.editClass]) + return { + if (page==="Main Class") { + p.setEditClass(0) + } else { + p.setEditClass(1) + } + }} + onModalOpen={(pageSetter)=>{ + pageSetter((p.editClass)?2:1) + }} dataFunction={() => { var dat1 = p.GetData("class") return Object.keys(dat1) @@ -514,7 +536,7 @@ AUGMENT
    - + From 2634dbc28eb8ad853d4483e35188928a15cde088 Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Tue, 17 Aug 2021 21:58:49 +0900 Subject: [PATCH 3/3] Fix skill tree height calculation --- src/skilltree/skillTree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skilltree/skillTree.js b/src/skilltree/skillTree.js index 959cadf..1d74f39 100644 --- a/src/skilltree/skillTree.js +++ b/src/skilltree/skillTree.js @@ -7,7 +7,7 @@ function SkillTree(p) { useEffect(() => { setWidth(p.gridSizeX*p.gridDimensionsX+p.gridPaddingX*(p.gridDimensionsX-1)) - setHeight(p.gridSizeY*Math.ceil(p.gridDimensionsY)+p.halflineheight*Math.floor(p.gridDimensionsY)+p.gridPaddingY*(p.gridDimensionsY-1)) + setHeight(p.gridSizeY*Math.ceil(p.gridDimensionsY/2)+p.halflineheight*Math.ceil((p.gridDimensionsY-1)/2)+p.gridPaddingY*(p.gridDimensionsY-1)) }, [p.halflineheight,p.skillLines,p.gridSizeX,p.gridSizeY,p.gridPaddingX,p.gridPaddingY,p.gridDimensionsX,p.gridDimensionsY]) useEffect(()=>{