Skip to content

Commit 7c25d0a

Browse files
committed
add images
1 parent 6e07f88 commit 7c25d0a

File tree

1,422 files changed

+27
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,422 files changed

+27
-7
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.words": [
3+
"trappedchest"
4+
]
5+
}

README.md

Lines changed: 5 additions & 1 deletion

pages/gui.tsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import type { NextPage, GetStaticProps } from 'next'
33
import React from 'react'
44
import Layout from '../components/layout'
55

6+
import Image from 'next/image'
7+
68
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
79
import EditIcon from '@mui/icons-material/Edit';
810

@@ -96,8 +98,8 @@ const Gui: NextPage<{ items: Array<string> }> = ({ items: itemsList }) => {
9698
const item = guiData[guiIndex].data[id.pos];
9799

98100
setId(item?.id);
99-
setCount(item?.count);
100-
setAction(item?.action.type);
101+
setCount(item?.count || 1);
102+
setAction(item?.action.type || 'nothing');
101103
if (item?.action.type == 'page') setGoToPage(item?.action.page);
102104
}
103105

@@ -183,9 +185,9 @@ const Gui: NextPage<{ items: Array<string> }> = ({ items: itemsList }) => {
183185
// outline: `1px solid ${(gui.data[i * 10 + j] && gui.data[i * 10 + j].action.type == 'page') ? 'red' : 'invisible'}`
184186
}}>
185187
{gui.data[i * 9 + j] &&
186-
<Box sx={{ position: 'relative' }}>
188+
<Box sx={{ position: 'relative', width: '100%', height: '100%'}}>
189+
<Image src={`/images/items/minecraft__${gui.data[i * 9 + j].id}.png`} layout='fill'/>
187190
<Typography sx={{ position: 'absolute', bottom: 0, right: 0 }}>{gui.data[i * 9 + j].count}</Typography>
188-
<img src={`https://minecraftitemids.com/item/64/${gui.data[i * 9 + j].id}.png`}></img>
189191
</Box>
190192
}
191193
</Box>
@@ -308,7 +310,16 @@ const Gui: NextPage<{ items: Array<string> }> = ({ items: itemsList }) => {
308310
)}
309311
/>
310312

311-
<TextField variant="standard" id="outlined-number" label="Count" type="number" onChange={handleChangeCount} value={count} sx={{ mr: 1 }} />
313+
<TextField variant="standard" id="outlined-number" label="Count" type="number"
314+
onChange={handleChangeCount}
315+
defaultValue={count}
316+
sx={{ mr: 1 }}
317+
InputProps={{
318+
inputProps: {
319+
max: 64, min: 1
320+
}
321+
}}
322+
/>
312323

313324
<TextField
314325
variant="standard"
@@ -405,7 +416,7 @@ const Gui: NextPage<{ items: Array<string> }> = ({ items: itemsList }) => {
405416
renderOption={(props, option) => <li {...props}>{option.id}</li>}
406417
sx={{ width: 300 }}
407418
freeSolo
408-
renderInput={(params) => <TextField {...params} variant="standard" label="Contener" />}
419+
renderInput={(params) => <TextField {...params} variant="standard" label="Gui type" />}
409420
/>
410421
</Box>
411422
</CardContent>

public/Items.zip

1.56 MB
Binary file not shown.
105 Bytes
1.01 KB
447 Bytes
568 Bytes

0 commit comments

Comments
 (0)