mirror of
https://github.com/trafficlunar/blockmatic.git
synced 2026-06-28 14:44:12 +00:00
fix: reimplement missing texture
This commit is contained in:
parent
f401ef3cfa
commit
258f1d332a
3 changed files with 12 additions and 5 deletions
|
|
@ -3,6 +3,7 @@ import { Container, Graphics, Sprite, Stage } from "@pixi/react";
|
|||
|
||||
import { CanvasContext } from "@/context/Canvas";
|
||||
import { ThemeContext } from "@/context/Theme";
|
||||
import { TexturesContext } from "@/context/Textures";
|
||||
|
||||
import { useBlockData } from "@/hooks/useBlockData";
|
||||
import { useTextures } from "@/hooks/useTextures";
|
||||
|
|
@ -17,6 +18,7 @@ interface Props {
|
|||
|
||||
function BlockSelector({ stageWidth, searchInput, selectedBlocks, setSelectedBlocks, userModifiedBlocks }: Props) {
|
||||
const { version } = useContext(CanvasContext);
|
||||
const { missingTexture } = useContext(TexturesContext);
|
||||
const { isDark } = useContext(ThemeContext);
|
||||
|
||||
const blockData = useBlockData(version);
|
||||
|
|
@ -53,7 +55,7 @@ function BlockSelector({ stageWidth, searchInput, selectedBlocks, setSelectedBlo
|
|||
<>
|
||||
<Sprite
|
||||
key={block}
|
||||
texture={textures[block]}
|
||||
texture={textures[block] ?? missingTexture}
|
||||
x={x}
|
||||
y={y}
|
||||
scale={2}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue