From 2aff73e055f6256fcf300ded9164c1380a3b1d6d Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Sat, 26 Jun 2021 15:31:19 +0900 Subject: [PATCH] Add Class Selector --- ngoplanner/public/icons/UINGSClassFi.png | Bin 0 -> 119 bytes ngoplanner/public/icons/UINGSClassFo.png | Bin 0 -> 215 bytes ngoplanner/public/icons/UINGSClassGu.png | Bin 0 -> 128 bytes ngoplanner/public/icons/UINGSClassHu.png | Bin 0 -> 116 bytes ngoplanner/public/icons/UINGSClassRa.png | Bin 0 -> 118 bytes ngoplanner/public/icons/UINGSClassTe.png | Bin 0 -> 197 bytes ngoplanner/src/App.css | 24 +++++++++ ngoplanner/src/App.js | 59 +++++++++++++++++++++-- 8 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 ngoplanner/public/icons/UINGSClassFi.png create mode 100644 ngoplanner/public/icons/UINGSClassFo.png create mode 100644 ngoplanner/public/icons/UINGSClassGu.png create mode 100644 ngoplanner/public/icons/UINGSClassHu.png create mode 100644 ngoplanner/public/icons/UINGSClassRa.png create mode 100644 ngoplanner/public/icons/UINGSClassTe.png diff --git a/ngoplanner/public/icons/UINGSClassFi.png b/ngoplanner/public/icons/UINGSClassFi.png new file mode 100644 index 0000000000000000000000000000000000000000..2a02475f66d2b61e1551c96d8b21a6e916de83c4 GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJTYyi9E0BKZeAf8b!pT4uV@Z%- zFoVOh8)-m}yr+v}h{WaOgoK2YloSSLiR1zf11E+i#|Q>)g{x5v*7*#@O|$lg0+lj& My85}Sb4q9e0EOxs+yDRo literal 0 HcmV?d00001 diff --git a/ngoplanner/public/icons/UINGSClassFo.png b/ngoplanner/public/icons/UINGSClassFo.png new file mode 100644 index 0000000000000000000000000000000000000000..9adb257ad48e8c41b39943033c5f7d47aa3b88b5 GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Vt`MGE0F&G|Nqx_HkjzkTae&^ zy{~0}ia1Mx{D7Kd{Q4*Fdhse{SDF`4FvioxF+}2W={ZNf76TsVixrn1eRyC0AaV(- zqRTY@O>-wOESMuWDT%qj#inubLVeyRO^N&`AG9$Ve6e21#vGybqd_*&JuEYJscrQ4 pH(zgDVb&^ju1s?mKNI`4&3;E5%MsgrOLd?<44$rjF6*2UngCQ#R4)Jk literal 0 HcmV?d00001 diff --git a/ngoplanner/public/icons/UINGSClassGu.png b/ngoplanner/public/icons/UINGSClassGu.png new file mode 100644 index 0000000000000000000000000000000000000000..d7286bccbc74edcce4ae1847f6d5e60725e2ecd1 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJTYyi9E0DI?_;rW8O(2lPSQ6wH z%;50sMjA+!r;B5V#O34!1|~N*H-m#5X#r{n7#>biYA|42#-w%LVG+X}+b7%%3|KA8-Hw literal 0 HcmV?d00001 diff --git a/ngoplanner/public/icons/UINGSClassHu.png b/ngoplanner/public/icons/UINGSClassHu.png new file mode 100644 index 0000000000000000000000000000000000000000..f63d037d52e5bb83e7c42e056b8bdc7c95c4502b GIT binary patch literal 116 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJTYyi9E0BKZ>}+|Ae+!VsSQ6wH z%;50sMjDVK(D3<%62mhAfddzsbQr?@O&J-?+8G*buF0DKRWf+G L`njxgN@xNAPwE?e literal 0 HcmV?d00001 diff --git a/ngoplanner/public/icons/UINGSClassTe.png b/ngoplanner/public/icons/UINGSClassTe.png new file mode 100644 index 0000000000000000000000000000000000000000..e00a36c70d707738d8685d85bcb29407a159d660 GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!T!2rAE0F%W%?1;F0SnH3FOULM z!BG{ if (e.key==="Enter") {p.setEdit(false)} -}} maxLength={p.maxlength?p.maxlength:20} onBlur={()=>{p.setEdit(false)}} value={p.value} onChange={(f)=>{p.setName(f.currentTarget.value)}}> +}} maxLength={p.maxlength?p.maxlength:20} onBlur={()=>{p.setEdit(false)}} value={p.value} onChange={(f)=>{f.currentTarget.value.length>0?p.setName(f.currentTarget.value):p.setName(p.originalName)}}> } @@ -36,19 +36,70 @@ function EditableBox(p) { return <>
{setEdit(true)}}> {edit? - + :<>{name}}
} +const CLASSES = { + HUNTER:{ + name:"Hunter", + icon:"icons/UINGSClassHu.png" + }, + FIGHTER:{ + name:"Fighter", + icon:"icons/UINGSClassFi.png" + }, + RANGER:{ + name:"Ranger", + icon:"icons/UINGSClassRa.png" + }, + GUNNER:{ + name:"Gunner", + icon:"icons/UINGSClassGu.png" + }, + FORCE:{ + name:"Force", + icon:"icons/UINGSClassFo.png" + }, + TECHTER:{ + name:"Techter", + icon:"icons/UINGSClassTe.png" + } +} + +function Class(p) { + const class_obj = CLASSES[p.name] + return <>{class_obj.name} +} + +function ClassSelector(p){ + return
+ Class Selector
+ {Object.keys(CLASSES).map((cl)=>{ + return + })} +
+} + +function EditableClass(p){ + const [edit,setEdit] = useState(false) + return <>{setEdit(true)}}> + + {edit&&} + +} + function MainBox() { + const [className,setClassName] = useState("RANGER") + const [secondaryClassName,setSecondaryClassName] = useState("FORCE") return - Ranger}>Lv.20 - Force}>Lv.15 + }>Lv.20 + }>Lv.15
}