SaintsField icon indicating copy to clipboard operation
SaintsField copied to clipboard

[InfoBox] for Collections

Open Podden opened this issue 1 year ago • 1 comments

Is there a way to display ONE Infobox per Array, not ONE Infobox per Array element?

    [InfoBox("This is a box")]
    public RuntimePlatform[] platforms;

grafik

Podden avatar Aug 08 '24 11:08 Podden

Directly using on list/array will apply to every direct element of the list, this is a limit from Unity.

At this version, not yet. We need to add a new InfoBox of Playa version, like PlayaRichLabel vs RichLabel for array/list

TylerTemp avatar Aug 09 '24 08:08 TylerTemp

Hi, this feature has been implemented in 3.3.0. As it's a breaking changes, please read the changelog before upgrading.

using SaintsField.Playa;

[PlayaInfoBox("Please Note: special label like <icon=star.png/> only works for <color=lime>UI Toolkit</color> <color=red>(not IMGUI)</color> in InfoBox.")]
[PlayaBelowInfoBox("$" + nameof(DynamicFromArray))]  // callback
public string[] strings = {};

private string DynamicFromArray(string[] value) => value.Length > 0? string.Join("\n", value): "null";

public string dynamic;

[PlayaInfoBox("MethodWithButton")]
[Button("Click Me!")]
[PlayaBelowInfoBox("GroupExample", groupBy: "group")]
[PlayaBelowInfoBox("$" + nameof(dynamic), groupBy: "group")]
public void MethodWithButton()
{
}

[PlayaInfoBox("Method")]
[PlayaBelowInfoBox("$" + nameof(dynamic))]
public void Method()
{
}

image

TylerTemp avatar Aug 31 '24 17:08 TylerTemp

This issue is now closed as it's been implemented.

Please comment below if you still have this issue so I can open it again.

TylerTemp avatar Oct 06 '24 11:10 TylerTemp