From c371fde36adf963457b7dd11bfca14dfe1cd5d04 Mon Sep 17 00:00:00 2001 From: Tchips46 Date: Tue, 9 Jun 2026 15:41:12 +0900 Subject: [PATCH 1/2] feat(entity-inspector): show differents enum values as selectable list --- .../component-param-row.svelte | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/lib/components/Widget/entity-inspector/component-param-row.svelte b/src/lib/components/Widget/entity-inspector/component-param-row.svelte index d69081a..aa58512 100644 --- a/src/lib/components/Widget/entity-inspector/component-param-row.svelte +++ b/src/lib/components/Widget/entity-inspector/component-param-row.svelte @@ -2,6 +2,7 @@ import type { ComponentParamHandle } from '$lib/client/ecs'; import { Input } from '$lib/components/ui/input'; import { TristateSwitch } from '$lib/components/ui/tristate-switch'; + import { Select, SelectContent, SelectItem, SelectTrigger } from '$lib/components/ui/select'; interface Props { handle: ComponentParamHandle; @@ -23,7 +24,32 @@
{$param.name}
{#if $param.type === 'string'} - + {#if $param.enum} + + {:else} + + {/if} {:else if $param.type === 'number'} {:else if $param.type === 'boolean'} From 01b4a1158bb083d9087f4739a995183c7194e3ca Mon Sep 17 00:00:00 2001 From: Tchips46 Date: Tue, 9 Jun 2026 17:15:09 +0900 Subject: [PATCH 2/2] fix(select-content): scroll control --- .../Widget/entity-inspector/component-param-row.svelte | 2 +- src/lib/components/ui/select/select-content.svelte | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/components/Widget/entity-inspector/component-param-row.svelte b/src/lib/components/Widget/entity-inspector/component-param-row.svelte index aa58512..2733c64 100644 --- a/src/lib/components/Widget/entity-inspector/component-param-row.svelte +++ b/src/lib/components/Widget/entity-inspector/component-param-row.svelte @@ -37,7 +37,7 @@
No options
{/if} {:else} - {#if !!$param.enum.length} + {#if Object.keys($param.enum).length === 0} {#each Object.entries($param.enum) as [displayOpt, realOpt] (displayOpt)} {displayOpt} {/each} diff --git a/src/lib/components/ui/select/select-content.svelte b/src/lib/components/ui/select/select-content.svelte index ba64c87..36814d1 100644 --- a/src/lib/components/ui/select/select-content.svelte +++ b/src/lib/components/ui/select/select-content.svelte @@ -33,9 +33,7 @@ > {@render children?.()}