upload files

This commit is contained in:
SandPoot
2021-04-23 19:30:28 -03:00
parent 0c5d19ecc8
commit f40f4c8257
4 changed files with 76 additions and 12 deletions
+61 -11
View File
@@ -1,6 +1,7 @@
import { useBackend } from '../backend';
import { Button, Section } from '../components';
import { Box, Button, Section } from '../components';
import { Window } from '../layouts';
import { classes } from 'common/react';
export const DecalPainter = (props, context) => {
const { act, data } = useBackend(context);
@@ -16,11 +17,25 @@ export const DecalPainter = (props, context) => {
{decal_list.map(decal => (
<Button
key={decal.decal}
content={decal.name}
style={{
width: '48px',
height: '48px',
padding: 0,
}}
selected={decal.decal === data.decal_style}
tooltip={decal.name}
onClick={() => act('select decal', {
decals: decal.decal,
})} />
})}>
<Box
className={classes([
'decals32x32',
data.decal_dir_text + '-' + decal.decal + (data.decal_color ? '_' + data.decal_color : ''),
])}
style={{
transform: 'scale(1.5) translate(17%, 17%)',
}} />
</Button>
))}
</Section>
<Section title="Decal Color">
@@ -28,15 +43,29 @@ export const DecalPainter = (props, context) => {
return (
<Button
key={color.colors}
content={color.colors === "red"
? "Red"
: color.colors === "white"
? "White"
: "Yellow"}
style={{
width: '48px',
height: '48px',
padding: 0,
}}
tooltip={color.colors === "red"
? "Red"
: color.colors === "white"
? "White"
: "Yellow"}
selected={color.colors === data.decal_color}
onClick={() => act('select color', {
colors: color.colors,
})} />
})}>
<Box
className={classes([
'decals32x32',
data.decal_dir_text + '-' + data.decal_style + (color.colors ? '_' + color.colors : ''),
])}
style={{
transform: 'scale(1.5) translate(17%, 17%)',
}} />
</Button>
);
})}
</Section>
@@ -45,7 +74,12 @@ export const DecalPainter = (props, context) => {
return (
<Button
key={dir.dirs}
content={dir.dirs === 1
style={{
width: '48px',
height: '48px',
padding: 0,
}}
tooltip={dir.dirs === 1
? "North"
: dir.dirs === 2
? "South"
@@ -55,7 +89,23 @@ export const DecalPainter = (props, context) => {
selected={dir.dirs === data.decal_direction}
onClick={() => act('selected direction', {
dirs: dir.dirs,
})} />
})}>
<Box
className={classes([
'decals32x32',
(dir.dirs === 1
? "north"
: dir.dirs === 2
? "south"
: dir.dirs === 4
? "east"
: "west")
+ '-' + data.decal_style + (data.decal_color ? '_' + data.decal_color : ''),
])}
style={{
transform: 'scale(1.5) translate(17%, 17%)',
}} />
</Button>
);
})}
</Section>