Skip to content

Commit 1afb92a

Browse files
committed
🚧 Squashed commit of v1.2.0
commit 13b8983 Merge: 6004ca2 5bc106d Author: Titus Evans <snavesutit@gmail.com> Date: Sat Jul 20 10:01:17 2024 -0700 ⤵️ Merge pull request #221 from LeCarbonator/translation-de Add german translation for new keys commit 6004ca2 Author: SnaveSutit <snavesutit@gmail.com> Date: Sat Jul 20 12:55:29 2024 -0400 🛠️ Fix json export path not respecting relative paths commit 6f2b0cb Author: SnaveSutit <snavesutit@gmail.com> Date: Sat Jul 20 12:51:39 2024 -0400 🛠️ Fix #230 commit 7cfc4ca Author: SnaveSutit <snavesutit@gmail.com> Date: Sat Jul 20 12:30:28 2024 -0400 🛠️ Actually fix #215 commit c829397 Author: SnaveSutit <snavesutit@gmail.com> Date: Sat Jul 20 12:25:02 2024 -0400 🛠️ Fix #223 commit b56ff21 Author: SnaveSutit <snavesutit@gmail.com> Date: Sat Jul 20 12:22:09 2024 -0400 🚧 Hide `override_glow_color` option in plugin mode commit b747b20 Author: SnaveSutit <snavesutit@gmail.com> Date: Sat Jul 20 11:57:50 2024 -0400 🚧 Disable font manager debug output commit c70e4a8 Author: SnaveSutit <snavesutit@gmail.com> Date: Sat Jul 20 11:57:08 2024 -0400 🛠️ Fix #231 The code was checking for an array with length > 1 instead of > 0. Oops! commit 6782deb Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 19 14:38:36 2024 -0400 🚧 Remove wireframe debug effect commit 5bb2d52 Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 19 14:37:26 2024 -0400 🚧 Improve item rendering and bounding boxes commit 7212422 Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 19 13:41:27 2024 -0400 🚧 Fix #225 I found a way to avoid overwriting the `Preview.raycast` method, which should make selecting custom elements much more stable now. commit 83a2030 Author: SnaveSutit <snavesutit@gmail.com> Date: Thu Jul 18 13:50:19 2024 -0400 🚧 JSON Compiler improvements - Implemented #227. - Fixed #228. - Added new node type: `struct`. Can be used to re-create the rig's bone structure for dynamic animations. - Added `is_default` to exported variant JSON. commit 2e4f4b5 Author: SnaveSutit <snavesutit@gmail.com> Date: Mon Jul 15 16:48:12 2024 -0400 v1.1.0 commit 7e48c40 Author: SnaveSutit <snavesutit@gmail.com> Date: Mon Jul 15 16:47:59 2024 -0400 🚧 Hide easing options if non-linear interpolation commit 61502a1 Author: SnaveSutit <snavesutit@gmail.com> Date: Mon Jul 15 15:48:38 2024 -0400 🚧 Uninstall message (tells you to restart BB) commit c82c457 Author: SnaveSutit <snavesutit@gmail.com> Date: Mon Jul 15 15:42:13 2024 -0400 🚧 Welcome page commit df55e43 Author: SnaveSutit <snavesutit@gmail.com> Date: Mon Jul 15 13:44:41 2024 -0400 🚧 Improve some types, and fix some dialog issues commit 958e209 Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 15:12:10 2024 -0400 Fix #216 changing the ease now defaults the args commit 2cb4ef4 Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 13:59:14 2024 -0400 🛠️ Fix incorrect block model rotations with `facing` commit 5bc106d Author: LeCarbonator <18158911+LeCarbonator@users.noreply.github.com> Date: Sun Jul 14 19:50:29 2024 +0200 add german translation for new keys commit 6c084db Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:57:53 2024 -0400 🚧 Update text blueprint commit 0d3a6db Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:38:03 2024 -0400 🛠️ Fix #214 @LeCarbonator minor localization key additions commit 236b2c0 Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:34:40 2024 -0400 🛠️ Fix #220 commit b41a72b Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:33:58 2024 -0400 🛠️ Fix Default anim snapping effecting all formats commit a14d1a9 Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:31:05 2024 -0400 🛠️ Fix #215 commit c9cdb13 Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:21:53 2024 -0400 🛠️ Fix #218 Block displays should not respect the `facing` state. commit bde8fe3 Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:20:34 2024 -0400 🛠️ Fix untranslated error messages. @LeCarbonator this time there are actually new translation keys 😅 commit f19ec3e Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:02:51 2024 -0400 🛠️ Fix #219 commit 7af48b1 Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:02:43 2024 -0400 🛠️ Fix invalid NBT in outdated rig warning commit f7bf8dc Author: SnaveSutit <snavesutit@gmail.com> Date: Sun Jul 14 12:02:21 2024 -0400 🛠️ Fix invalid animation names commit b020e4e Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 12 21:53:09 2024 -0400 🛠️ Fix #212 commit ea6f853 Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 12 21:39:47 2024 -0400 🛠️ Fix per-rig objectives being put in global commit 6f22c25 Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 12 21:07:28 2024 -0400 🚧 Missing language translation fix - Fix the `translation` function returning the translation key when a language that isn't supported is selected. It now returns the English translation if no language is found. commit 4c37978 Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 12 20:16:20 2024 -0400 🚧 Fix #211 commit c0df525 Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 12 19:43:51 2024 -0400 🚧 Update incorrect translation keys commit fd716a5 Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 12 10:05:29 2024 -0400 🧼 Clean up some unused code in keyframeEasings UI commit e518b9b Author: SnaveSutit <snavesutit@gmail.com> Date: Fri Jul 12 10:04:58 2024 -0400 🛠️ Fix missing easing mode translation string @LeCarbonator Translations will need to be updated commit df45be5 Author: SnaveSutit <snavesutit@gmail.com> Date: Thu Jul 11 17:41:30 2024 -0400 🛠️ Maybe fix weird save path issues commit fabd543 Author: SnaveSutit <snavesutit@gmail.com> Date: Thu Jul 11 17:41:03 2024 -0400 🚧 Update build scripts commit f33a389 Author: SnaveSutit <snavesutit@gmail.com> Date: Thu Jul 11 17:40:35 2024 -0400 🧼 Clean up dependencies commit aa68c8f Author: SnaveSutit <snavesutit@gmail.com> Date: Thu Jul 11 10:28:31 2024 -0400 🚧 Fix about.md links
1 parent 09c03b1 commit 1afb92a

27 files changed

+411
-182
lines changed

schemas/pluginJson.schema.json

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -144,24 +144,15 @@
144144
"type": "object",
145145
"additionalProperties": false,
146146
"patternProperties": {
147-
"animated_java:transparent_texture": {
148-
"type": "object",
149-
"description": "The internal transparent texture used to hide parts of the Rig.",
150-
"properties": {
151-
"name": { "const": "Transparent" },
152-
"expectedPath": {
153-
"const": "assets\\animated_java\\textures\\item\\armor_stand\\Transparent.png"
154-
},
155-
"src": {
156-
"const": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABgWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kTtIA0EURY+JokjEwhQiFltEK21UxFKiKIKBkETwV7i7MVHIrmE3YmMp2AYs/DRGLWystbWwFQTBD4i1hZWijcj6ZhNIEOPAMIc7cy9v3oNAKWdabuMoWHbBSUxGtdm5ea35hSaCQIAR3XTzseREirrr844Gdd72q6z67/5cbell14QGTXjUzDsF4SXh4Y1CXvGecNhc0dPCZ8J9jhQo/KB0o8yvirM+B1Rm2EklxoTDwlq2ho0aNlccS3hIOJK2bMkPzJY5rXhTsZVbNyt1qh+Glu2ZpNJldzPJFDHiaBiss0qOAv1y2qK4JOQ+Wsff5fvj4jLEtYopjnHWsNB9P2oGv3vrZgYHykmhKDQ9e957DzTvwHfR876OPO/7GIJPcGlX/WslGPkQvVjVIofQvgXnV1XN2IWLbeh8zOuO7kv+/DMZeDuVMc1Bxw20LpT7Vrnn5B5S0qvpa9g/gN6sZC/W+XdLbd/+fVPp3w9iNHKgdXImZAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+gFAwAFKkpaLkIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAEklEQVQ4y2NgGAWjYBSMAggAAAQQAAGFP6pyAAAAAElFTkSuQmCC"
157-
}
158-
}
159-
},
160-
".+": {
147+
"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": {
161148
"type": "object",
162149
"required": ["name", "expectedPath", "src"],
163150
"properties": {
164151
"name": { "type": "string" },
152+
"id": {
153+
"type": "string",
154+
"description": "The ID of the texture used when making vanilla models."
155+
},
165156
"expectedPath": {
166157
"type": "string",
167158
"description": "The path in the resource pack that the models that reference this texture expect the texture to be at."
@@ -330,6 +321,7 @@
330321
"type": "string",
331322
"enum": [
332323
"bone",
324+
"struct",
333325
"camera",
334326
"locator",
335327
"text_display",
@@ -395,6 +387,7 @@
395387
"type": "string",
396388
"enum": [
397389
"bone",
390+
"struct",
398391
"camera",
399392
"locator",
400393
"text_display",
@@ -403,7 +396,8 @@
403396
]
404397
},
405398
"name": { "type": "string" },
406-
"uuid": { "type": "string" }
399+
"uuid": { "type": "string" },
400+
"parent": { "type": "string" }
407401
},
408402
"allOf": [
409403
{
@@ -436,23 +430,23 @@
436430
"scale": { "type": "number" },
437431
"configs": {
438432
"type": "object",
439-
"properties": {
440-
"default": {
433+
"patternProperties": {
434+
"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": {
441435
"$ref": "#/definitions/boneConfig"
442-
},
443-
"variants": {
444-
"type": "object",
445-
"patternProperties": {
446-
".+": {
447-
"$ref": "#/definitions/boneConfig"
448-
}
449-
}
450436
}
451437
}
452438
}
453439
}
454440
}
455441
},
442+
{
443+
"if": {
444+
"properties": {
445+
"type": { "const": "struct" }
446+
}
447+
},
448+
"then": {}
449+
},
456450
{
457451
"if": {
458452
"properties": {
@@ -775,6 +769,10 @@
775769
"type": "array",
776770
"description": "A list of node UUIDs that should be excluded / ignored when this variant is applied.",
777771
"items": { "type": "string" }
772+
},
773+
"is_default": {
774+
"type": "boolean",
775+
"description": "Whether or not this variant is the default variant."
778776
}
779777
}
780778
}

src/blueprintFormat.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export interface IBlueprintVariantJSON {
9797
* The list of bones that should be ignored when applying the Variant
9898
*/
9999
excluded_nodes: string[]
100+
/**
101+
* Whether or not this is the default Variant
102+
*/
103+
is_default?: true
100104
}
101105

102106
/**

src/components/blueprintSettingsDialog.svelte

Lines changed: 91 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts" context="module">
22
import { Valuable } from '../util/stores'
33
import { translate } from '../util/translation'
4-
import { resolveEnvVariables } from '../util/misc'
54
import { MINECRAFT_REGISTRY } from '../systems/minecraft/registryManager'
65
76
import Checkbox from './dialogItems/checkbox.svelte'
@@ -19,6 +18,7 @@
1918
import KoFiImage from '../assets/kofi_s_tag_white.webp'
2019
2120
import fontUrl from '../assets/MinecraftFull.ttf'
21+
import { resolvePath } from '../util/fileUtil'
2222
if (![...document.fonts.keys()].some(v => v.family === 'MinecraftFull')) {
2323
void new FontFace('MinecraftFull', fontUrl, {}).load().then(font => {
2424
document.fonts.add(font)
@@ -163,7 +163,19 @@
163163
}
164164
165165
function dataPackFolderChecker(value: string): { type: string; message: string } {
166-
value = resolveEnvVariables(value)
166+
let path: string
167+
try {
168+
path = resolvePath(value)
169+
} catch (e) {
170+
console.error(e)
171+
return {
172+
type: 'error',
173+
message: translate(
174+
'dialog.blueprint_settings.data_pack.error.folder_does_not_exist',
175+
),
176+
}
177+
}
178+
console.log(path)
167179
switch (true) {
168180
case value === '':
169181
return {
@@ -172,26 +184,26 @@
172184
'dialog.blueprint_settings.data_pack.error.no_folder_selected',
173185
),
174186
}
175-
case !fs.existsSync(value):
187+
case !fs.existsSync(path):
176188
return {
177189
type: 'error',
178190
message: translate(
179191
'dialog.blueprint_settings.data_pack.error.folder_does_not_exist',
180192
),
181193
}
182-
case !fs.statSync(value).isDirectory():
194+
case !fs.statSync(path).isDirectory():
183195
return {
184196
type: 'error',
185197
message: translate('dialog.blueprint_settings.data_pack.error.not_a_folder'),
186198
}
187-
case !fs.existsSync(PathModule.join(value, 'pack.mcmeta')):
199+
case !fs.existsSync(PathModule.join(path, 'pack.mcmeta')):
188200
return {
189201
type: 'error',
190202
message: translate(
191203
'dialog.blueprint_settings.data_pack.error.missing_pack_mcmeta',
192204
),
193205
}
194-
case !fs.existsSync(PathModule.join(value, 'data')):
206+
case !fs.existsSync(PathModule.join(path, 'data')):
195207
return {
196208
type: 'error',
197209
message: translate(
@@ -204,6 +216,19 @@
204216
}
205217
206218
function resourcePackFolderChecker(value: string): { type: string; message: string } {
219+
let path: string
220+
try {
221+
path = resolvePath(value)
222+
} catch (e) {
223+
console.error(e)
224+
return {
225+
type: 'error',
226+
message: translate(
227+
'dialog.blueprint_settings.resource_pack.error.folder_does_not_exist',
228+
),
229+
}
230+
}
231+
console.log(path)
207232
switch (true) {
208233
case value === '':
209234
return {
@@ -212,28 +237,28 @@
212237
'dialog.blueprint_settings.resource_pack.error.no_folder_selected',
213238
),
214239
}
215-
case !fs.existsSync(value):
240+
case !fs.existsSync(path):
216241
return {
217242
type: 'error',
218243
message: translate(
219244
'dialog.blueprint_settings.resource_pack.error.folder_does_not_exist',
220245
),
221246
}
222-
case !fs.statSync(value).isDirectory():
247+
case !fs.statSync(path).isDirectory():
223248
return {
224249
type: 'error',
225250
message: translate(
226251
'dialog.blueprint_settings.resource_pack.error.not_a_folder',
227252
),
228253
}
229-
case !fs.existsSync(PathModule.join(value, 'pack.mcmeta')):
254+
case !fs.existsSync(PathModule.join(path, 'pack.mcmeta')):
230255
return {
231256
type: 'error',
232257
message: translate(
233258
'dialog.blueprint_settings.resource_pack.error.missing_pack_mcmeta',
234259
),
235260
}
236-
case !fs.existsSync(PathModule.join(value, 'assets')):
261+
case !fs.existsSync(PathModule.join(path, 'assets')):
237262
return {
238263
type: 'error',
239264
message: translate(
@@ -246,6 +271,19 @@
246271
}
247272
248273
function advancedResourcePackFileChecker(value: string): { type: string; message: string } {
274+
let path: string
275+
try {
276+
path = resolvePath(value)
277+
} catch (e) {
278+
console.error(e)
279+
return {
280+
type: 'error',
281+
message: translate(
282+
'dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist',
283+
),
284+
}
285+
}
286+
console.log(path)
249287
switch (true) {
250288
case value === '':
251289
return {
@@ -254,14 +292,14 @@
254292
'dialog.blueprint_settings.advanced_resource_pack_file.error.no_file_selected',
255293
),
256294
}
257-
case !fs.existsSync(value):
295+
case !fs.existsSync(path):
258296
return {
259297
type: 'error',
260298
message: translate(
261299
'dialog.blueprint_settings.advanced_resource_pack_file.error.file_does_not_exist',
262300
),
263301
}
264-
case !fs.statSync(value).isFile():
302+
case !fs.statSync(path).isFile():
265303
return {
266304
type: 'error',
267305
message: translate(
@@ -274,6 +312,17 @@
274312
}
275313
276314
function jsonFileChecker(value: string): { type: string; message: string } {
315+
let path: string
316+
try {
317+
path = resolvePath(value)
318+
} catch (e) {
319+
console.error(e)
320+
return {
321+
type: 'error',
322+
message: translate('dialog.blueprint_settings.json_file.error.file_does_not_exist'),
323+
}
324+
}
325+
console.log(path)
277326
switch (true) {
278327
case value === '':
279328
return {
@@ -282,7 +331,7 @@
282331
'dialog.blueprint_settings.json_file.error.no_file_selected',
283332
),
284333
}
285-
case fs.existsSync(value) && !fs.statSync(value).isFile():
334+
case fs.existsSync(path) && !fs.statSync(path).isFile():
286335
return {
287336
type: 'error',
288337
message: translate('dialog.blueprint_settings.json_file.error.not_a_file'),
@@ -293,6 +342,19 @@
293342
}
294343
295344
function advancedResourcePackFolderChecker(value: string): { type: string; message: string } {
345+
let path: string
346+
try {
347+
path = resolvePath(value)
348+
} catch (e) {
349+
console.error(e)
350+
return {
351+
type: 'error',
352+
message: translate(
353+
'dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist',
354+
),
355+
}
356+
}
357+
console.log(path)
296358
switch (true) {
297359
case value === '':
298360
return {
@@ -301,14 +363,14 @@
301363
'dialog.blueprint_settings.advanced_resource_pack_folder.error.no_folder_selected',
302364
),
303365
}
304-
case !fs.existsSync(value):
366+
case !fs.existsSync(path):
305367
return {
306368
type: 'error',
307369
message: translate(
308370
'dialog.blueprint_settings.advanced_resource_pack_folder.error.folder_does_not_exist',
309371
),
310372
}
311-
case !fs.statSync(value).isDirectory():
373+
case !fs.statSync(path).isDirectory():
312374
return {
313375
type: 'error',
314376
message: translate(
@@ -321,6 +383,19 @@
321383
}
322384
323385
function zipChecker(value: string): { type: string; message: string } {
386+
let path: string
387+
try {
388+
path = resolvePath(value)
389+
} catch (e) {
390+
console.error(e)
391+
return {
392+
type: 'error',
393+
message: translate(
394+
'dialog.blueprint_settings.data_pack_zip.error.file_does_not_exist',
395+
),
396+
}
397+
}
398+
console.log(path)
324399
switch (true) {
325400
case value === '':
326401
return {
@@ -329,7 +404,7 @@
329404
'dialog.blueprint_settings.resource_pack_zip.error.no_file_selected',
330405
),
331406
}
332-
case fs.existsSync(value) && !fs.statSync(value).isFile():
407+
case fs.existsSync(path) && !fs.statSync(path).isFile():
333408
return {
334409
type: 'error',
335410
message: translate(

src/components/boneConfigDialog.svelte

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,12 @@
9595
bind:checked={glowing}
9696
/>
9797

98-
<Checkbox
99-
label={translate('dialog.bone_config.override_glow_color.title')}
100-
tooltip={translate('dialog.bone_config.override_glow_color.description')}
101-
bind:checked={overrideGlowColor}
98+
<ColorPicker
99+
label={translate('dialog.bone_config.glow_color.title')}
100+
tooltip={translate('dialog.bone_config.glow_color.description')}
101+
bind:value={glowColor}
102102
/>
103103

104-
{#if $overrideGlowColor}
105-
<ColorPicker
106-
label={translate('dialog.bone_config.glow_color.title')}
107-
tooltip={translate('dialog.bone_config.glow_color.description')}
108-
bind:value={glowColor}
109-
/>
110-
{/if}
111-
112104
<NumberSlider
113105
label={translate('dialog.bone_config.shadow_radius.title')}
114106
tooltip={translate('dialog.bone_config.shadow_radius.description')}

0 commit comments

Comments
 (0)