• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.
CustomUI

Plugins + Scripts CustomUI

Download [<1 MB]

14mhz

Well-known member
Joined
Oct 23, 2024
Messages
256
Solutions
7
Reactions
1,913
14mhz submitted a new resource:

CustomUI - This is a plugin simple development tool.

※ Reporting bugs or issues will help me improve the plugin and help others.
CustomUI
● This .cs for plugin UI implementation library for developer.
● This library doesn't aim to offer something novel, but rather simplifies and standardizes components that are commonly implemented by developers.
● Of course...

Read more about this resource...
 
Hi 14MHz, I stumbled over a minor problem I cannot solve for now. I use a CustomUI.addSliderSimple Layout with an added Default button which itself is in a tab layout which will be reloaded on clicking on the tab. This will load the current value into the slider, which is great.
C#:
public static JSONStorableFloat erectionmorph1_min_JSON = new JSONStorableFloat("Penis Length Flaccid", 2.2f, -5.0f, 10.0f, false);

//Init value, min value, max value in the GUI
value = new float[][] {
             new float[] {erectionmorph1_min_JSON.val, erectionmorph1_min_JSON.min, erectionmorph1_min_JSON.max},
            ...

BaseLabelUI ui01 = CustomUI.addLabel(this, true, titleLabel).setTextFontSize(26).setBackgroundColor(Color.clear).setTextColor(Color.white);
ui01.setTextAlign(TextAnchor.MiddleLeft);

BaseSliderSimpleUI ui02 = CustomUI.addSliderSimple(this, true, name, _val[0], _val[1], _val[2]).setLabelTextWeight(0.0f).setSliderWeight(0.75f).setCallback(callbackEvent).register();
UIDynamicSlider u = ui02.uid as UIDynamicSlider;
if (u != null)
{
       u.defaultButtonEnabled = true;
       Transform btnTransform = u.transform.Find("DefaultValueButton");

       if (btnTransform != null)
       {
              RectTransform rt = btnTransform.GetComponent<RectTransform>();
              rt.anchoredPosition = new Vector2(-40f, 13f);
        }
}

In this situation, however, the default value is always overwritten with the current value as the slider is created. Do you have any idea how to make the default stick to the static default value of the JSONStorableFloat (2.2f in this case)? Thank you in advance for any help!!
 

Similar threads

Replies
14
Views
627
Back
Top Bottom