@ -116,359 +116,93 @@ function DarkSelect(p){
return < select className = "bg-dark text-white" { ... p } > { p . children } < / s e l e c t >
}
function SorterApp ( p ) {
const { setTransferItems } = p
const { transferItems } = p
function submitForm ( ) {
if ( item1 . length > 0 && item2 . length > 0 && item3 . length > 0 && item4 . length > 0 && item5 . length > 0 &&
item1 _2 . length > 0 && item2 _2 . length > 0 && item3 _2 . length > 0 && item4 _2 . length > 0 && item5 _2 . length > 0 ) {
setResult1 ( NONE )
setResult2 ( NONE )
setResult3 ( NONE )
setResult4 ( NONE )
setResult5 ( NONE )
setChecking ( true ) ;
for ( let i of [
{ "endItem" : item1 , "beginItem" : item1 _2 , "resultFunc" : setResult1 } ,
{ "endItem" : item2 , "beginItem" : item2 _2 , "resultFunc" : setResult2 } ,
{ "endItem" : item3 , "beginItem" : item3 _2 , "resultFunc" : setResult3 } ,
{ "endItem" : item4 , "beginItem" : item4 _2 , "resultFunc" : setResult4 } ,
{ "endItem" : item5 , "beginItem" : item5 _2 , "resultFunc" : setResult5 } ,
] ) {
let itemData1 = { }
let itemData2 = { }
axios . get ( encodeURI ( "https://xivapi.com/search?string=" + i . endItem ) )
. then ( ( data ) => {
var results = data . data . Results
for ( var r of results ) {
if ( r . Name === i . endItem && r . UrlType === "Item" ) {
return axios . get ( encodeURI ( "https://xivapi.com" + r . Url ) )
}
}
i . resultFunc ( NOTFOUND )
throw new Error ( "Item 1 Not Found!" ) ;
}
)
. then ( ( data ) => {
var results = data . data
itemData1 = { ... results }
return axios . get ( encodeURI ( "https://xivapi.com/search?string=" + i . beginItem ) )
} )
. then ( ( data ) => {
var results = data . data . Results
for ( var r of results ) {
if ( r . Name === i . beginItem && r . UrlType === "Item" ) {
return axios . get ( encodeURI ( "https://xivapi.com" + r . Url ) )
}
}
i . resultFunc ( NOTFOUND )
throw new Error ( "Item 2 Not Found!" ) ;
}
)
. then ( ( data ) => {
var results = data . data
itemData2 = { ... results }
if ( itemData1 . ItemSortCategory . ID < itemData2 . ItemSortCategory . ID ) {
i . resultFunc ( SUCCESS )
setChecking ( false )
return
} else
if ( itemData1 . ItemSortCategory . ID === itemData2 . ItemSortCategory . ID &&
itemData1 . ItemUICategory . ID < itemData2 . ItemUICategory . ID ) {
i . resultFunc ( SUCCESS )
setChecking ( false )
return
} else
if ( itemData1 . ItemSortCategory . ID === itemData2 . ItemSortCategory . ID &&
itemData1 . ItemUICategory . ID === itemData2 . ItemUICategory . ID &&
itemData1 . ID < itemData2 . ID ) {
i . resultFunc ( SUCCESS )
setChecking ( false )
return
} else {
i . resultFunc ( REJECTED )
setChecking ( false )
}
} )
. catch ( ( err ) => { console . log ( err ) ; setChecking ( false ) } )
}
//axios.get(encodeURI("https://xivapi.com/search?string="+i))
}
}
const retainerNames = [ "Ayayayayay" , "Howdoesanyonenameall" , "Kkittyy" , "Butwhy" , "Nowitsabun" , "Finalretainer" ] ;
const NONE = 0 ;
const REJECTED = 1 ;
const SUCCESS = 2 ;
const NOTFOUND = 3 ;
const [ item1 , setItem1 ] = useState ( "" )
const [ item2 , setItem2 ] = useState ( "" )
const [ item3 , setItem3 ] = useState ( "" )
const [ item4 , setItem4 ] = useState ( "" )
const [ item5 , setItem5 ] = useState ( "" )
const [ item1 _2 , setItem1 _2 ] = useState ( "" )
const [ item2 _2 , setItem2 _2 ] = useState ( "" )
const [ item3 _2 , setItem3 _2 ] = useState ( "" )
const [ item4 _2 , setItem4 _2 ] = useState ( "" )
const [ item5 _2 , setItem5 _2 ] = useState ( "" )
const [ result1 , setResult1 ] = useState ( NONE )
const [ result2 , setResult2 ] = useState ( NONE )
const [ result3 , setResult3 ] = useState ( NONE )
const [ result4 , setResult4 ] = useState ( NONE )
const [ result5 , setResult5 ] = useState ( NONE )
const [ checking , setChecking ] = useState ( false )
useEffect ( ( ) => {
if ( result1 === SUCCESS && result2 === SUCCESS && result3 === SUCCESS && result4 === SUCCESS && result5 === SUCCESS ) {
setTransferItems ( [ item1 , item1 _2 , item2 , item2 _2 , item3 , item3 _2 , item4 , item4 _2 , item5 , item5 _2 ] )
}
} , [ result1 , result2 , result3 , result4 , result5 ] )
useEffect ( ( ) => {
if ( transferItems . length === 10 ) {
setItem1 ( transferItems [ 0 ] )
setItem1 _2 ( transferItems [ 1 ] )
setItem2 ( transferItems [ 2 ] )
setItem2 _2 ( transferItems [ 3 ] )
setItem3 ( transferItems [ 4 ] )
setItem3 _2 ( transferItems [ 5 ] )
setItem4 ( transferItems [ 6 ] )
setItem4 _2 ( transferItems [ 7 ] )
setItem5 ( transferItems [ 8 ] )
setItem5 _2 ( transferItems [ 9 ] )
}
} , [ JSON . stringify ( transferItems ) ] )
return < >
< Row className = "text-white" style = { { background : result1 === NONE ? "" : result1 === SUCCESS ? "#003300" : result1 === NOTFOUND ? "#333300" : "#330000" } } >
< Col >
Ending { retainerNames [ 0 ] } Item 1 :
< / C o l >
< Col >
< DarkInput name = "item1" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item1 } onChange = { ( f ) => { setItem1 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 1 ] } Item 1 :
< / C o l >
< Col >
< DarkInput name = "item1_2" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item1 _2 } onChange = { ( f ) => { setItem1 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
{ result1 === NONE ? < > < / >
: result1 === SUCCESS ? < IoCheckmarkCircleOutline style = { { color : "lime" } } > < / I o C h e c k m a r k C i r c l e O u t l i n e >
: result1 === NOTFOUND ? < IoAlertCircleOutline style = { { color : "yellow" } } > < / I o A l e r t C i r c l e O u t l i n e >
: < IoCloseCircleSharp style = { { color : "red" } } > < / I o C l o s e C i r c l e S h a r p > }
< / C o l >
< / R o w >
< Row className = "text-white" style = { { background : result2 === NONE ? "" : result2 === SUCCESS ? "#003300" : result2 === NOTFOUND ? "#333300" : "#330000" } } >
< Col >
Ending { retainerNames [ 1 ] } Item 2 :
< / C o l >
< Col >
< DarkInput name = "item2" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item2 } onChange = { ( f ) => { setItem2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 2 ] } Item 2 :
< / C o l >
< Col >
< DarkInput name = "item2_2" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item2 _2 } onChange = { ( f ) => { setItem2 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
{ result2 === NONE ? < > < / >
: result2 === SUCCESS ? < IoCheckmarkCircleOutline style = { { color : "lime" } } > < / I o C h e c k m a r k C i r c l e O u t l i n e >
: result2 === NOTFOUND ? < IoAlertCircleOutline style = { { color : "yellow" } } > < / I o A l e r t C i r c l e O u t l i n e >
: < IoCloseCircleSharp style = { { color : "red" } } > < / I o C l o s e C i r c l e S h a r p > }
< / C o l >
< / R o w >
< Row className = "text-white" style = { { background : result3 === NONE ? "" : result3 === SUCCESS ? "#003300" : result3 === NOTFOUND ? "#333300" : "#330000" } } >
< Col >
Ending { retainerNames [ 2 ] } Item 3 :
< / C o l >
< Col >
< DarkInput name = "item3" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item3 } onChange = { ( f ) => { setItem3 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 3 ] } Item 3 :
< / C o l >
< Col >
< DarkInput name = "item3_2" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item3 _2 } onChange = { ( f ) => { setItem3 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
{ result3 === NONE ? < > < / >
: result3 === SUCCESS ? < IoCheckmarkCircleOutline style = { { color : "lime" } } > < / I o C h e c k m a r k C i r c l e O u t l i n e >
: result3 === NOTFOUND ? < IoAlertCircleOutline style = { { color : "yellow" } } > < / I o A l e r t C i r c l e O u t l i n e >
: < IoCloseCircleSharp style = { { color : "red" } } > < / I o C l o s e C i r c l e S h a r p > }
< / C o l >
< / R o w >
< Row className = "text-white" style = { { background : result4 === NONE ? "" : result4 === SUCCESS ? "#003300" : result4 === NOTFOUND ? "#333300" : "#330000" } } >
< Col >
Ending { retainerNames [ 3 ] } Item 4 :
< / C o l >
< Col >
< DarkInput name = "item4" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item4 } onChange = { ( f ) => { setItem4 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 4 ] } Item 4 :
< / C o l >
< Col >
< DarkInput name = "item4_2" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item4 _2 } onChange = { ( f ) => { setItem4 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
{ result4 === NONE ? < > < / >
: result4 === SUCCESS ? < IoCheckmarkCircleOutline style = { { color : "lime" } } > < / I o C h e c k m a r k C i r c l e O u t l i n e >
: result4 === NOTFOUND ? < IoAlertCircleOutline style = { { color : "yellow" } } > < / I o A l e r t C i r c l e O u t l i n e >
: < IoCloseCircleSharp style = { { color : "red" } } > < / I o C l o s e C i r c l e S h a r p > }
< / C o l >
< / R o w >
< Row className = "text-white" style = { { background : result5 === NONE ? "" : result5 === SUCCESS ? "#003300" : result5 === NOTFOUND ? "#333300" : "#330000" } } >
< Col >
Ending { retainerNames [ 4 ] } Item 5 :
< / C o l >
< Col >
< DarkInput name = "item5" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item5 } onChange = { ( f ) => { setItem5 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 5 ] } Item 5 :
< / C o l >
< Col >
< DarkInput name = "item5_2" onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } value = { item5 _2 } onChange = { ( f ) => { setItem5 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
{ result5 === NONE ? < > < / >
: result5 === SUCCESS ? < IoCheckmarkCircleOutline style = { { color : "lime" } } > < / I o C h e c k m a r k C i r c l e O u t l i n e >
: result5 === NOTFOUND ? < IoAlertCircleOutline style = { { color : "yellow" } } > < / I o A l e r t C i r c l e O u t l i n e >
: < IoCloseCircleSharp style = { { color : "red" } } > < / I o C l o s e C i r c l e S h a r p > }
< / C o l >
< / R o w >
< Row >
< span > A < / s p a n >
< / R o w >
< Row >
< Button onKeyDown = { ( k ) => { if ( k . key === 'Enter' ) { submitForm ( ) } } } disabled = { checking } onClick = { ( ) => { submitForm ( ) } } > { checking ? < Spinner animation = "border" > < / S p i n n e r > : " C h e c k " } < / B u t t o n >
< / R o w >
< / >
}
function ListApp ( p ) {
//https://xivapi.com/search?filters=ClassJob.ID=11,RecipeLevelTable.ClassJobLevel%3E=36,RecipeLevelTable.ClassJobLevel%3C=45&page=1
const { transferItems } = p
const [ item1 , setItem1 ] = useState ( "" )
const [ item2 , setItem2 ] = useState ( "" )
const [ item3 , setItem3 ] = useState ( "" )
const [ item4 , setItem4 ] = useState ( "" )
const [ item5 , setItem5 ] = useState ( "" )
const [ item1 _2 , setItem1 _2 ] = useState ( "" )
const [ item2 _2 , setItem2 _2 ] = useState ( "" )
const [ item3 _2 , setItem3 _2 ] = useState ( "" )
const [ item4 _2 , setItem4 _2 ] = useState ( "" )
const [ item5 _2 , setItem5 _2 ] = useState ( "" )
const [ groceryList , setGroceryList ] = useState ( [ ] )
const crafters = [ "CRP Carpenter" , "BSM Blacksmith" , "ARM Armorer" , "GSM Goldsmith" , "LTW Leatherworker" , "WVR Weaver" , "ALC Alchemist" , "CUL Culinarian" ]
const [ selectedCrafter , setSelectedCrafter ] = useState ( 0 )
const [ minLevel , setMinLevel ] = useState ( 1 )
const [ maxLevel , setMaxLevel ] = useState ( 10 )
const [ playerInventory , setPlayerInventory ] = useState ( [ ] )
const [ saddlebagInventory , setSaddlebagInventory ] = useState ( [ ] )
const [ r1Inventory , setR1Inventory ] = useState ( [ ] )
const [ r2Inventory , setR2Inventory ] = useState ( [ ] )
const [ r3Inventory , setR3Inventory ] = useState ( [ ] )
const [ r4Inventory , setR4Inventory ] = useState ( [ ] )
const [ r5Inventory , setR5Inventory ] = useState ( [ ] )
const [ r6Inventory , setR6Inventory ] = useState ( [ ] )
const [ r7Inventory , setR7Inventory ] = useState ( [ ] )
const [ r8Inventory , setR8Inventory ] = useState ( [ ] )
const [ r9Inventory , setR9Inventory ] = useState ( [ ] )
const [ checking , setChecking ] = useState ( false )
const [ lastUpdate , setLastUpdate ] = useState ( 0 )
const retainerNames = [ "Ayayayayay" , "Howdoesanyonenameall" , "Kkittyy" , "Butwhy" , "Nowitsabun" , "Finalretainer" ] ;
useEffect ( ( ) => {
if ( transferItems . length === 10 ) {
setItem1 ( transferItems [ 0 ] )
setItem1 _2 ( transferItems [ 1 ] )
setItem2 ( transferItems [ 2 ] )
setItem2 _2 ( transferItems [ 3 ] )
setItem3 ( transferItems [ 4 ] )
setItem3 _2 ( transferItems [ 5 ] )
setItem4 ( transferItems [ 6 ] )
setItem4 _2 ( transferItems [ 7 ] )
setItem5 ( transferItems [ 8 ] )
setItem5 _2 ( transferItems [ 9 ] )
}
} , [ JSON . stringify ( transferItems ) ] )
const retainerNames = [ "Ayayayaya" , "Kittystorage" , "Morecatz" , "Finalretainer" , "Nowitsabun" , "Butwhy" , "Kkittyy" , "Howdoesanyonenameall" , "Ayayayayay" ] ;
function sleep ( ms ) {
return new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
}
async function itemComesBefore ( retainer , item ) {
let targetItem = ""
let result = false ;
switch ( retainer ) {
case 0 : {
targetItem = item1
} break ;
case 1 : {
targetItem = item2
} break ;
case 2 : {
targetItem = item3
} break ;
case 3 : {
targetItem = item4
} break ;
case 4 : {
targetItem = item5
} break ;
}
let itemData1 = { }
let itemData2 = { }
await axios . get ( encodeURI ( "https://xivapi.com/search?string=" + item ) )
. then ( async ( data ) => {
var results = data . data . Results
for ( var r of results ) {
if ( r . Name === item && r . UrlType === "Item" ) {
return await axios . get ( encodeURI ( "https://xivapi.com" + r . Url ) )
}
}
throw new Error ( "Item 1 Not Found!" ) ;
}
)
. then ( async ( data ) => {
var results = data . data
itemData1 = { ... results }
return await axios . get ( encodeURI ( "https://xivapi.com/search?string=" + targetItem ) )
} )
. then ( async ( data ) => {
var results = data . data . Results
for ( var r of results ) {
if ( r . Name === targetItem && r . UrlType === "Item" ) {
return await axios . get ( encodeURI ( "https://xivapi.com" + r . Url ) )
useEffect ( ( ) => {
const interval = setInterval ( ( ) => {
axios . get ( "http://projectdivar.com/inventoryData?lastUpdate=" + lastUpdate )
. then ( ( data ) => {
if ( data . data . length > 0 ) {
setLastUpdate ( new Date ( ) . getTime ( ) )
for ( var i = 0 ; i < data . data . length ; i ++ ) {
var inventory = data . data [ i ]
if ( i == 0 ) {
var plInven = [ ]
var sbInven = [ ]
for ( var j = 0 ; j < 140 ; j ++ ) {
plInven = [ ... plInven , inventory [ j ] ]
}
for ( var j = 140 ; j < inventory . length ; j ++ ) {
sbInven = [ ... sbInven , inventory [ j ] ]
}
setPlayerInventory ( plInven )
setSaddlebagInventory ( sbInven )
} else {
switch ( i ) {
case 1 : {
setR1Inventory ( inventory )
} break ;
case 2 : {
setR2Inventory ( inventory )
} break ;
case 3 : {
setR3Inventory ( inventory )
} break ;
case 4 : {
setR4Inventory ( inventory )
} break ;
case 5 : {
setR5Inventory ( inventory )
} break ;
case 6 : {
setR6Inventory ( inventory )
} break ;
case 7 : {
setR7Inventory ( inventory )
} break ;
case 8 : {
setR8Inventory ( inventory )
} break ;
case 9 : {
setR9Inventory ( inventory )
} break ;
}
}
}
}
throw new Error ( "Item 2 Not Found!" ) ;
}
)
. then ( async ( data ) => {
var results = data . data
itemData2 = { ... results }
console . log ( itemData1 . Name + " vs " + itemData2 . Name )
if ( itemData1 . ItemSortCategory . ID < itemData2 . ItemSortCategory . ID ) {
result = true
} else
if ( itemData1 . ItemSortCategory . ID === itemData2 . ItemSortCategory . ID &&
itemData1 . ItemUICategory . ID < itemData2 . ItemUICategory . ID ) {
result = true
} else
if ( itemData1 . ItemSortCategory . ID === itemData2 . ItemSortCategory . ID &&
itemData1 . ItemUICategory . ID === itemData2 . ItemUICategory . ID &&
itemData1 . ID < itemData2 . ID ) {
result = true
} else {
result = false
}
} )
. catch ( ( err ) => { console . log ( err ) ; setChecking ( false ) } )
return [ result , itemData1 ]
}
} )
. catch ( ( err ) => { } )
} , 1000 )
return ( ) => clearInterval ( interval )
} )
function submitForm ( ) {
let classID = Number ( selectedCrafter ) + 8
@ -507,112 +241,74 @@ function ListApp(p){
//setChecking(false)
let craftedItems = { }
for ( var recipe of recipeData ) {
for ( let i = 0 ; i < 5 ; i ++ ) {
for ( let i = 0 ; i <= 5 ; i ++ ) {
var ingredient = recipe [ "ItemIngredient" + i ]
var amount = recipe [ "AmountIngredient" + i ]
if ( ingredient !== null ) {
craftedItems [ ingredient . Name ] = 1
if ( ingredient . Name . includes ( "Component Materials" ) || ingredient . Name . includes ( "Skybuilders'" ) ) { continue }
if ( ingredient . Name in craftedItems ) {
let oldItem = craftedItems [ ingredient . Name ] ;
oldItem . amt += Number ( amount )
craftedItems [ ingredient . Name ] = oldItem
} else {
craftedItems [ ingredient . Name ] = { ... ingredient , "amt" : Number ( amount ) }
}
}
}
}
let retainerItems = [ [ ] , [ ] , [ ] , [ ] , [ ] , [ ] ]
let retainerItems = [ [ ] , [ ] , [ ] , [ ] , [ ] , [ ] , [ ] , [ ] , [ ] , [ ] ]
for ( var item of Object . keys ( craftedItems ) ) {
let found = false
for ( var i = 0 ; i < 5 ; i ++ ) {
let response = await itemComesBefore ( i , item ) ;
if ( response [ 0 ] === true ) {
retainerItems [ i ] = [ response [ 1 ] , ... retainerItems [ i ] ]
found = true
break ;
let retainerArray = [ r1Inventory , r2Inventory , r3Inventory , r4Inventory , r5Inventory , r6Inventory , r7Inventory , r8Inventory , r9Inventory ]
for ( var i = 0 ; i < retainerArray . length ; i ++ ) {
for ( var j = 0 ; j < retainerArray [ i ] . length ; j ++ ) {
let it = retainerArray [ i ] [ j ]
if ( it . name === item ) {
var targetItem = { ... it }
targetItem . amt = craftedItems [ item ] . amt
targetItem . hq = false
targetItem . slot = j
retainerItems [ i ] = [ targetItem , ... retainerItems [ i ] ]
found = true
break ;
}
}
if ( found ) {
break ;
}
}
if ( found === false ) {
retainerItems [ 5 ] = [ item , ... retainerItems [ 5 ] ]
console . log ( JSON . stringify ( craftedItems [ item ] ) + " not found. Adding as " + JSON . stringify ( { "icon" : craftedItems [ item ] . Icon , "id" : craftedItems [ item ] . ID , "name" : craftedItems [ item ] . Name , "amt" : craftedItems [ item ] . amt , "hq" : false } ) )
retainerItems [ 9 ] = [ { "icon" : craftedItems [ item ] . Icon , "id" : craftedItems [ item ] . ID , "name" : craftedItems [ item ] . Name , "amt" : craftedItems [ item ] . amt , "hq" : false } , ... retainerItems [ 9 ] ]
}
await sleep ( 250 )
}
for ( var i = 0 ; i < retainerItems . length - 1 ; i ++ ) {
retainerItems [ i ] . sort ( ( a , b ) => a . slot - b . slot )
}
setGroceryList ( retainerItems )
setChecking ( false )
} )
}
return < >
< Row className = "text-white" >
< Col >
Ending { retainerNames [ 0 ] } Item 1 :
< / C o l >
< Col >
< DarkInput name = "item1" value = { item1 } onChange = { ( f ) => { setItem1 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 1 ] } Item 1 :
< / C o l >
< Col >
< DarkInput name = "item1_2" value = { item1 _2 } onChange = { ( f ) => { setItem1 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< / R o w >
< Row className = "text-white" >
< Col >
Ending { retainerNames [ 1 ] } Item 2 :
< / C o l >
< Col >
< DarkInput name = "item2" value = { item2 } onChange = { ( f ) => { setItem2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 2 ] } Item 2 :
< / C o l >
< Col >
< DarkInput name = "item2_2" value = { item2 _2 } onChange = { ( f ) => { setItem2 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< / R o w >
< Row className = "text-white" >
< Col >
Ending { retainerNames [ 2 ] } Item 3 :
< / C o l >
< Col >
< DarkInput name = "item3" value = { item3 } onChange = { ( f ) => { setItem3 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 3 ] } Item 3 :
< / C o l >
< Col >
< DarkInput name = "item3_2" value = { item3 _2 } onChange = { ( f ) => { setItem3 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< / R o w >
< Row className = "text-white" >
< Col >
Ending { retainerNames [ 3 ] } Item 4 :
< / C o l >
< Col >
< DarkInput name = "item4" value = { item4 } onChange = { ( f ) => { setItem4 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 4 ] } Item 4 :
< / C o l >
< Col >
< DarkInput name = "item4_2" value = { item4 _2 } onChange = { ( f ) => { setItem4 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< / R o w >
< Row className = "text-white" >
< Col >
Ending { retainerNames [ 4 ] } Item 5 :
< / C o l >
< Col >
< DarkInput name = "item5" value = { item5 } onChange = { ( f ) => { setItem5 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< Col >
Beginning { retainerNames [ 5 ] } Item 5 :
< / C o l >
< Col >
< DarkInput name = "item5_2" value = { item5 _2 } onChange = { ( f ) => { setItem5 _2 ( f . currentTarget . value ) ; } } > < / D a r k I n p u t >
< / C o l >
< / R o w >
< Row >
< span > A < / s p a n >
function Item ( p ) {
const { it } = p
return it . amt > 0 && < Row className = "text-white" >
< Col > < img src = { "https://xivapi.com" + it . icon } > < / i m g > { i t . s l o t ? " [ " + M a t h . f l o o r ( i t . s l o t / 3 5 + 1 ) + " ] " : " " } { i t . n a m e } x { i t . a m t } { i t . h q ? " ( H Q ) " : " " } < / C o l >
< / R o w >
}
function RetainerDisplay ( p ) {
const { id , inventory } = p
return < >
< Row className = "text-white" > < Col > < h2 > { retainerNames [ id ] } ' s Inventory < / h 2 > < / C o l > < / R o w >
{ inventory . map ( ( item , i ) => < Item it = { item } key = { i } > < / I t e m > ) }
< / >
}
return < >
< Row className = "text-white" >
< Col xs = { 4 } >
< DarkSelect value = { selectedCrafter } onChange = { ( f ) => { setSelectedCrafter ( f . currentTarget . value ) } } >
{ crafters . map ( ( crafter , i ) => < option value = { i } > { crafter } < / o p t i o n > ) }
{ crafters . map ( ( crafter , i ) => < option value = { i } key = { i } > { crafter } < / o p t i o n > ) }
< / D a r k S e l e c t >
< / C o l >
@ -632,12 +328,32 @@ function ListApp(p){
< / C o l >
< / R o w >
< Row > < span > A < / s p a n > < / R o w >
{ groceryList . map ( ( list , i ) => < > < Row className = "text-white" >
< h2 > { retainerNames [ i ] } < / h 2 >
< / R o w >
< Row className = "text-white" > < ul >
{ list . map ( ( item ) => < li > { item . Name } < / l i > ) }
< / u l > < / R o w > < / > ) }
{ groceryList . map ( ( list , i ) => {
if ( list . length > 0 ) {
return < >
< Row className = "text-white" > < Col > { ( i === 9 ) ? < h4 style = { { "color" : "#AA0000" } } > Not Found : < / h 4 > : < h 4 > F r o m { r e t a i n e r N a m e s [ i ] } : < / h 4 > } < / C o l > < / R o w >
< Row className = "text-white" > < Col >
< ul >
{ list . map ( ( item , j ) => < li > < Item it = { item } key = { j } > < / I t e m > < / l i > ) }
< / u l >
< / C o l > < / R o w >
< / >
}
} ) }
< Row > < span > Inventories < / s p a n > < / R o w >
< Row className = "text-white" > < Col > < h2 > Player Inventory < / h 2 > < / C o l > < / R o w >
{ playerInventory . map ( ( item , i ) => < Item it = { item } key = { i } > < / I t e m > ) }
< Row className = "text-white" > < Col > < h2 > Chocobo Saddlebag Inventory < / h 2 > < / C o l > < / R o w >
{ saddlebagInventory . map ( ( item , i ) => < Item it = { item } key = { i } > < / I t e m > ) }
< RetainerDisplay id = { 0 } inventory = { r1Inventory } > < / R e t a i n e r D i s p l a y >
< RetainerDisplay id = { 1 } inventory = { r2Inventory } > < / R e t a i n e r D i s p l a y >
< RetainerDisplay id = { 2 } inventory = { r3Inventory } > < / R e t a i n e r D i s p l a y >
< RetainerDisplay id = { 3 } inventory = { r4Inventory } > < / R e t a i n e r D i s p l a y >
< RetainerDisplay id = { 4 } inventory = { r5Inventory } > < / R e t a i n e r D i s p l a y >
< RetainerDisplay id = { 5 } inventory = { r6Inventory } > < / R e t a i n e r D i s p l a y >
< RetainerDisplay id = { 6 } inventory = { r7Inventory } > < / R e t a i n e r D i s p l a y >
< RetainerDisplay id = { 7 } inventory = { r8Inventory } > < / R e t a i n e r D i s p l a y >
< RetainerDisplay id = { 8 } inventory = { r9Inventory } > < / R e t a i n e r D i s p l a y >
< / >
}
@ -816,7 +532,6 @@ function App() {
< / N a v b a r . B r a n d >
{ contributor . length > 0 && < >
< Nav . Link style = { ( nav === "main" ) ? { "color" : "lime" , "textDecoration" : "underline" } : { } } onClick = { ( ) => { setNav ( "main" ) } } > Main < / N a v . L i n k >
< Nav . Link style = { ( nav === "sort" ) ? { "color" : "lime" , "textDecoration" : "underline" } : { } } onClick = { ( ) => { setNav ( "sort" ) } } > Sort Check < / N a v . L i n k >
< Nav . Link style = { ( nav === "list" ) ? { "color" : "lime" , "textDecoration" : "underline" } : { } } onClick = { ( ) => { setNav ( "list" ) } } > Grocery List < / N a v . L i n k >
< span className = "text-light font-weight-light font-italic" > Signed in as { contributor } < / s p a n >
< / > }
@ -858,7 +573,6 @@ function App() {
< / C o l >
< / R o w >
:
nav === "sort" ? < SorterApp transferItems = { transferItems } setTransferItems = { setTransferItems } > < / S o r t e r A p p > :
nav === "list" ? < ListApp transferItems = { transferItems } > < / L i s t A p p > :
< > < / >
}