Skip to content

Commit 40cb99b

Browse files
committed
🛠️ Model opening fixes
- Fixed duplicate project UUIDs not being corrected. - Fixed opening multiple models at once causing the last one opened to have multiple AJ icons.
1 parent 1432d3d commit 40cb99b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/blueprintFormat.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
209209
}
210210
addProjectToRecentProjects(file)
211211
BLUEPRINT_CODEC.parse!(model, file.path)
212-
console.log(`Successfully loaded Animated Java Blueprint`)
212+
console.log(
213+
`Successfully loaded Animated Java Blueprint\n\tProject: ${Project.name}\n\t${Project.uuid}`
214+
)
213215
},
214216

215217
// region > parse
@@ -218,10 +220,6 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
218220
console.log(`Parsing Animated Java Blueprint from '${path}'...`)
219221
if (!Project) throw new Error('No project to parse into')
220222

221-
if (model.meta.uuid !== undefined) {
222-
Project.uuid = model.meta.uuid
223-
}
224-
225223
Project.save_path = model.meta.save_location || path
226224

227225
if (model.meta.box_uv !== undefined) {
@@ -554,8 +552,9 @@ export const BLUEPRINT_FORMAT = new Blockbench.ModelFormat({
554552
// Custom title
555553
void injectSvelteCompomponent({
556554
elementSelector: () => {
557-
const titles = [...document.querySelectorAll('.project_tab.selected')]
558-
titles.filter(title => title.textContent === Project!.name)
555+
const titles = [
556+
...document.querySelectorAll(`.project_tab[title="${project.name}"]`),
557+
]
559558
if (titles.length) {
560559
return titles[0]
561560
}

0 commit comments

Comments
 (0)