Skip to content

Commit

Permalink
🐛 In texture context menu -> Create template, create a template witho…
Browse files Browse the repository at this point in the history
…ut asking for its name; prompt for a name if already occupied
  • Loading branch information
CosmoMyzrailGorynych committed Jan 3, 2024
1 parent 30f05f4 commit d06d694
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/node_requires/resources/textures/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,15 @@ export const assetContextMenuItems: IAssetContextItem[] = [{
collection: folderEntries,
folder: IAssetFolder
): Promise<void> => {
const template = await createAsset('template', folder, asset.name);
template.texture = asset.uid;
template.name = asset.name;
if (getOfType('template').some(t => t.name === asset.name)) {
const template = await createAsset('template', folder);
template.texture = asset.uid;
} else {
const template = await createAsset('template', folder, {
name: asset.name
});
template.texture = asset.uid;
}
}
}];

Expand Down

0 comments on commit d06d694

Please sign in to comment.