Skip to content

Commit 6a91dba

Browse files
committed
Fix variants panel missing button and scrolling
1 parent 7614f61 commit 6a91dba

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

exporters/datapackExporter/exporter/datapackGen/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export function getScoreboard() {
1717
export function getTags() {
1818
return {
1919
new: 'aj.new',
20+
globalRigRoot: `aj.rig_root`,
2021
rigEntity: `aj.${G.NAMESPACE}.rig_entity`,
2122
rootEntity: `aj.${G.NAMESPACE}.root`,
2223
boneEntity: `aj.${G.NAMESPACE}.bone`,

exporters/datapackExporter/exporter/datapackGen/namespaceFolderGen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ export function generateNamespaceFolder() {
243243
summonTags.add(new NbtString(G.TAGS.new))
244244
summonTags.add(new NbtString(G.TAGS.rigEntity))
245245
summonTags.add(new NbtString(G.TAGS.rootEntity))
246+
summonTags.add(new NbtString(G.TAGS.globalRigRoot))
246247
summonNbt.set('Tags', summonTags)
247248

248249
const variantSummonFolder = functionsFolder

src/ui/ajVariantsPanel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ createBlockbenchMod(
6363
name: translate('animated_java.panels.variants.name'),
6464
icon: 'movie',
6565
expand_button: true,
66+
growable: true,
6667
condition: () =>
6768
Format === ajModelFormat && Mode.selected && Mode.selected.id === 'edit',
6869
svelteComponent: SvelteComponent,

src/ui/components/variantsPanel.svelte

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { Variant, VariantsContainer } from '../../variants'
44
import * as events from '../../events'
55
import { ajModelFormat } from '../../modelFormat'
6-
import { state, VARIANT_PANEL_MENU } from '../ajVariantsPanel'
6+
import { VARIANT_PANEL_MENU, addVariantAction } from '../ajVariantsPanel'
77
import { onDestroy } from 'svelte'
88
99
let variantsContainer: VariantsContainer | undefined
@@ -48,6 +48,11 @@
4848
<p>Loading...</p>
4949
</div>
5050
{:then}
51+
<!-- svelte-ignore a11y-click-events-have-key-events -->
52+
<div class="tool" on:click={e => addVariantAction.click(e)}>
53+
<div class="tooltip">Add Variant</div>
54+
<i class="fa_big icon fa fa-plus-circle" />
55+
</div>
5156
<div class="container" on:contextmenu|stopPropagation={e => VARIANT_PANEL_MENU.open(e)}>
5257
{#key update}
5358
{#if variantsContainer}
@@ -66,11 +71,12 @@
6671
<style>
6772
div.container {
6873
display: flex;
74+
flex-grow: 1;
6975
flex-direction: column;
76+
justify-content: flex-start;
7077
background-color: var(--color-back);
7178
align-items: stretch;
7279
overflow-y: auto;
73-
min-height: 10em;
74-
max-height: 20em;
80+
min-height: 8em;
7581
}
7682
</style>

src/ui/util/sveltePanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class SveltePanel extends Panel {
2525

2626
void pollPromise(() => document.querySelector(`#${mountId}`)).then(el => {
2727
this.instance = new options.svelteComponent({
28-
target: el.parentElement as any,
28+
target: el as any,
2929
props: options.svelteComponentProps,
3030
})
3131
})

0 commit comments

Comments
 (0)