Local Build Deployment
|
@ -1,16 +1,41 @@
|
|||
{
|
||||
"files": {
|
||||
"main.css": "/static/css/main.7948f1f9.css",
|
||||
"main.js": "/static/js/main.6564ce4b.js",
|
||||
"main.css": "/static/css/main.820e0273.css",
|
||||
"main.js": "/static/js/main.96892c8b.js",
|
||||
"static/js/787.ada1a5f8.chunk.js": "/static/js/787.ada1a5f8.chunk.js",
|
||||
"static/media/PotLid.png": "/static/media/PotLid.baf78a40199753b3af39.png",
|
||||
"static/media/Calamity-Regular.otf": "/static/media/Calamity-Regular.cbeefc650e6ac39335b6.otf",
|
||||
"static/media/SpiritOrb.png": "/static/media/SpiritOrb.66f25f8bbb0f27f0f568.png",
|
||||
"static/media/AncientArrow.png": "/static/media/AncientArrow.9a1a41d05b09babd770d.png",
|
||||
"static/media/IceArrow.png": "/static/media/IceArrow.c227e7fda67cfc094e27.png",
|
||||
"static/media/FaroshHorn.png": "/static/media/FaroshHorn.ea7e3cbc262af3c30e1d.png",
|
||||
"static/media/Rushroom.png": "/static/media/Rushroom.ab3824a1f76fa5347021.png",
|
||||
"static/media/SpeedFood.png": "/static/media/SpeedFood.1bde9cae9ffc0c3906ea.png",
|
||||
"static/media/HeartyBass.png": "/static/media/HeartyBass.4e0f8e06034479e163fe.png",
|
||||
"static/media/SilentPrincess.png": "/static/media/SilentPrincess.6b9283141fbc5993b481.png",
|
||||
"static/media/FaroshScale.png": "/static/media/FaroshScale.cc674ca9ac3cb63f99a3.png",
|
||||
"static/media/Honey.png": "/static/media/Honey.dbf6fd6eae2e33fc3d6c.png",
|
||||
"static/media/Tail.png": "/static/media/Tail.a43cfa310e2c86532247.png",
|
||||
"static/media/Wood.png": "/static/media/Wood.8105d493814e4ecd145f.png",
|
||||
"static/media/Diamond.png": "/static/media/Diamond.df6931b37a1f47165e37.png",
|
||||
"static/media/NormalArrow.png": "/static/media/NormalArrow.1c54890bf60a08914a20.png",
|
||||
"static/media/BombArrow.png": "/static/media/BombArrow.6b5994846aa06c8a8e92.png",
|
||||
"static/media/Opal.png": "/static/media/Opal.2e20b71d79a80f905a80.png",
|
||||
"static/media/Spring.png": "/static/media/Spring.bb7dcfa111b7b56ab25a.png",
|
||||
"static/media/ShockArrow.png": "/static/media/ShockArrow.823f535857deb6e461ab.png",
|
||||
"static/media/Shaft.png": "/static/media/Shaft.328e8aa17c1e5f9f0058.png",
|
||||
"static/media/ForestDwellerBow.png": "/static/media/ForestDwellerBow.d2a6ab2d3f59bcc67b4b.png",
|
||||
"static/media/FaroshClaw.png": "/static/media/FaroshClaw.4da7a445c986e0279916.png",
|
||||
"static/media/HyruleBass.png": "/static/media/HyruleBass.82ea677144fd38b4665a.png",
|
||||
"static/media/FireArrow.png": "/static/media/FireArrow.103898dc3f492d3293bd.png",
|
||||
"static/media/Lotus.png": "/static/media/Lotus.6006e27a51c66a0b9d3b.png",
|
||||
"index.html": "/index.html",
|
||||
"main.7948f1f9.css.map": "/static/css/main.7948f1f9.css.map",
|
||||
"main.6564ce4b.js.map": "/static/js/main.6564ce4b.js.map",
|
||||
"main.820e0273.css.map": "/static/css/main.820e0273.css.map",
|
||||
"main.96892c8b.js.map": "/static/js/main.96892c8b.js.map",
|
||||
"787.ada1a5f8.chunk.js.map": "/static/js/787.ada1a5f8.chunk.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.7948f1f9.css",
|
||||
"static/js/main.6564ce4b.js"
|
||||
"static/css/main.820e0273.css",
|
||||
"static/js/main.96892c8b.js"
|
||||
]
|
||||
}
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="for Breath of the Wild"/><meta property="og:site_name" content="itntpiston.app"/><meta property="og:title" content="Hundo Duplication Simulator"><meta property="og:type" content="website"><meta property="og:url" content="https://dupl.itntpiston.app/#/"><meta property="og:description" content="for Breath of the Wild"><link rel="manifest" href="/manifest.json"/><title>Hundo Duplication Simulator</title><script defer="defer" src="/static/js/main.6564ce4b.js"></script><link href="/static/css/main.7948f1f9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="for Breath of the Wild"/><meta property="og:site_name" content="itntpiston.app"/><meta property="og:title" content="Hundo Duplication Simulator"><meta property="og:type" content="website"><meta property="og:url" content="https://dupl.itntpiston.app/#/"><meta property="og:description" content="for Breath of the Wild"><link rel="manifest" href="/manifest.json"/><title>Hundo Duplication Simulator</title><script defer="defer" src="/static/js/main.96892c8b.js"></script><link href="/static/css/main.820e0273.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
2
docs/static/css/main.7948f1f9.css
vendored
|
@ -1,2 +0,0 @@
|
|||
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}h1{margin:0}@font-face{font-family:CalamitySans;src:url(/static/media/Calamity-Regular.cbeefc650e6ac39335b6.otf) format("opentype")}.Calamity{font-family:CalamitySans}.CommandItemSelected{background-color:#eee}.CommandItemContextSelected{background-color:#eaa}.CommandItemError{color:red}.CommandItem{cursor:pointer;padding:2px 2px 2px 10px}.CommandItem:hover{border:1px solid #000}.InputError{background-color:#eaa}
|
||||
/*# sourceMappingURL=main.7948f1f9.css.map*/
|
1
docs/static/css/main.7948f1f9.css.map
vendored
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"static/css/main.7948f1f9.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAEY,CAHZ,QAMF,CAEA,KACE,uEAEF,CCZA,GACE,QACF,CAEA,WACE,wBAAyB,CACzB,mFACF,CAEA,UACE,wBACF,CAEA,qBACE,qBACF,CAEA,4BACE,qBACF,CAEA,kBACE,SACF,CAEA,aAEE,cAAe,CADf,wBAEF,CAEA,mBACE,qBACF,CAEA,YACE,qBACF","sources":["index.css","App.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n","h1 {\n margin: 0\n}\n\n@font-face {\n font-family: CalamitySans;\n src: url(\"assets/Calamity-Regular.otf\") format(\"opentype\");\n}\n\n.Calamity {\n font-family: CalamitySans;\n}\n\n.CommandItemSelected {\n background-color: #eeeeee;\n}\n\n.CommandItemContextSelected {\n background-color: #eeaaaa;\n}\n\n.CommandItemError{\n color: red;\n}\n\n.CommandItem {\n padding: 2px 2px 2px 10px;\n cursor: pointer;\n}\n\n.CommandItem:hover {\n border: 1px solid black\n}\n\n.InputError {\n background-color: #eeaaaa;\n}\n"],"names":[],"sourceRoot":""}
|
2
docs/static/css/main.820e0273.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}h1{margin:0}@font-face{font-family:CalamitySans;src:url(/static/media/Calamity-Regular.cbeefc650e6ac39335b6.otf) format("opentype")}.Calamity{font-family:CalamitySans}.CommandItemSelected{background-color:#eee}.CommandItemContextSelected{background-color:#eaa}.CommandItemComment{color:green;font-size:10pt}.CommandItem{cursor:pointer;padding:2px 2px 2px 10px}.CommandItem:hover{background-color:#eee}.InputError{background-color:#eaa}.ItemSlot{background-color:#333;box-sizing:content-box;display:inline-block;height:64px;margin:4px;width:64px}.ItemSlotBroken{background-color:#600}.ItemSlotSave{background-color:#030}.ItemSlotEquipped{background-color:#08f}.ItemImage{border:1px solid #999;box-sizing:border-box;display:inline-block;height:62px;margin:1px;width:62px}.ItemCount{color:#eee;float:left;font-size:10pt;left:8px;position:relative;top:-22px}
|
||||
/*# sourceMappingURL=main.820e0273.css.map*/
|
1
docs/static/css/main.820e0273.css.map
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"static/css/main.820e0273.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAEY,CAHZ,QAMF,CAEA,KACE,uEAEF,CCZA,GACE,QACF,CAEA,WACE,wBAAyB,CACzB,mFACF,CAEA,UACE,wBACF,CAEA,qBACE,qBACF,CAEA,4BACE,qBACF,CAEA,oBACE,WAAY,CACZ,cACF,CAEA,aAEE,cAAe,CADf,wBAEF,CAEA,mBACE,qBACF,CAEA,YACE,qBACF,CAEA,UAKE,qBAAyB,CACzB,sBAAuB,CACvB,oBAAqB,CAJrB,WAAY,CAFZ,UAAW,CACX,UAMF,CAEA,gBACE,qBACF,CAEA,cACE,qBACF,CAEA,kBACE,qBACF,CAEA,WACE,qBAAyB,CACzB,qBAAsB,CAItB,oBAAoB,CADpB,WAAW,CAFX,UAAU,CACV,UAGF,CAKA,WAKE,UAAa,CACb,UAAW,CALX,cAAe,CAGf,QAAQ,CAFR,iBAAiB,CACjB,SAIF","sources":["index.css","App.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n","h1 {\n margin: 0\n}\n\n@font-face {\n font-family: CalamitySans;\n src: url(\"assets/Calamity-Regular.otf\") format(\"opentype\");\n}\n\n.Calamity {\n font-family: CalamitySans;\n}\n\n.CommandItemSelected {\n background-color: #eeeeee;\n}\n\n.CommandItemContextSelected {\n background-color: #eeaaaa;\n}\n\n.CommandItemComment{\n color: green;\n font-size: 10pt;\n}\n\n.CommandItem {\n padding: 2px 2px 2px 10px;\n cursor: pointer;\n}\n\n.CommandItem:hover {\n background-color: #eeeeee;\n}\n\n.InputError {\n background-color: #eeaaaa;\n}\n\n.ItemSlot {\n margin: 4px;\n width: 64px;\n height: 64px;\n \n background-color: #333333;\n box-sizing: content-box;\n display: inline-block;\n}\n\n.ItemSlotBroken {\n background-color: #660000;\n}\n\n.ItemSlotSave {\n background-color: #003300;\n}\n\n.ItemSlotEquipped {\n background-color: #0088ff;\n}\n\n.ItemImage {\n border: 1px solid #999999;\n box-sizing: border-box;\n margin:1px;\n width:62px;\n height:62px;\n display:inline-block;\n}\n\n.ItemImageSave {\n}\n\n.ItemCount {\n font-size: 10pt;\n position:relative;\n top:-22px;\n left:8px;\n color:#eeeeee;\n float: left;\n}\n"],"names":[],"sourceRoot":""}
|
3
docs/static/js/main.6564ce4b.js
vendored
1
docs/static/js/main.6564ce4b.js.map
vendored
3
docs/static/js/main.96892c8b.js
vendored
Normal file
|
@ -1,12 +1,3 @@
|
|||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
1
docs/static/js/main.96892c8b.js.map
vendored
Normal file
BIN
docs/static/media/AncientArrow.9a1a41d05b09babd770d.png
vendored
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/static/media/BombArrow.6b5994846aa06c8a8e92.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
docs/static/media/Diamond.df6931b37a1f47165e37.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
docs/static/media/FaroshClaw.4da7a445c986e0279916.png
vendored
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
docs/static/media/FaroshHorn.ea7e3cbc262af3c30e1d.png
vendored
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/static/media/FaroshScale.cc674ca9ac3cb63f99a3.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
docs/static/media/FireArrow.103898dc3f492d3293bd.png
vendored
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
docs/static/media/ForestDwellerBow.d2a6ab2d3f59bcc67b4b.png
vendored
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/static/media/HeartyBass.4e0f8e06034479e163fe.png
vendored
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
docs/static/media/Honey.dbf6fd6eae2e33fc3d6c.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
docs/static/media/HyruleBass.82ea677144fd38b4665a.png
vendored
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
docs/static/media/IceArrow.c227e7fda67cfc094e27.png
vendored
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/static/media/Lotus.6006e27a51c66a0b9d3b.png
vendored
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
docs/static/media/NormalArrow.1c54890bf60a08914a20.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
docs/static/media/Opal.2e20b71d79a80f905a80.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
docs/static/media/PotLid.baf78a40199753b3af39.png
vendored
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/static/media/Rushroom.ab3824a1f76fa5347021.png
vendored
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/static/media/Shaft.328e8aa17c1e5f9f0058.png
vendored
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/static/media/ShockArrow.823f535857deb6e461ab.png
vendored
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/static/media/SilentPrincess.6b9283141fbc5993b481.png
vendored
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
docs/static/media/SpeedFood.1bde9cae9ffc0c3906ea.png
vendored
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/static/media/SpiritOrb.66f25f8bbb0f27f0f568.png
vendored
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
docs/static/media/Spring.bb7dcfa111b7b56ab25a.png
vendored
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/static/media/Tail.a43cfa310e2c86532247.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
docs/static/media/Wood.8105d493814e4ecd145f.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
93
src/App.tsx
|
@ -95,9 +95,7 @@ export const App: React.FC = () => {
|
|||
setContextMenuY(contextMenuY-rect.height);
|
||||
}
|
||||
}
|
||||
}, [contextMenuRef, contextMenuShowing])
|
||||
|
||||
|
||||
}, [contextMenuRef, contextMenuShowing]);
|
||||
|
||||
return (
|
||||
<div className='Calamity'
|
||||
|
@ -173,7 +171,7 @@ export const App: React.FC = () => {
|
|||
</div>
|
||||
{displayIndex >= 0 && displayIndex < commands.length &&
|
||||
<DisplayPane
|
||||
overlaySave={overlaySave}
|
||||
overlaySave={overlaySave}
|
||||
displayIndex={displayIndex}
|
||||
command={commands[displayIndex].getDisplayString()}
|
||||
orbs={inventories[displayIndex].getTurnedInOrbs()}
|
||||
|
@ -217,51 +215,50 @@ export const App: React.FC = () => {
|
|||
paddingInlineStart: 0
|
||||
}}>
|
||||
{contextIndex >= 0 ? <>
|
||||
<CommandItem onClick={()=>{
|
||||
const arrCopy = [...commands];
|
||||
arrCopy.splice(contextIndex, 0, new CommandNothing());
|
||||
setCommands(arrCopy);
|
||||
setContextMenuShowing(false);
|
||||
setContextIndex(-1);
|
||||
}}>Insert Above</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
if(contextIndex > 0){
|
||||
<CommandItem onClick={()=>{
|
||||
const arrCopy = [...commands];
|
||||
const temp = arrCopy[contextIndex];
|
||||
arrCopy[contextIndex] = arrCopy[contextIndex-1];
|
||||
arrCopy[contextIndex-1] = temp;
|
||||
arrCopy.splice(contextIndex, 0, new CommandNothing());
|
||||
setCommands(arrCopy);
|
||||
setContextMenuShowing(false);
|
||||
setContextIndex(-1);
|
||||
}
|
||||
|
||||
|
||||
}}>Move Up</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
if(confirm("Delete?")){
|
||||
setCommands(commands.filter((_,i)=>i!==contextIndex));
|
||||
if(displayIndex >= commands.length){
|
||||
setDisplayIndex(commands.length-1);
|
||||
}
|
||||
setContextMenuShowing(false);
|
||||
setContextIndex(-1);
|
||||
}
|
||||
}}>Delete</CommandItem></> :
|
||||
<>
|
||||
<CommandItem onClick={()=>{
|
||||
setOverlaySave(!overlaySave);
|
||||
}}>Toggle Save Overlay</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
if(uploadRef.current){
|
||||
uploadRef.current.click();
|
||||
}
|
||||
}}>Import</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
const lines = commands.map(c=>c.getDisplayString());
|
||||
const text = lines.join("\n");
|
||||
saveAs(text, "dupe.txt");
|
||||
}}>Export</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
}}>Insert Above</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
if(contextIndex > 0){
|
||||
const arrCopy = [...commands];
|
||||
const temp = arrCopy[contextIndex];
|
||||
arrCopy[contextIndex] = arrCopy[contextIndex-1];
|
||||
arrCopy[contextIndex-1] = temp;
|
||||
setCommands(arrCopy);
|
||||
setContextMenuShowing(false);
|
||||
setContextIndex(-1);
|
||||
}
|
||||
|
||||
}}>Move Up</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
if(confirm("Delete?")){
|
||||
setCommands(commands.filter((_,i)=>i!==contextIndex));
|
||||
if(displayIndex >= commands.length){
|
||||
setDisplayIndex(commands.length-1);
|
||||
}
|
||||
setContextMenuShowing(false);
|
||||
setContextIndex(-1);
|
||||
}
|
||||
}}>Delete</CommandItem></> :
|
||||
<>
|
||||
<CommandItem onClick={()=>{
|
||||
setOverlaySave(!overlaySave);
|
||||
}}>Toggle Save Overlay</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
if(uploadRef.current){
|
||||
uploadRef.current.click();
|
||||
}
|
||||
}}>Import</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
const lines = commands.map(c=>c.getDisplayString());
|
||||
const text = lines.join("\n");
|
||||
saveAs(text, "dupe.txt");
|
||||
}}>Export</CommandItem>
|
||||
<CommandItem onClick={()=>{
|
||||
alert(`Available Commands:
|
||||
Initialize X Item1 Y Item2 Z Item3 ...
|
||||
Break X Slots - add X broken slots
|
||||
|
@ -276,7 +273,7 @@ Limitations:
|
|||
Inventory corruption is not implemented yet
|
||||
|
||||
`);
|
||||
alert(`Available Items:
|
||||
alert(`Available Items:
|
||||
Slate
|
||||
Glider
|
||||
SpiritOrb
|
||||
|
@ -299,9 +296,9 @@ Core
|
|||
Wood
|
||||
Weapon
|
||||
`);
|
||||
}}>Reference</CommandItem>
|
||||
}}>Reference</CommandItem>
|
||||
|
||||
</>
|
||||
</>
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -9,22 +9,22 @@ type ItemSlotProps = {
|
|||
|
||||
export const ItemSlot: React.FC<ItemSlotProps> = ({image, count, isBroken, isSave, isEquipped})=>{
|
||||
return (
|
||||
<span className={clsx("ItemSlot", isBroken && "ItemSlotBroken", isSave && "ItemSlotSave", isEquipped && "ItemSlotEquipped")}>
|
||||
<img className={clsx("ItemImage", isSave && "ItemImageSave")}src={image} />
|
||||
{
|
||||
count > 0 && <span className={"ItemCount"}>
|
||||
<span className={clsx("ItemSlot", isBroken && "ItemSlotBroken", isSave && "ItemSlotSave", isEquipped && "ItemSlotEquipped")}>
|
||||
<img className={clsx("ItemImage", isSave && "ItemImageSave")}src={image} />
|
||||
{
|
||||
count > 0 && <span className={"ItemCount"}>
|
||||
x{count}
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
);
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
export const DoubleItemSlot: React.FC<{first?: ItemSlotProps, second?: ItemSlotProps}> = ({first, second})=>{
|
||||
return (
|
||||
<span style={{display: "inline-block", width: 72, height: 144, verticalAlign:"top"}}>
|
||||
{first ? <ItemSlot {...first}/> : <div style={{height: 72}}/>}
|
||||
{second ? <ItemSlot {...second}/> : <div style={{height: 72}}/> }
|
||||
</span>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<span style={{display: "inline-block", width: 72, height: 144, verticalAlign:"top"}}>
|
||||
{first ? <ItemSlot {...first}/> : <div style={{height: 72}}/>}
|
||||
{second ? <ItemSlot {...second}/> : <div style={{height: 72}}/> }
|
||||
</span>
|
||||
);
|
||||
};
|
|
@ -1,7 +1,5 @@
|
|||
import { Inventory } from "./Inventory";
|
||||
import { idToItemData, Item, ItemStack, itemToArrowType, itemToItemData } from "./Item";
|
||||
|
||||
const Buffer = require("buffer/").Buffer; /* eslint-disable-line @typescript-eslint/no-var-requires*/
|
||||
import { Item, ItemStack, itemToArrowType } from "./Item";
|
||||
|
||||
export interface Command {
|
||||
execute(inv: Inventory): void,
|
||||
|
@ -199,7 +197,7 @@ export class CommandRemoveMaterial implements Command {
|
|||
inv.remove(this.item, this.count, this.slot);
|
||||
}
|
||||
public getDisplayString(): string {
|
||||
const slotString = this.noSlot ? "" : ` From Slot ${this.slot+1}`
|
||||
const slotString = this.noSlot ? "" : ` From Slot ${this.slot+1}`;
|
||||
return `${Verbs[this.verb]} ${this.count} ${this.item}${slotString}`;
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +218,7 @@ export class CommandRemoveUnstackableMaterial implements Command {
|
|||
inv.remove(this.item, 1, this.slot);
|
||||
}
|
||||
public getDisplayString(): string {
|
||||
const slotString = this.noSlot ? "" : ` From Slot ${this.slot+1}`
|
||||
const slotString = this.noSlot ? "" : ` From Slot ${this.slot+1}`;
|
||||
return `${Verbs[this.verb]} ${this.item}${slotString}`;
|
||||
}
|
||||
}
|
||||
|
@ -281,7 +279,7 @@ export class CommandEquipArrow implements Command {
|
|||
inv.equipEquipmentOrArrow(this.item, this.slot);
|
||||
}
|
||||
public getDisplayString(): string {
|
||||
const slotString = this.noSlot ? "" : ` In Slot ${this.slot+1}`
|
||||
const slotString = this.noSlot ? "" : ` In Slot ${this.slot+1}`;
|
||||
return `Equip ${itemToArrowType(this.item)} Arrow${slotString}`;
|
||||
}
|
||||
}
|
||||
|
@ -300,7 +298,7 @@ export class CommandEquip implements Command {
|
|||
inv.equipEquipmentOrArrow(this.item, this.slot);
|
||||
}
|
||||
public getDisplayString(): string {
|
||||
const slotString = this.noSlot ? "" : ` In Slot ${this.slot+1}`
|
||||
const slotString = this.noSlot ? "" : ` In Slot ${this.slot+1}`;
|
||||
return `Equip ${this.item}${slotString}`;
|
||||
}
|
||||
}
|
||||
|
@ -319,7 +317,7 @@ export class CommandUnequip implements Command {
|
|||
inv.unequipEquipment(this.item, this.slot);
|
||||
}
|
||||
public getDisplayString(): string {
|
||||
const slotString = this.noSlot ? "" : ` In Slot ${this.slot+1}`
|
||||
const slotString = this.noSlot ? "" : ` In Slot ${this.slot+1}`;
|
||||
return `Unequip ${this.item}${slotString}`;
|
||||
}
|
||||
}
|
||||
|
@ -334,7 +332,7 @@ export class CommandSetTag implements Command {
|
|||
inv.setTag(this.name);
|
||||
}
|
||||
public getDisplayString(): string {
|
||||
return `Save As ${this.name}`
|
||||
return `Save As ${this.name}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,7 +345,7 @@ export class CommandApplyTag implements Command {
|
|||
inv.applyTag(this.name);
|
||||
}
|
||||
public getDisplayString(): string {
|
||||
return `Use ${this.name}`
|
||||
return `Use ${this.name}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -356,7 +354,7 @@ export class CommandCloseGame implements Command {
|
|||
inv.closeGame();
|
||||
}
|
||||
public getDisplayString(): string {
|
||||
return `Close Game`;
|
||||
return "Close Game";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -365,8 +363,8 @@ export class CommandComment implements Command {
|
|||
constructor(name: string){
|
||||
this.name = name;
|
||||
}
|
||||
public execute(inv: Inventory): void {
|
||||
|
||||
public execute(_inv: Inventory): void {
|
||||
// nothing
|
||||
}
|
||||
public getDisplayString(): string {
|
||||
return `# ${this.name}`;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import { Item, ItemStack, itemToItemData, ItemType, ItemTypes } from "./Item";
|
||||
import { Slots } from "./Slots";
|
||||
|
||||
|
||||
|
||||
export class Inventory {
|
||||
private slots: Slots = new Slots([]);
|
||||
private savedSlots: Slots = new Slots([]);
|
||||
|
@ -51,7 +49,7 @@ export class Inventory {
|
|||
public init(stacks: ItemStack[]) {
|
||||
this.slots = new Slots([]);
|
||||
stacks.forEach(s=>{
|
||||
this.slots.add(s.item, s.count)
|
||||
this.slots.add(s.item, s.count);
|
||||
});
|
||||
this.numBroken = 0;
|
||||
this.isInitialSort = false;
|
||||
|
@ -110,7 +108,7 @@ export class Inventory {
|
|||
this.savedSlots.get(s).count = 999;
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
public reload() {
|
||||
|
|
|
@ -44,14 +44,14 @@ export enum ItemType {
|
|||
}
|
||||
|
||||
export const ItemTypes = [
|
||||
ItemType.Weapon,
|
||||
ItemType.Bow,
|
||||
ItemType.Weapon,
|
||||
ItemType.Bow,
|
||||
ItemType.Arrow,
|
||||
ItemType.Shield,
|
||||
ItemType.Material,
|
||||
ItemType.Meal,
|
||||
ItemType.Key
|
||||
]
|
||||
ItemType.Shield,
|
||||
ItemType.Material,
|
||||
ItemType.Meal,
|
||||
ItemType.Key
|
||||
];
|
||||
|
||||
export type ItemStack = {
|
||||
item: Item,
|
||||
|
@ -131,14 +131,14 @@ const register = (id: number, item: Item, type: ItemType, image: string, options
|
|||
repeatable: true,
|
||||
stackable: true,
|
||||
sortOrder,
|
||||
...(options||{})
|
||||
...options||{}
|
||||
};
|
||||
if(id in IdToData){
|
||||
console.error("Multiple items registered to the same id: "+id+", ("+item+")");
|
||||
}
|
||||
IdToData[id] = data;
|
||||
ItemToData[item] = data;
|
||||
}
|
||||
};
|
||||
/* Do not change the ID once created. Otherwise you would break existing codes */
|
||||
register(0x00, Item.Slate, ItemType.Key, ImageSlate, {
|
||||
repeatable: false,
|
||||
|
@ -201,4 +201,4 @@ export const itemToArrowType = (item: Item): string => {
|
|||
return str.substring(0,str.length-5);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,197 +1,197 @@
|
|||
import { Item, ItemStack, itemToItemData, ItemType } from "./Item";
|
||||
|
||||
export class Slots {
|
||||
private internalSlots: ItemStack[] = [];
|
||||
constructor(slots: ItemStack[]) {
|
||||
this.internalSlots = slots;
|
||||
}
|
||||
public getSlotsRef(): ItemStack[] {
|
||||
return this.internalSlots;
|
||||
}
|
||||
public deepClone(): Slots {
|
||||
return new Slots(this.internalSlots.map(s=>({...s})));
|
||||
}
|
||||
public get length(): number {
|
||||
return this.internalSlots.length;
|
||||
}
|
||||
public get(i: number): ItemStack{
|
||||
return this.internalSlots[i];
|
||||
}
|
||||
public getByType(type: ItemType): Slots {
|
||||
return new Slots(this.internalSlots.filter(s=>itemToItemData(s.item).type===type));
|
||||
}
|
||||
public getBeforeType(type: ItemType): Slots {
|
||||
return new Slots(this.internalSlots.filter(s=>itemToItemData(s.item).type<type));
|
||||
}
|
||||
public getAfterType(type: ItemType): Slots {
|
||||
return new Slots(this.internalSlots.filter(s=>itemToItemData(s.item).type>type));
|
||||
}
|
||||
public addSlotsToEnd(slots: Slots) {
|
||||
slots.internalSlots.forEach(s=>this.addStack(s));
|
||||
}
|
||||
public addStack(stack: ItemStack) {
|
||||
// Scan non-repeatables
|
||||
const data = itemToItemData(stack.item);
|
||||
if(!data.repeatable){
|
||||
for(let i=0;i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].item===stack.item){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.internalSlots.push(stack);
|
||||
}
|
||||
public addStackCopy(stack: ItemStack) {
|
||||
this.addStack({...stack});
|
||||
}
|
||||
public sort() {
|
||||
this.internalSlots.sort((a,b)=>{
|
||||
return itemToItemData(a.item).sortOrder - itemToItemData(b.item).sortOrder;
|
||||
});
|
||||
}
|
||||
public removeFromEnd(count: number): Slots {
|
||||
const end = this.internalSlots.splice(-count, count);
|
||||
return new Slots(end);
|
||||
}
|
||||
public remove(item: Item, count: number, slot: number) {
|
||||
let s = 0;
|
||||
for(let i = 0; i<this.internalSlots.length && count > 0;i++){
|
||||
if(this.internalSlots[i].item === item){
|
||||
if(s<slot){
|
||||
s++;
|
||||
}else{
|
||||
if(this.internalSlots[i].count<count){
|
||||
count-=this.internalSlots[i].count;
|
||||
this.internalSlots[i].count=0;
|
||||
|
||||
}else{
|
||||
this.internalSlots[i].count-=count;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
this.internalSlots = this.internalSlots.filter(({count})=>count>0);
|
||||
}
|
||||
|
||||
public add(item: Item, count: number) {
|
||||
let added = false;
|
||||
const data = itemToItemData(item);
|
||||
if(data.stackable){
|
||||
for(let i = 0; i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].item === item){
|
||||
this.internalSlots[i].count+=count;
|
||||
added = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!added){
|
||||
const after = this.removeFromEnd(this.getAfterType(data.type).length);
|
||||
if(data.stackable){
|
||||
if(data.type===ItemType.Arrow){
|
||||
// if currently equipped arrow == 0. new arrows are equiped
|
||||
const shouldEquipNew = this.internalSlots.filter(s=>{
|
||||
const sData = itemToItemData(s.item);
|
||||
return sData.type === data.type && s.equipped && s.count > 0;
|
||||
}).length === 0;
|
||||
this.addStack({item,count,equipped:shouldEquipNew});
|
||||
}else{
|
||||
this.addStack({item,count,equipped:false});
|
||||
}
|
||||
|
||||
}else{
|
||||
if(data.type===ItemType.Weapon || data.type===ItemType.Bow || data.type===ItemType.Shield){
|
||||
//Check equip
|
||||
const shouldEquipNew = this.internalSlots.filter(s=>{
|
||||
const sData = itemToItemData(s.item);
|
||||
return sData.type === data.type && s.equipped;
|
||||
}).length === 0;
|
||||
this.addStack({item,count:1,equipped: shouldEquipNew});
|
||||
for(let i=1;i<count;i++){
|
||||
this.addStack({item,count:1,equipped: false});
|
||||
|
||||
}
|
||||
}else{
|
||||
for(let i=0;i<count;i++){
|
||||
this.addStack({item,count:1,equipped: false});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.addSlotsToEnd(after);
|
||||
}
|
||||
}
|
||||
// this is for both equipments and arrows
|
||||
public equip(item: Item, slot: number) {
|
||||
let s = 0;
|
||||
const type = itemToItemData(item).type;
|
||||
const filtered = this.internalSlots.filter(s=>itemToItemData(s.item).type === type);
|
||||
for(let i = 0; i<filtered.length;i++){
|
||||
filtered[i].equipped=false;
|
||||
if(filtered[i].item === item){
|
||||
if (s===slot){
|
||||
filtered[i].equipped=true;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
}
|
||||
}
|
||||
public unequip(item:Item, slot: number) {
|
||||
let s = 0;
|
||||
const type = itemToItemData(item).type;
|
||||
if (type===ItemType.Arrow){
|
||||
return; // cannot unequip arrow
|
||||
}
|
||||
for(let i = 0; i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].item === item){
|
||||
if(slot < 0){
|
||||
if(this.internalSlots[i].equipped){
|
||||
this.internalSlots[i].equipped=false;
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if(s<slot){
|
||||
s++;
|
||||
}else{
|
||||
this.internalSlots[i].equipped=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Difference between shoot and remove:
|
||||
// 1. can only be from first (leftmost) slot
|
||||
// 2. empty slots not removed
|
||||
public shoot(item: Item, count: number) {
|
||||
for(let i = 0; i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].item === item){
|
||||
this.internalSlots[i].count-=count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sortArrows() {
|
||||
const after = this.removeFromEnd(this.getAfterType(ItemType.Arrow).length);
|
||||
const arrows = this.removeFromEnd(this.getByType(ItemType.Arrow).length);
|
||||
arrows.sort();
|
||||
this.addSlotsToEnd(arrows);
|
||||
this.addSlotsToEnd(after);
|
||||
}
|
||||
|
||||
public getFirstEquippedSlotIndex(type: ItemType): number {
|
||||
for(let i = 0; i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].equipped){
|
||||
const data = itemToItemData(this.internalSlots[i].item);
|
||||
if(data.type === type){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
import { Item, ItemStack, itemToItemData, ItemType } from "./Item";
|
||||
|
||||
export class Slots {
|
||||
private internalSlots: ItemStack[] = [];
|
||||
constructor(slots: ItemStack[]) {
|
||||
this.internalSlots = slots;
|
||||
}
|
||||
public getSlotsRef(): ItemStack[] {
|
||||
return this.internalSlots;
|
||||
}
|
||||
public deepClone(): Slots {
|
||||
return new Slots(this.internalSlots.map(s=>({...s})));
|
||||
}
|
||||
public get length(): number {
|
||||
return this.internalSlots.length;
|
||||
}
|
||||
public get(i: number): ItemStack{
|
||||
return this.internalSlots[i];
|
||||
}
|
||||
public getByType(type: ItemType): Slots {
|
||||
return new Slots(this.internalSlots.filter(s=>itemToItemData(s.item).type===type));
|
||||
}
|
||||
public getBeforeType(type: ItemType): Slots {
|
||||
return new Slots(this.internalSlots.filter(s=>itemToItemData(s.item).type<type));
|
||||
}
|
||||
public getAfterType(type: ItemType): Slots {
|
||||
return new Slots(this.internalSlots.filter(s=>itemToItemData(s.item).type>type));
|
||||
}
|
||||
public addSlotsToEnd(slots: Slots) {
|
||||
slots.internalSlots.forEach(s=>this.addStack(s));
|
||||
}
|
||||
public addStack(stack: ItemStack) {
|
||||
// Scan non-repeatables
|
||||
const data = itemToItemData(stack.item);
|
||||
if(!data.repeatable){
|
||||
for(let i=0;i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].item===stack.item){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.internalSlots.push(stack);
|
||||
}
|
||||
public addStackCopy(stack: ItemStack) {
|
||||
this.addStack({...stack});
|
||||
}
|
||||
public sort() {
|
||||
this.internalSlots.sort((a,b)=>{
|
||||
return itemToItemData(a.item).sortOrder - itemToItemData(b.item).sortOrder;
|
||||
});
|
||||
}
|
||||
public removeFromEnd(count: number): Slots {
|
||||
const end = this.internalSlots.splice(-count, count);
|
||||
return new Slots(end);
|
||||
}
|
||||
public remove(item: Item, count: number, slot: number) {
|
||||
let s = 0;
|
||||
for(let i = 0; i<this.internalSlots.length && count > 0;i++){
|
||||
if(this.internalSlots[i].item === item){
|
||||
if(s<slot){
|
||||
s++;
|
||||
}else{
|
||||
if(this.internalSlots[i].count<count){
|
||||
count-=this.internalSlots[i].count;
|
||||
this.internalSlots[i].count=0;
|
||||
|
||||
}else{
|
||||
this.internalSlots[i].count-=count;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
this.internalSlots = this.internalSlots.filter(({count})=>count>0);
|
||||
}
|
||||
|
||||
public add(item: Item, count: number) {
|
||||
let added = false;
|
||||
const data = itemToItemData(item);
|
||||
if(data.stackable){
|
||||
for(let i = 0; i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].item === item){
|
||||
this.internalSlots[i].count+=count;
|
||||
added = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!added){
|
||||
const after = this.removeFromEnd(this.getAfterType(data.type).length);
|
||||
if(data.stackable){
|
||||
if(data.type===ItemType.Arrow){
|
||||
// if currently equipped arrow == 0. new arrows are equiped
|
||||
const shouldEquipNew = this.internalSlots.filter(s=>{
|
||||
const sData = itemToItemData(s.item);
|
||||
return sData.type === data.type && s.equipped && s.count > 0;
|
||||
}).length === 0;
|
||||
this.addStack({item,count,equipped:shouldEquipNew});
|
||||
}else{
|
||||
this.addStack({item,count,equipped:false});
|
||||
}
|
||||
|
||||
}else{
|
||||
if(data.type===ItemType.Weapon || data.type===ItemType.Bow || data.type===ItemType.Shield){
|
||||
//Check equip
|
||||
const shouldEquipNew = this.internalSlots.filter(s=>{
|
||||
const sData = itemToItemData(s.item);
|
||||
return sData.type === data.type && s.equipped;
|
||||
}).length === 0;
|
||||
this.addStack({item,count:1,equipped: shouldEquipNew});
|
||||
for(let i=1;i<count;i++){
|
||||
this.addStack({item,count:1,equipped: false});
|
||||
|
||||
}
|
||||
}else{
|
||||
for(let i=0;i<count;i++){
|
||||
this.addStack({item,count:1,equipped: false});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.addSlotsToEnd(after);
|
||||
}
|
||||
}
|
||||
// this is for both equipments and arrows
|
||||
public equip(item: Item, slot: number) {
|
||||
let s = 0;
|
||||
const type = itemToItemData(item).type;
|
||||
const filtered = this.internalSlots.filter(s=>itemToItemData(s.item).type === type);
|
||||
for(let i = 0; i<filtered.length;i++){
|
||||
filtered[i].equipped=false;
|
||||
if(filtered[i].item === item){
|
||||
if (s===slot){
|
||||
filtered[i].equipped=true;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
}
|
||||
}
|
||||
public unequip(item:Item, slot: number) {
|
||||
let s = 0;
|
||||
const type = itemToItemData(item).type;
|
||||
if (type===ItemType.Arrow){
|
||||
return; // cannot unequip arrow
|
||||
}
|
||||
for(let i = 0; i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].item === item){
|
||||
if(slot < 0){
|
||||
if(this.internalSlots[i].equipped){
|
||||
this.internalSlots[i].equipped=false;
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if(s<slot){
|
||||
s++;
|
||||
}else{
|
||||
this.internalSlots[i].equipped=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Difference between shoot and remove:
|
||||
// 1. can only be from first (leftmost) slot
|
||||
// 2. empty slots not removed
|
||||
public shoot(item: Item, count: number) {
|
||||
for(let i = 0; i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].item === item){
|
||||
this.internalSlots[i].count-=count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sortArrows() {
|
||||
const after = this.removeFromEnd(this.getAfterType(ItemType.Arrow).length);
|
||||
const arrows = this.removeFromEnd(this.getByType(ItemType.Arrow).length);
|
||||
arrows.sort();
|
||||
this.addSlotsToEnd(arrows);
|
||||
this.addSlotsToEnd(after);
|
||||
}
|
||||
|
||||
public getFirstEquippedSlotIndex(type: ItemType): number {
|
||||
for(let i = 0; i<this.internalSlots.length;i++){
|
||||
if(this.internalSlots[i].equipped){
|
||||
const data = itemToItemData(this.internalSlots[i].item);
|
||||
if(data.type === type){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ const stacksToItemProps = (stacks: ItemStack[]): ItemListItemProps[] => {
|
|||
const stackToItemProps = ({item, count, equipped}: ItemStack): ItemListItemProps => {
|
||||
const data = itemToItemData(item);
|
||||
return {image: data.image, count: data.stackable ? count : 0, isEquipped:equipped};
|
||||
}
|
||||
};
|
||||
|
||||
export const DisplayPane: React.FC<DisplayPaneProps> = ({command,orbs,editCommand,displayIndex, slots, savedSlots, numBroken, overlaySave})=>{
|
||||
const [commandString, setCommandString] = useState<string>("");
|
||||
|
@ -79,72 +79,71 @@ export const DisplayPane: React.FC<DisplayPaneProps> = ({command,orbs,editComman
|
|||
setHasError(true);
|
||||
}
|
||||
}}></input>
|
||||
<span>
|
||||
<span>
|
||||
Orbs: {orbs}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
{overlaySave ?
|
||||
{overlaySave ?
|
||||
<div style={{
|
||||
borderTop: "1px solid black",
|
||||
boxSizing: "content-box",
|
||||
height: "calc( ( 99vh - 60px ))",
|
||||
overflowY: "auto"
|
||||
} }>
|
||||
<div>Save / Current</div>
|
||||
<div>
|
||||
{
|
||||
(()=>{
|
||||
const doubleSlots: JSX.Element[] = [];
|
||||
for(let i=0;i<savedSlots.length && i<slots.length;i++){
|
||||
doubleSlots.push(<DoubleItemSlot key={i}
|
||||
first={{...stackToItemProps(savedSlots.get(i)), isBroken:false, isSave:true}}
|
||||
second={{...stackToItemProps(slots.get(i)), isBroken:i>=slots.length-numBroken, isSave:false}}
|
||||
/>);
|
||||
borderTop: "1px solid black",
|
||||
boxSizing: "content-box",
|
||||
height: "calc( ( 99vh - 60px ))",
|
||||
overflowY: "auto"
|
||||
} }>
|
||||
<div>Save / Current</div>
|
||||
<div>
|
||||
{
|
||||
(()=>{
|
||||
const doubleSlots: JSX.Element[] = [];
|
||||
for(let i=0;i<savedSlots.length && i<slots.length;i++){
|
||||
doubleSlots.push(<DoubleItemSlot key={i}
|
||||
first={{...stackToItemProps(savedSlots.get(i)), isBroken:false, isSave:true}}
|
||||
second={{...stackToItemProps(slots.get(i)), isBroken:i>=slots.length-numBroken, isSave:false}}
|
||||
/>);
|
||||
}
|
||||
if(savedSlots.length>slots.length){
|
||||
for(let i=slots.length;i<savedSlots.length;i++){
|
||||
doubleSlots.push(<DoubleItemSlot key={i+slots.length}
|
||||
first={{...stackToItemProps(savedSlots.get(i)), isBroken:false, isSave:true}}
|
||||
/>);
|
||||
}
|
||||
}else if(slots.length > savedSlots.length){
|
||||
for(let i=savedSlots.length;i<slots.length;i++){
|
||||
doubleSlots.push(<DoubleItemSlot key={i + savedSlots.length}
|
||||
second={{...stackToItemProps(slots.get(i)), isBroken:i>=slots.length-numBroken, isSave:false}}
|
||||
/>);
|
||||
}
|
||||
}
|
||||
return doubleSlots;
|
||||
})()
|
||||
}
|
||||
if(savedSlots.length>slots.length){
|
||||
for(let i=slots.length;i<savedSlots.length;i++){
|
||||
doubleSlots.push(<DoubleItemSlot key={i+slots.length}
|
||||
first={{...stackToItemProps(savedSlots.get(i)), isBroken:false, isSave:true}}
|
||||
/>);
|
||||
}
|
||||
}else if(slots.length > savedSlots.length){
|
||||
for(let i=savedSlots.length;i<slots.length;i++){
|
||||
doubleSlots.push(<DoubleItemSlot key={i + savedSlots.length}
|
||||
second={{...stackToItemProps(slots.get(i)), isBroken:i>=slots.length-numBroken, isSave:false}}
|
||||
/>);
|
||||
}
|
||||
}
|
||||
return doubleSlots;
|
||||
})()
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
:<>
|
||||
:<>
|
||||
|
||||
<div style={{
|
||||
borderTop: "1px solid black",
|
||||
borderBottom: "1px solid black",
|
||||
marginBottom: 2,
|
||||
boxSizing: "content-box",
|
||||
height: "calc( ( 99vh - 60px ) / 2)",
|
||||
overflowY: "auto"
|
||||
} }>
|
||||
<div>Inventory of Save</div>
|
||||
<ItemList {...listSaveProps}/>
|
||||
</div>
|
||||
<div style={{
|
||||
borderTop: "1px solid black",
|
||||
boxSizing: "content-box",
|
||||
height: "calc( ( 99vh - 60px ) / 2)",
|
||||
overflowY: "auto"
|
||||
} }>
|
||||
<div>Current Inventory</div>
|
||||
<ItemList {...listProps}/>
|
||||
</div>
|
||||
</>}
|
||||
|
||||
<div style={{
|
||||
borderTop: "1px solid black",
|
||||
borderBottom: "1px solid black",
|
||||
marginBottom: 2,
|
||||
boxSizing: "content-box",
|
||||
height: "calc( ( 99vh - 60px ) / 2)",
|
||||
overflowY: "auto"
|
||||
} }>
|
||||
<div>Inventory of Save</div>
|
||||
<ItemList {...listSaveProps}/>
|
||||
</div>
|
||||
<div style={{
|
||||
borderTop: "1px solid black",
|
||||
boxSizing: "content-box",
|
||||
height: "calc( ( 99vh - 60px ) / 2)",
|
||||
overflowY: "auto"
|
||||
} }>
|
||||
<div>Current Inventory</div>
|
||||
<ItemList {...listProps}/>
|
||||
</div>
|
||||
</>}
|
||||
|
||||
</div>;
|
||||
};
|
||||
|
|