//import './App.css'; Old CSS
import './reset.css' ; // Generic reset
import './style.css' ; // The new new
import React , { useState , useEffect , useRef , useReducer } from 'react' ;
import Modal from 'react-modal'
import { XSquare , XSquareFill } from 'react-bootstrap-icons'
import {
HashRouter ,
Switch ,
Route
} from "react-router-dom" ;
import { HashLink as Link } from 'react-router-hash-link' ;
import TestHeader from './TestHeader' ; // Test Header!
import TestPanel from './TestPanel' ; // Dudley's Test Panel
const axios = require ( 'axios' ) ;
const BACKEND _URL = process . env . REACT _APP _BACKEND _URL || 'https://projectdivar.com:4504' ; //You can specify a .env file locally with REACT_APP_BACKEND_URL defining a URL to retrieve data from.
function Col ( p ) {
return < div className = "con" >
{ p . children }
< / d i v >
}
function Box ( p ) {
return < >
< div className = "box" >
< h1 > & # 9830 ; & ensp ; { p . title } < / h 1 >
{ p . children }
< / d i v >
< / >
}
function EditBox ( p ) {
useEffect ( ( ) => {
var timer1 = setTimeout ( ( ) => { document . getElementById ( "editBox" ) . focus ( ) } , 100 )
return ( ) => {
clearTimeout ( timer1 ) ;
} ;
} )
return < input id = "editBox" onKeyDown = { ( e ) => {
if ( e . key === "Enter" ) { p . setEdit ( false ) }
else if ( e . key === "Escape" ) { p . setEdit ( false ) }
} } 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 ) } } >
< / i n p u t >
}
function EditableBox ( p ) {
const [ edit , setEdit ] = useState ( false )
useEffect ( ( ) => {
if ( p . callback ) {
p . callback ( )
}
} , [ edit , p ] )
return < >
< div className = "hover" onClick = { ( f ) => { setEdit ( true ) } } >
{ edit ?
< EditBox maxlength = { p . maxlength } setEdit = { setEdit } originalName = { p . data } setName = { p . setData } value = { p . data } / >
: < > { p . data } < / > }
< / d i v >
< / >
}
const CLASSES = {
HUNTER : {
name : "Hunter" ,
icon : process . env . PUBLIC _URL + "/icons/UINGSClassHu.png"
} ,
FIGHTER : {
name : "Fighter" ,
icon : process . env . PUBLIC _URL + "/icons/UINGSClassFi.png"
} ,
RANGER : {
name : "Ranger" ,
icon : process . env . PUBLIC _URL + "/icons/UINGSClassRa.png"
} ,
GUNNER : {
name : "Gunner" ,
icon : process . env . PUBLIC _URL + "/icons/UINGSClassGu.png"
} ,
FORCE : {
name : "Force" ,
icon : process . env . PUBLIC _URL + "/icons/UINGSClassFo.png"
} ,
TECHTER : {
name : "Techter" ,
icon : process . env . PUBLIC _URL + "/icons/UINGSClassTe.png"
}
}
const EFFECTS = {
"Food Boost Effect" : {
perks : [
"[Meat] Potency +10.0%" ,
"[Crisp] Potency to Weak Point +5.0%"
] ,
icon : process . env . PUBLIC _URL + "/icons/TQ8EBW2.png"
} ,
"Shifta / Deband" : {
perks : [
"Potency +5.0%" ,
"Damage Resistance +10.0%"
] ,
icon : process . env . PUBLIC _URL + "/icons/VIYYNIm.png"
} ,
"Region Mag Boost" : {
perks : [
"Potency +5.0%" ,
] ,
icon : process . env . PUBLIC _URL + "/icons/N6M74Qr.png"
} ,
}
const EQUIPMENT = {
"Ophistia Shooter" : {
icon : process . env . PUBLIC _URL + "/icons/uc1iBck.png"
} ,
"Klauzdyne" : {
icon : process . env . PUBLIC _URL + "/icons/uldt9lR.png"
} ,
"Klauznum" : {
icon : process . env . PUBLIC _URL + "/icons/F0t58xP.png"
} ,
"Klauzment" : {
icon : process . env . PUBLIC _URL + "/icons/20M6Z7t.png"
}
}
const ABILITIES = {
"Wellspring Unit Lv.3" : {
icon : process . env . PUBLIC _URL + "/icons/NGSUIItemPotentialAbility.png"
} ,
"Fixa Fatale Lv.5" : {
icon : process . env . PUBLIC _URL + "/icons/UINGSItemPresetAbility.png"
}
}
const ABILITY _DEFAULT _ICON = process . env . PUBLIC _URL + "/icons/UINGSItemSpecialAbility.png"
/ * *
* 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 Class ( p ) {
const class _obj = CLASSES [ p . name ]
return < > < img alt = "" src = { class _obj . icon } / > { class _obj . name } < / >
}
function ClassSelector ( p ) {
const wrapperRef = useRef ( null ) ;
useOutsideAlerter ( wrapperRef , p . setEdit ) ;
return < div className = "popup" ref = { wrapperRef } >
Class Selector < br / >
{ Object . keys ( CLASSES ) . map ( ( cl , i ) => {
return < button id = { i } className = "rounded" onClick = { ( ) => { p . setClassName ( cl ) ; p . setEdit ( false ) } } > < img alt = "" src = { CLASSES [ cl ] . icon } / > < br / > { CLASSES [ cl ] . name } < / b u t t o n >
} ) }
< / d i v >
}
function EditableClass ( p ) {
const [ edit , setEdit ] = useState ( false )
return < > < span className = "hover" onClick = { ( ) => { setEdit ( ! edit ) } } > < Class name = { p . class } / >
< / s p a n >
{ edit && < ClassSelector setClassName = { p . setClassName } setEdit = { setEdit } / > }
< / >
}
function Table ( p ) {
return < table className = { p . classes } >
< tbody >
{ p . children }
< / t b o d y >
< / t a b l e >
}
function MainBox ( p ) {
return < Box title = "NGS Planner" >
< Table classes = "ba" >
< ListRow title = "Author" > < EditableBox setData = { p . setAuthor } data = { p . author } / > < / L i s t R o w >
< ListRow title = "Build Name" > < EditableBox setData = { p . setBuildName } data = { p . buildName } / > < / L i s t R o w >
< ListRow title = "Class" content = { < EditableClass setClassName = { p . setClassName } class = { p . className } > < / E d i t a b l e C l a s s > } > < s p a n c l a s s N a m e = " y e " > L v . 2 0 < / s p a n > < / L i s t R o w >
< ListRow content = { < > < EditableClass setClassName = { p . setSecondaryClassName } class = { p . secondaryClassName } > < /EditableClass></ > } > Lv . 15 < / L i s t R o w >
< ListRow > < button > Share < / b u t t o n > < b u t t o n > S a v e < / b u t t o n > < / L i s t R o w >
< / T a b l e >
< / B o x >
}
function StatsBox ( p ) {
return < Box title = "Stats" >
< Table classes = "st" >
< ListRow title = "Battle Power" content = { p . bp } > < / L i s t R o w >
< ListRow title = "HP" content = { p . hp } > < / L i s t R o w >
< ListRow title = "PP" content = { p . pp } > < / L i s t R o w >
< ListRow title = "Defense" content = { p . def } > < / L i s t R o w >
< ListRow title = "Weapon Up" content = { < > < img alt = "" src = "/icons/MEL.png" / > < span className = "ye" > + { p . weaponUp1 * 100 } % < /span></ > } > < img alt = "" src = "/icons/RNG.png" / > < span className = "ye" > + { p . weaponUp2 * 100 } % < / s p a n > < / L i s t R o w >
< ListRow content = { < > < img alt = "" src = "/icons/TEC.png" / > < span className = "ye" > + { p . weaponUp3 * 100 } % < /span></ > } > < / L i s t R o w >
< ListRow title = "Damage Resist." content = { p . damageResist * 100 + "%" } > < / L i s t R o w >
< / T a b l e >
< / B o x >
}
function EffectListing ( p ) {
return < li > { p . name }
< ul >
{ EFFECTS [ p . name ] . perks . map ( ( perk , i ) => {
return < li key = { i } > < img alt = "" src = { EFFECTS [ p . name ] . icon } / > & ensp ; { perk } < / l i >
} ) }
< / u l >
< / l i >
}
function PageControlButton ( p ) {
return < li onClick = { ( ) => { p . setCurrentPage ( p . page ) } } className = { ( p . currentPage === p . page ) ? "selected" : "" } > { p . pageName ? p . pageName : p . page } < / l i >
}
function PageControl ( p ) {
var pages = [ ]
for ( var i = 0 ; i < p . pages ; i ++ ) {
pages . push ( < PageControlButton pageName = { p . pageNames ? p . pageNames [ i ] : undefined } currentPage = { p . currentPage } setCurrentPage = { p . setCurrentPage } page = { i + 1 } / > )
}
return < ul className = "boxmenu" >
{ pages . map ( ( page , i ) => { return < React . Fragment key = { i } > { page } < / R e a c t . F r a g m e n t > } ) }
< / u l >
}
function EffectsBox ( p ) {
const [ currentPage , setCurrentPage ] = useState ( 1 )
return < Box title = "Current Effects" >
< PageControl pages = { 2 } currentPage = { currentPage } setCurrentPage = { setCurrentPage } / >
< h3 > Effect Name < / h 3 >
{
currentPage === 1 ?
< ul className = "bu" >
{ p . effectList . map ( ( ef , i ) => {
return < EffectListing key = { i } name = { ef } / >
} ) }
< / u l > :
< > < / >
}
< / B o x >
}
function EquipBox ( p ) {
return < Box title = "Equip" >
< div className = "we" >
< div > < h3 > Weapon < /h3><br / > < img alt = "" src = { EQUIPMENT [ p . weapon ] . icon } / > < br / > { p . weapon } + { p . weaponEnhancementLv } < / d i v >
< div > < h3 > Slot 1 < /h3><br / > < img alt = "" src = { EQUIPMENT [ p . armorSlot1 ] . icon } / > < br / > { p . armorSlot1 } + { p . armorSlot1EnhancementLv } < / d i v >
< div > < h3 > Slot 2 < /h3><br / > < img alt = "" src = { EQUIPMENT [ p . armorSlot2 ] . icon } / > < br / > { p . armorSlot2 } + { p . armorSlot2EnhancementLv } < / d i v >
< div > < h3 > Slot 3 < /h3><br / > < img alt = "" src = { EQUIPMENT [ p . armorSlot3 ] . icon } / > < br / > { p . armorSlot3 } + { p . armorSlot3EnhancementLv } < / d i v >
< / d i v >
< / B o x >
}
function EquippedWeaponBox ( p ) {
const [ currentPage , setCurrentPage ] = useState ( 1 )
const [ selectedEquip , setSelectedEquip ] = useState ( p . weapon )
const [ selectedEquipEnhancementLv , setSelectedEquipEnhancementLv ] = useState ( p . weaponEnhancementLv )
const [ selectedEquipAbilities , setSelectedEquipAbilities ] = useState ( p . weaponAbilityList )
useEffect ( ( ) => {
switch ( currentPage ) {
case 2 :
setSelectedEquip ( p . armorSlot1 )
setSelectedEquipEnhancementLv ( p . armorSlot1EnhancementLv )
setSelectedEquipAbilities ( p . armorSlot1AbilityList )
break ;
case 3 :
setSelectedEquip ( p . armorSlot2 )
setSelectedEquipEnhancementLv ( p . armorSlot2EnhancementLv )
setSelectedEquipAbilities ( p . armorSlot2AbilityList )
break ;
case 4 :
setSelectedEquip ( p . armorSlot3 )
setSelectedEquipEnhancementLv ( p . armorSlot3EnhancementLv )
setSelectedEquipAbilities ( p . armorSlot3AbilityList )
break ;
default : {
setSelectedEquip ( p . weapon )
setSelectedEquipEnhancementLv ( p . weaponEnhancementLv )
setSelectedEquipAbilities ( p . weaponAbilityList )
}
}
} , [ currentPage , p . armorSlot1 , p . armorSlot1EnhancementLv , p . armorSlot1AbilityList , p . armorSlot2 , p . armorSlot2EnhancementLv , p . armorSlot2AbilityList , p . armorSlot3 , p . armorSlot3EnhancementLv , p . armorSlot3AbilityList , p . weapon , p . weaponEnhancementLv , p . weaponAbilityList ] )
return < Box title = "Equipped Weapon" >
< h2 > < img alt = "" src = "/icons/NGSUIItemAssaultRifleMini.png" / > { selectedEquip } + { selectedEquipEnhancementLv } < / h 2 >
< PageControl pages = { 4 } currentPage = { currentPage } setCurrentPage = { setCurrentPage } pageNames = { [ "W" , 1 , 2 , 3 ] } / >
< div className = "de" >
< div >
< h3 > Ability Details < / h 3 >
< ul className = "aug" >
{
selectedEquipAbilities ? selectedEquipAbilities . map ( ( ability , i ) => {
return < li key = { i } > < img alt = "" src = { ABILITIES [ ability ] ? ABILITIES [ ability ] . icon : ABILITY _DEFAULT _ICON } / > { ability } < / l i >
} ) : < > < / >
}
< / u l >
< / d i v >
< div >
< h3 > Properties < / h 3 >
< ul className = "pr" >
< li > Enhancement Lv . & emsp ; < span > + { selectedEquipEnhancementLv } < / s p a n > < / l i >
< li > Multi - Weapon & emsp ; < span > - < / s p a n > < / l i >
< li > Element & emsp ; < span > - < / s p a n > < / l i >
< / u l >
< / d i v >
< / d i v >
< / B o x >
}
function DamageBox ( p ) {
const [ currentPage , setCurrentPage ] = useState ( 1 )
return < Box title = "Damage" >
< PageControl pages = { 3 } currentPage = { currentPage } setCurrentPage = { setCurrentPage } / >
< br / > < br / >
{
currentPage === 1 &&
< Table classes = "ba" >
< ListRow title = "Critical Hit Rate" > { p . criticalHitRate * 100 } % < / L i s t R o w >
< ListRow title = "Critical Multiplier" > { p . criticalMultiplier * 100 } % < / L i s t R o w >
< ListRow title = "Midrange" > { p . midRange } < / L i s t R o w >
< ListRow title = "Critical" > { p . critical } < / L i s t R o w >
< ListRow title = "Effective" > < span className = "ye" > { p . effective } < / s p a n > < / L i s t R o w >
< / T a b l e >
}
< / B o x >
}
function ListRow ( p ) {
return < tr >
< td > { p . title } < / t d >
< td > { p . content } < / t d >
< td > { p . children } < / t d >
< / t r >
}
function PopupWindow ( p ) {
return < Modal isOpen = { p . modalOpen } onRequestClose = { ( ) => { p . setModalOpen ( false ) } } shouldFocusAfterRender = { true } shouldCloseOnOverlayClick = { true } shouldCloseOnEsc = { true } >
< h1 > { p . title } < XSquare onClick = { ( ) => { p . setModalOpen ( false ) } } className = "modalCloseButton" / > < / h 1 >
{ p . children }
< / M o d a l >
}
function EditBackendBox ( p ) {
useEffect ( ( ) => {
var timer1 = setTimeout ( ( ) => { document . getElementById ( "editBox" ) . focus ( ) } , 100 )
return ( ) => {
clearTimeout ( timer1 ) ;
} ;
} )
return < input id = "editBox" onKeyDown = { ( e ) => {
if ( e . key === "Enter" ) { p . setEdit ( false ) ; p . setUpdate ( true ) }
else if ( e . key === "Escape" ) { p . setEdit ( false ) }
} } maxLength = { p . maxlength ? p . maxlength : 20 } onBlur = { ( ) => { p . setEdit ( false ) ; p . setUpdate ( true ) } } value = { p . value } onChange = { ( f ) => { f . currentTarget . value . length > 0 ? p . setName ( f . currentTarget . value ) : p . setName ( p . originalName ) } } >
< / i n p u t >
}
function EditableBackendBox ( p ) {
const [ update , setUpdate ] = useState ( false )
const [ edit , setEdit ] = useState ( false )
const [ value , setValue ] = useState ( p . children )
const [ originalValue , setOriginalValue ] = useState ( p . children )
useEffect ( ( ) => {
if ( p . callback && update ) {
p . callback ( value )
. then ( ( ) => {
setUpdate ( false )
setOriginalValue ( value )
} )
. catch ( ( ) => {
setUpdate ( false )
setValue ( originalValue )
} )
}
} , [ update , originalValue , p , value ] )
return < >
< div className = "hover table-padding" onClick = { ( f ) => { setEdit ( true ) } } >
{ edit ?
< EditBackendBox maxlength = { p . maxlength } setUpdate = { setUpdate } setEdit = { setEdit } originalName = { originalValue } setName = { setValue } value = { value } / >
: < > { value } < / > }
< / d i v >
< / >
}
function TableEditor ( p ) {
const initialVals = { }
function updateVals ( state , update ) {
if ( update === 'Clear' ) {
return initialVals
}
state [ update . field ] = update . value
return state
}
const [ fields , setFields ] = useState ( [ ] )
const [ data , setData ] = useState ( [ ] )
const [ update , setUpdate ] = useState ( false )
const [ submitVals , setSubmitVal ] = useReducer ( updateVals , initialVals )
const [ report , setReport ] = useState ( "" )
function SubmitBoxes ( ) {
axios . post ( BACKEND _URL + p . path , submitVals )
. then ( ( ) => {
setUpdate ( true )
} )
. catch ( ( err ) => {
alert ( JSON . stringify ( err . response . data ) )
} )
}
useEffect ( ( ) => {
setUpdate ( true )
} , [ p . path ] )
useEffect ( ( ) => {
if ( update ) {
axios . get ( BACKEND _URL + p . path )
. then ( ( data ) => {
var cols = data . data . fields
var rows = data . data . rows
setFields ( cols . filter ( ( col ) => col . name !== "id" ) . map ( ( col ) => col . name ) )
setData ( rows )
} )
. catch ( ( err ) => {
setReport ( JSON . stringify ( err ) )
} )
setUpdate ( false )
}
} , [ update , p . path ] )
return < >
< div className = "table-responsive" >
< table cellPadding = "10" className = "table text-light table-padding" >
< caption > { JSON . stringify ( report ) } < / c a p t i o n >
< thead >
< tr >
< th className = "table-padding" > < / t h >
{ fields . map ( ( field , i ) => < React . Fragment key = { i } > < th scope = "col" className = "table-padding" > { field } < / t h > < / R e a c t . F r a g m e n t > ) }
< / t r >
< / t h e a d >
< tbody >
{ data . map ( ( dat ) => < tr key = { dat . id } >
< td > < XSquareFill className = "webicon" onClick = { ( ) => { axios . delete ( BACKEND _URL + p . path , { data : { id : dat . id } } ) . then ( ( ) => { setUpdate ( true ) } ) . catch ( ( err ) => { alert ( err . response . data ) } ) } } / > < / t d > { f i e l d s . m a p ( ( c o l , i ) = > < t d k e y = { d a t . i d + " _ " + i } c l a s s N a m e = " t a b l e - p a d d i n g t a b l e " > < E d i t a b l e B a c k e n d B o x c a l l b a c k = { ( v a l u e ) = > {
return axios . patch ( BACKEND _URL + p . path , {
[ col ] : value ,
id : dat . id
} )
} } > { String ( dat [ col ] ) } < / E d i t a b l e B a c k e n d B o x > < / t d > ) } < / t r > ) }
{ < tr > < td > < /td>{fields.map((col,i)=><td key={i}>{<input id={"submitField"+i} onBlur={(i===fields.length-1)?(f)=>{setSubmitVal({field:col,value:f.currentTarget.value});SubmitBoxes();document.getElementById("submitField0").focus()}:(f)=>{setSubmitVal({field:col,value:f.currentTarget.value})}}/ > } < / t d > ) } < / t r > }
< / t b o d y >
< / t a b l e >
< / d i v >
< / >
}
function AdminPanel ( p ) {
return < div id = "main" style = { { background : "white" } } >
< div className = "w-25" > < Box title = "Navigation" >
< Table classes = "st" >
< Link to = { process . env . PUBLIC _URL + "/admin/class" } > Class < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/classdata" } > Class Data < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/classweaponcompatibility" } > Class - Weapon Compatibility < /Link><br/ >
< hr / >
< Link to = { process . env . PUBLIC _URL + "/admin/weapons" } > Weapons < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/weaponexistencedata" } > Weapon Existence Data < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/weapontypes" } > Weapon Types < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/classweaponcompatibility" } > Class - Weapon Compatibility < /Link><br/ >
< hr / >
< Link to = { process . env . PUBLIC _URL + "/admin/armor" } > Armor < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/potentials" } > Potentials < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/potentialdata" } > Potential Data < /Link><br/ >
< hr / >
< Link to = { process . env . PUBLIC _URL + "/admin/builds" } > Builds < /Link><br/ >
< hr / >
< Link to = { process . env . PUBLIC _URL + "/admin/skills" } > Skills < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/skilltypes" } > Skill Types < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/skilldata" } > Skill Data < /Link><br/ >
< hr / >
< Link to = { process . env . PUBLIC _URL + "/admin/augments" } > Augments < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/augmenttypes" } > Augment Types < /Link><br/ >
< hr / >
< Link to = { process . env . PUBLIC _URL + "/admin/food" } > Food < /Link><br/ >
< Link to = { process . env . PUBLIC _URL + "/admin/foodmultipliers" } > Food Multipliers < /Link><br/ >
< hr / >
< Link to = { process . env . PUBLIC _URL + "/admin/roles" } > Roles < /Link><br/ >
< hr / >
< Link to = { process . env . PUBLIC _URL + "/admin/users" } > Users < /Link><br/ > < / T a b l e > < / B o x > < / d i v >
< div className = "w-75" style = { { background : "rgba(20,29,40,0.66)" } } >
< Route path = { process . env . PUBLIC _URL + "/admin/class" } >
< TableEditor path = "/class" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/classdata" } >
< TableEditor path = "/class_level_data" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/classweaponcompatibility" } >
< TableEditor path = "/class_weapon_type_data" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/weapons" } >
< TableEditor path = "/weapon" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/weaponexistencedata" } >
< TableEditor path = "/weapon_existence_data" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/weapontypes" } >
< TableEditor path = "/weapon_type" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/armor" } >
< TableEditor path = "/armor" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/potentials" } >
< TableEditor path = "/potential" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/potentialdata" } >
< TableEditor path = "/potential_data" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/builds" } >
< TableEditor path = "/builds" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/skills" } >
< TableEditor path = "/skill" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/skilltypes" } >
< TableEditor path = "/skill_type" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/skilldata" } >
< TableEditor path = "/skill_data" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/augments" } >
< TableEditor path = "/augment" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/augmenttypes" } >
< TableEditor path = "/augment_type" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/food" } >
< TableEditor path = "/food" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/foodmultipliers" } >
< TableEditor path = "/food_mult" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/roles" } >
< TableEditor path = "/roles" / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin/users" } >
< TableEditor path = "/users" / >
< / R o u t e >
< / d i v >
< / d i v >
}
function App ( ) {
const [ author , setAuthor ] = useState ( "Dudley" )
const [ buildName , setBuildName ] = useState ( "Fatimah" )
const [ className , setClassName ] = useState ( "RANGER" )
const [ secondaryClassName , setSecondaryClassName ] = useState ( "FORCE" )
const [ bp , setBP ] = useState ( 1344 )
const [ hp , setHP ] = useState ( 289 )
const [ pp , setPP ] = useState ( 100 )
const [ def , setDef ] = useState ( 402 )
const [ weaponUp1 , setWeaponUp1 ] = useState ( 0.34 )
const [ weaponUp2 , setWeaponUp2 ] = useState ( 0.34 )
const [ weaponUp3 , setWeaponUp3 ] = useState ( 0.34 )
const [ damageResist , setDamageResist ] = useState ( 0.18 )
const [ effectList , setEffectList ] = useState ( [
"Food Boost Effect" ,
"Shifta / Deband" ,
"Region Mag Boost"
] )
const [ weapon , setWeapon ] = useState ( "Ophistia Shooter" )
const [ armorSlot1 , setArmorSlot1 ] = useState ( "Klauzdyne" )
const [ armorSlot2 , setArmorSlot2 ] = useState ( "Klauznum" )
const [ armorSlot3 , setArmorSlot3 ] = useState ( "Klauzment" )
const [ weaponEnhancementLv , setWeaponEnhancementLv ] = useState ( 35 )
const [ armorSlot1EnhancementLv , setArmorSlot1EnhancementLv ] = useState ( 10 )
const [ armorSlot2EnhancementLv , setArmorSlot2EnhancementLv ] = useState ( 10 )
const [ armorSlot3EnhancementLv , setArmorSlot3EnhancementLv ] = useState ( 10 )
const [ weaponAbilityList , setWeaponAbilityList ] = useState ( [
"Wellspring Unit Lv.3" ,
"Fixa Fatale Lv.5" ,
"Legaro S Attack II" ,
"Legaro S Efficiet" ,
"Legaro S Efficiet" ,
"Legaro Souls 2" ,
"Legaro Reverij" ,
"Legaro Factalz" ,
"Legaro Crakus" ,
"Legaro Attack Vaz III" ,
] )
const [ armor1AbilityList , setArmor1AbilityList ] = useState ( [ ] )
const [ armor2AbilityList , setArmor2AbilityList ] = useState ( [ ] )
const [ armor3AbilityList , setArmor3AbilityList ] = useState ( [ ] )
const [ criticalHitRate , setCriticalHitRate ] = useState ( 0.05 )
const [ criticalMultiplier , setCriticalMultiplier ] = useState ( 1.2 )
const [ midRange , setMidRange ] = useState ( 126 )
const [ critical , setCritical ] = useState ( 152 )
const [ effective , setEffective ] = useState ( 127 )
const [ modalOpen , setModalOpen ] = useState ( true )
return (
< >
< HashRouter >
< Switch >
< Route path = { process . env . PUBLIC _URL + "/test" } >
< AdminPanel / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/admin" } >
< AdminPanel / >
< / R o u t e >
< Route path = { process . env . PUBLIC _URL + "/test" } >
< TestHeader / >
< div id = "main" > < TestPanel / > < / d i v >
< / R o u t e >
< Route path = "/" >
< div id = "main" >
< Col >
< MainBox author = { author } setAuthor = { setAuthor } buildName = { buildName } setBuildName = { setBuildName } className = { className } setClassName = { setClassName } secondaryClassName = { secondaryClassName } setSecondaryClassName = { setSecondaryClassName } / >
< EffectsBox effectList = { effectList } setEffectList = { setEffectList } / >
< / C o l >
< Col >
< EquipBox weapon = { weapon } setWeapon = { setWeapon } armorSlot1 = { armorSlot1 } setArmorSlot1 = { setArmorSlot1 } armorSlot2 = { armorSlot2 } setArmorSlot2 = { setArmorSlot2 } armorSlot3 = { armorSlot3 } setArmorSlot3 = { setArmorSlot3 } weaponEnhancementLv = { weaponEnhancementLv } setWeaponEnhancementLv = { setWeaponEnhancementLv } armorSlot1EnhancementLv = { armorSlot1EnhancementLv } setArmorSlot1EnhancementLv = { setArmorSlot1EnhancementLv } armorSlot2EnhancementLv = { armorSlot2EnhancementLv } setArmorSlot2EnhancementLv = { setArmorSlot2EnhancementLv } armorSlot3EnhancementLv = { armorSlot3EnhancementLv } setArmorSlot3EnhancementLv = { setArmorSlot3EnhancementLv } / >
< EquippedWeaponBox weapon = { weapon } armorSlot1 = { armorSlot1 } armorSlot2 = { armorSlot2 } armorSlot3 = { armorSlot3 } weaponAbilityList = { weaponAbilityList } setWeaponAbilityList = { setWeaponAbilityList } armor1AbilityList = { armor1AbilityList } setArmor1AbilityList = { setArmor1AbilityList } armor2AbilityList = { armor2AbilityList } setArmor2AbilityList = { setArmor2AbilityList } armor3AbilityList = { armor3AbilityList } setArmor3AbilityList = { setArmor3AbilityList } weaponEnhancementLv = { weaponEnhancementLv } armorSlot1EnhancementLv = { armorSlot1EnhancementLv } armorSlot2EnhancementLv = { armorSlot2EnhancementLv } armorSlot3EnhancementLv = { armorSlot3EnhancementLv } / >
< / C o l >
< Col >
< StatsBox bp = { bp } setBP = { setBP } hp = { hp } setHP = { setHP } pp = { pp } setPP = { setPP } def = { def } setDef = { setDef } weaponUp1 = { weaponUp1 } setWeaponUp1 = { setWeaponUp1 } weaponUp2 = { weaponUp2 } setWeaponUp2 = { setWeaponUp2 } weaponUp3 = { weaponUp3 } setWeaponUp3 = { setWeaponUp3 } damageResist = { damageResist } setDamageResist = { setDamageResist } / >
< DamageBox criticalHitRate = { criticalHitRate } setCriticalHitRate = { setCriticalHitRate } criticalMultiplier = { criticalMultiplier } setCriticalMultiplier = { setCriticalMultiplier } midRange = { midRange } setMidRange = { setMidRange } critical = { critical } setCritical = { setCritical } effective = { effective } setEffective = { setEffective } / >
< / C o l >
< PopupWindow modalOpen = { modalOpen } setModalOpen = { setModalOpen } showCloseButton = { false } title = "Modal Title" > Modal content goes here . { BACKEND _URL } < / P o p u p W i n d o w >
< / d i v >
< / R o u t e >
< / S w i t c h >
< / H a s h R o u t e r >
< / >
) ;
}
export default App ;