1. Hello ! I have a strange problem.

    I have a Basic GUI :
    Code:
    [ 
                {
                    ""name"": ""XxxxxXXX"",
                    ""parent"": ""XXX/Xxxxxxx"",
                    ""components"":
                    [
                        {
                            ""xxxx"":""XxxxxXxxxxx.XX.XxxXxxxx"",
                            ""xxxxxxxxx"": ""Xxxxx"",
                            ""xxx"": ""xxxxxx.xxxx"",
                        },
                        { 
                            ""xxxx"":""XxxxXxxxxxxxx"",
                            ""xxxxxxxxx"": ""xxx xxx"",
                            ""xxxxxxxxx"": ""xxx xxx""
                        },
                        {
                            ""xxxx"":""XxxxxXxxxxx""
                        }
                    ]
                },
                {
                    ""name"": ""ButtonAgree-7214194"",
                    ""parent"": ""XxxxxXXX"",
                    ""components"":
                    [
                        {
                            ""type"":""UnityEngine.UI.Button"",
                            ""xxxxx"":""XxxxxXXX"",
                            ""xxxxx"": ""x.x x.x x.x x.x"",
                            ""xxxxxxxxx"": ""Xxxxx""
                        },
                        {
                           ""xxxx"":""XxxxXxxxxxxxx"",
                            ""xxxxxxxxx"": ""xxx xxx"",
                            ""xxxxxxxxx"": ""xxx xxx""
                        }
                    ]
                },
                {
                    ""parent"": ""ButtonAgree-7214194"",
                    ""components"":
                    [
                        {
                            ""xxxx"": ""UnityEngine.UI.Text"",
                            ""text"": ""Accepter"",
                            ""xxxxXxxx"": xx,
                            ""xxxxx"": ""XxxxxxXxxxxx""
                        }
                    ]
                }
            ]
    And i use "OnPlayerInit" for display this. But i have a ChatCommand for display Again this GUI and when i try, i have this strange error :

    [​IMG]

    Anyone know why?? It's work with "OnPlayerInit" but not with ChatCommand...
     
    Last edited by a moderator: Nov 9, 2015
  2. Afaik there is a bug which happens with buttons with text etc. That you can only have its name once. Once you initialized an UI with that name twice its nit going to work. You wikk need to add a Random String to the name.
     
  3. Thanks for reply @LaserHydra ! I must regenerate the Random String Name every time i want to display again?
     
  4. Wulf

    Wulf Community Admin

    The problem is that you're trying to add to a parent that doesn't exist. Unless you change the name of a GUI element, it uses a random ID, so you'd either need to store those IDs and grab them, or change the name of the element to something static.
     
  5. It's already static, i have put a random number directly on JSON for "ButtonAgree-7214194"
    [DOUBLEPOST=1447252484,1447189684][/DOUBLEPOST]
    Thanks for reply @LaserHydra ! I must regenerate the Random String Name every time i want to display again?
     
  6. Not sure. Propably. Try it.
    [DOUBLEPOST=1447253548][/DOUBLEPOST]
    @Wulf does the UI Helper do that itself? Not really, right?
     
  7. Wulf

    Wulf Community Admin

    The RustCui helper Oxide provide assigns a random GUID, but you can change it to a static name too.