• Hi Guest!

    We have posted a new VaM2 dev log on Patreon, starting a monthly cadence of written progress updates between Beta releases. Highlights include the new Gizmos System, Selection Carousel, and Modes System with Context-Specific Editing. Beta1.2 is 15 of 21 items complete.

    Read the full post on Patreon, or follow progress on the public Trello roadmap.
CustomUI

Plugins + Scripts CustomUI

Download [<1 MB]
Crazy shit! very nice.

Btw could you help me on something? I'm failing to set a list with the addChooser that doesn't start with "None". Looking at the code, it seems that none of your "BaseChooserUI" are calling the methods with the List parameter sent to them. Which makes them always init with a null list, which as a result set the default value to "None".

Am I missing something?
 
Crazy shit! very nice.

Btw could you help me on something? I'm failing to set a list with the addChooser that doesn't start with "None". Looking at the code, it seems that none of your "BaseChooserUI" are calling the methods with the List parameter sent to them. Which makes them always init with a null list, which as a result set the default value to "None".

Am I missing something?
Please provide the code snippet.
 
Please provide the code snippet.

As simple as that :

C#:
//initialized in the class above
protected List<string>stylesList = new List<string>(){"Style01", "Style02"};

// in the UI main init
tab.add( CustomUI.addChooser(this, true, "Style", 1).setPopList(stylesList).setCallback((name, val) => { OnBubbleChanged(); }).register("GlobalOptBubbleType"));

I'm using your demo as the base to understand and learn your lib. I don't see any example not using a dropdown/select without the "None" in there.
 
As simple as that :

C#:
//initialized in the class above
protected List<string>stylesList = new List<string>(){"Style01", "Style02"};

// in the UI main init
tab.add( CustomUI.addChooser(this, true, "Style", 1).setPopList(stylesList).setCallback((name, val) => { OnBubbleChanged(); }).register("GlobalOptBubbleType"));

I'm using your demo as the base to understand and learn your lib. I don't see any example not using a dropdown/select without the "None" in there.
Try implementing it by adding setValue as shown below.
C#:
protected List<string>stylesList = new List<string>(){"Style01", "Style02"}; //initialized in the class above
// in the UI main init
tab.add( CustomUI.addChooser(this, true, "Style", 1).setPopList(stylesList).setValue(stylesList[0]).setCallback((name, val) => { OnBubbleChanged(); }).register("GlobalOptBubbleType"));
Since I always implement it this way, could it be that I don’t notice anything strange because of that? :rolleyes:
 
Since I always implement it this way, could it be that I don’t notice anything strange because of that? :rolleyes:

Maybe yeap! I suppose the ideal situation would be to have something like that :

C#:
tab.add( CustomUI.addChooser(this, true, "Style", 1, stylesList).setCallback((name, val) => { OnBubbleChanged(); }).register("GlobalOptBubbleType"));

Where you simply shoot the stylesList as a default parameter and it would grab the first one as the "defaultValue" sent to the JSONStringChooser. ( for both simple or normal choosers )
Not a deal breaker tho, I will use the setValue ^^

I just wanted to know if I was missing something. Thank you very much!
 

Similar threads

Back
Top Bottom