fix: change alpha in block selector(s) when selected

This commit is contained in:
trafficlunar 2025-02-22 18:02:10 +00:00
parent dc0ac2cc82
commit b58d778087
2 changed files with 2 additions and 3 deletions

View file

@ -70,7 +70,7 @@ function BlockSelector({ stageWidth, searchInput, selectedBlocks, setSelectedBlo
eventMode={"static"}
pointerover={() => setHoverPosition({ x, y })}
click={() => onClick(block)}
alpha={0.2}
alpha={selectedBlocks.includes(block) ? 1 : 0.2}
/>
{selectedBlocks.includes(block) && (
@ -80,7 +80,6 @@ function BlockSelector({ stageWidth, searchInput, selectedBlocks, setSelectedBlo
y={y}
draw={(g) => {
g.clear();
g.beginFill(0xffffff, 0.2);
g.lineStyle(2, isDark ? 0xffffff : 0x000000, 0.4, 0);
g.drawRect(0, 0, 32, 32);
}}

View file

@ -92,7 +92,7 @@ function BlockSelector({ stageWidth, searchInput }: Props) {
mouseover={() => setHoverPosition({ x, y })}
click={onClick}
tap={onClick}
alpha={0.3}
alpha={selectedBlock == block ? 1 : 0.3}
/>
);
})}