added ui fro and iintegerated ui for decal modification
This commit is contained in:
@@ -10,7 +10,7 @@ interface WallStore {
|
||||
clearWalls: () => void;
|
||||
removeWallByPoints: (Points: [Point, Point]) => Wall | undefined;
|
||||
addDecal: (wallUuid: string, decal: Decal) => void;
|
||||
updateDecal: (decalUuid: string, decal: Decal) => void;
|
||||
updateDecal: (decalUuid: string, decal: Decal) => Wall | undefined;
|
||||
removeDecal: (decalUuid: string) => Wall | undefined;
|
||||
updateDecalPosition: (decalUuid: string, position: [number, number, number]) => void;
|
||||
updateDecalRotation: (decalUuid: string, rotation: number) => void;
|
||||
@@ -90,14 +90,19 @@ export const createWallStore = () => {
|
||||
}
|
||||
}),
|
||||
|
||||
updateDecal: (decalUuid, decal) => set((state) => {
|
||||
for (const wall of state.walls) {
|
||||
const decalToUpdate = wall.decals.find(d => d.decalUuid === decalUuid);
|
||||
if (decalToUpdate) {
|
||||
Object.assign(decalToUpdate, decal);
|
||||
updateDecal: (decalUuid, decal) => {
|
||||
let affectedWall: Wall | undefined;
|
||||
set((state) => {
|
||||
for (const wall of state.walls) {
|
||||
const decalToUpdate = wall.decals.find(d => d.decalUuid === decalUuid);
|
||||
if (decalToUpdate) {
|
||||
Object.assign(decalToUpdate, decal);
|
||||
affectedWall = JSON.parse(JSON.stringify(wall));
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
});
|
||||
return affectedWall;
|
||||
},
|
||||
|
||||
removeDecal: (decalUuid) => {
|
||||
let affectedWall: Wall | undefined;
|
||||
|
||||
Reference in New Issue
Block a user