Skip to content

Commit 12c04be

Browse files
SnaveSutitgitbutler-client
authored andcommitted
✨ Add Rig page to Blueprint settings
1 parent aa78e0b commit 12c04be

4 files changed

Lines changed: 73 additions & 29 deletions

File tree

src/dialogs/blueprintSettings/blueprintSettings.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import GeneralComponent from './pages/general.svelte'
1515
import MiscComponent from './pages/misc.svelte'
1616
import PluginComponent from './pages/plugin.svelte'
1717
import ResourcepackComponent from './pages/resourcepack.svelte'
18+
import RigComponent from './pages/rig.svelte'
1819

1920
const localize = createScopedTranslator('dialog.blueprint_settings')
2021

@@ -28,17 +29,25 @@ export function openBlueprintSettings() {
2829
label: localize('pages.general.title'),
2930
icon: 'settings',
3031
},
32+
resourcepack: {
33+
component: ResourcepackComponent,
34+
condition: () => Project.pluginMode.get() === false,
35+
label: localize('pages.resource_pack.title'),
36+
icon: 'image',
37+
},
3138
datapack: {
3239
component: DatapackComponent,
3340
condition: () => Project.pluginMode.get() === false,
3441
label: localize('pages.datapack.title'),
3542
icon: 'database',
3643
},
37-
resourcepack: {
38-
component: ResourcepackComponent,
39-
condition: () => Project.pluginMode.get() === false,
40-
label: localize('pages.resource_pack.title'),
41-
icon: 'image',
44+
rig: {
45+
component: RigComponent,
46+
label: localize('pages.rig.title'),
47+
icon: 'fa-person',
48+
condition: () =>
49+
Project.pluginMode.get() === false &&
50+
Project.animated_java.data_pack_export_mode !== 'none',
4251
},
4352
eventFunctions: {
4453
component: EventFunctionsComponent,

src/dialogs/blueprintSettings/pages/datapack.svelte

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { validateDataPackFolder, validateZipPath } from '../../../formats/blueprint/settings'
44
import BoxSelect from '../../../svelteComponents/sidebarDialogItems/boxSelect.svelte'
55
import Checkbox from '../../../svelteComponents/sidebarDialogItems/checkbox.svelte'
6-
import NumberSlider from '../../../svelteComponents/sidebarDialogItems/numberSlider.svelte'
76
import SelectFile from '../../../svelteComponents/sidebarDialogItems/selectFile.svelte'
87
import SelectFolder from '../../../svelteComponents/sidebarDialogItems/selectFolder.svelte'
98
import { createScopedTranslator } from '../../../util/lang'
@@ -15,16 +14,12 @@
1514
let animationSystem = $state(
1615
Project.animated_java.use_storage_for_animation ? 'storage' : 'functions'
1716
)
18-
let interpolationDuration = $state(Project.animated_java.interpolation_duration)
19-
let teleportationDuration = $state(Project.animated_java.teleportation_duration)
2017
let autoUpdateRigOrientation = $state(Project.animated_java.auto_update_rig_orientation)
2118
2219
onDestroy(() => {
2320
Project.animated_java.data_pack_export_mode = dataPackExportFormat
2421
Project.animated_java.data_pack = dataPackLocation
2522
Project.animated_java.use_storage_for_animation = animationSystem === 'storage'
26-
Project.animated_java.interpolation_duration = interpolationDuration
27-
Project.animated_java.teleportation_duration = teleportationDuration
2823
Project.animated_java.auto_update_rig_orientation = autoUpdateRigOrientation
2924
})
3025
</script>
@@ -71,24 +66,6 @@
7166
{/if}
7267

7368
{#if dataPackExportFormat !== 'none'}
74-
<NumberSlider
75-
label={translate('interpolation_duration.title')}
76-
description={translate('interpolation_duration.description')}
77-
bind:value={interpolationDuration}
78-
step={1}
79-
min={0}
80-
max={2147483647}
81-
/>
82-
83-
<NumberSlider
84-
label={translate('teleportation_duration.title')}
85-
description={translate('teleportation_duration.description')}
86-
bind:value={teleportationDuration}
87-
step={1}
88-
min={0}
89-
max={2147483647}
90-
/>
91-
9269
<Checkbox
9370
label={translate('auto_update_rig_orientation.title')}
9471
description={translate('auto_update_rig_orientation.description')}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<script lang="ts">
2+
import { onDestroy } from 'svelte'
3+
import Checkbox from '../../../svelteComponents/sidebarDialogItems/checkbox.svelte'
4+
import NumberSlider from '../../../svelteComponents/sidebarDialogItems/numberSlider.svelte'
5+
import { createScopedTranslator } from '../../../util/lang'
6+
7+
const localize = createScopedTranslator('dialog.blueprint_settings')
8+
9+
let interpolationDuration = $state(Project.animated_java.interpolation_duration)
10+
let teleportationDuration = $state(Project.animated_java.teleportation_duration)
11+
let useEntityStacking = $state(Project.animated_java.use_entity_stacking)
12+
13+
onDestroy(() => {
14+
Project.animated_java.interpolation_duration = interpolationDuration
15+
Project.animated_java.teleportation_duration = teleportationDuration
16+
Project.animated_java.use_entity_stacking = useEntityStacking
17+
})
18+
</script>
19+
20+
<NumberSlider
21+
label={localize('interpolation_duration.title')}
22+
description={localize('interpolation_duration.description')}
23+
bind:value={interpolationDuration}
24+
step={1}
25+
min={0}
26+
max={2147483647}
27+
/>
28+
29+
<NumberSlider
30+
label={localize('teleportation_duration.title')}
31+
description={localize('teleportation_duration.description')}
32+
bind:value={teleportationDuration}
33+
step={1}
34+
min={0}
35+
max={2147483647}
36+
/>
37+
38+
<Checkbox
39+
label={localize('use_entity_stacking.title')}
40+
description={localize('use_entity_stacking.description')}
41+
bind:value={useEntityStacking}
42+
/>

src/lang/en.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ animated_java:
114114
general.title: General
115115
resource_pack.title: Resource Pack
116116
datapack.title: Data Pack
117+
rig.title: Rig
117118
event_functions.title: Event Functions
118119
plugin.title: Plugin
119120
misc.title: Misc
@@ -325,7 +326,22 @@ animated_java:
325326
[Markdown]
326327
The default [teleport duration](https://minecraft.wiki/w/Display#Entity_data) of the rig.
327328
328-
Higher values make large movements smoother but less responsive.
329+
use_entity_stacking:
330+
title: Use Entity Stacking
331+
description: |-
332+
[Markdown]
333+
Whether or not to use entity stacking for the rig's bone entities.
334+
335+
When **enabled**:
336+
- All bone entities will be mounted on the root entity.
337+
- Bone rotations will be less precise. (limited to integer degrees)
338+
- Bone entities can be selected via `on passengers` when executing `as` the root entity.
339+
340+
When **disabled**:
341+
- Bone entities will not be mounted on the root entity.
342+
- Bone rotations will be *much* more precise, enabling much smoother movement when teleporting the rig around.
343+
- Bone entities cannot be selected via `on passengers`, but can still be accessed via `as_node`.
344+
329345
auto_update_rig_orientation:
330346
title: Auto Update Rig Orientation
331347
description: |-

0 commit comments

Comments
 (0)