Announcement

Collapse
No announcement yet.

[4.9] Linking Widgets Together

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [4.9] Linking Widgets Together

    So I have a series of Widgets on a Canvas. These are for making various choices about building an engine. The next UI item should unlock when the previous item has had a selection. As a long linear list of choices.

    Currently our BaseWidget has a TArray<BaseWidget *> ElementsToUnlock But it cannot be populated from the Designer. None of the variable Widgets are available as a selection. This has lead to the design of a nasty chained EventGraph to just populate all the Elements (See Below of pictures). Is there a better way to do this?

    Click image for larger version

Name:	Capture_Widget_Design.PNG
Views:	1
Size:	228.6 KB
ID:	1161959

    Click image for larger version

Name:	Capture_Widget_Graph.PNG
Views:	1
Size:	402.8 KB
ID:	1161960

    #2
    Second this. Manually setting variables in the graph is super tedious.

    Something like Unity's drag-drop interface linking for widget variables in the designer would save our team a lot of time. At least being able to select widgets in the same BP with variable drop-down lists would be great.

    Comment


      #3
      You could loop through every child of your root widget and check to see if the current element == any of the types that you want to add to the array, and if so, add it.
      Marketplace Assets

      Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
      Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
      Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

      Comment


        #4
        Originally posted by Jamendxman3 View Post
        You could loop through every child of your root widget and check to see if the current element == any of the types that you want to add to the array, and if so, add it.
        That doesn't solve the problem though. Each Element unlocks either 1 or 2 of the next items along in the UI. So making a selection to List 1, unlocks List 2. Selecting an item in List 2 unlocks List 3 and it's partnered scroll bar etc. So I can't just iterate the types I want to add.

        Comment


          #5
          If you leave the children of each list active and de-active the list parent at start, is it not enough to just activate the list parents so their children also activate? (What I mean but this is each parent has an active/inactive state that greys out or shows all of their own children?

          Comment


            #6
            Maybe, I am not making it clear what the problem is. The current solution works, it's just ugly. With this huge Blueprint to populate all the references. I would want to be able to add them within the designer, see this picture:

            Click image for larger version

Name:	AddingElementsToTArray-Anonated.png
Views:	1
Size:	286.4 KB
ID:	1088565
            Attached Files

            Comment


              #7
              Right I see what you mean, that pick list widget is a lua thing, it looks like you should be able to do what you ask, but perhaps that Elements to Unlock array has some sort of type filtering in it?

              Comment


                #8
                Originally posted by Anadin View Post
                Right I see what you mean, that pick list widget is a lua thing, it looks like you should be able to do what you ask, but perhaps that Elements to Unlock array has some sort of type filtering in it?
                Do you know what variable type you would need to reference a widget within the same UMG widget? Widget, UserWidget, WidgetComponent, etc references don't seem to work. I do not have any filters on the asset browser drop-down.
                Last edited by MugenCity; 10-02-2015, 02:37 AM.

                Comment


                  #9
                  I assume the widget you are pointing to there is also a PickListWidget?

                  Comment


                    #10
                    Originally posted by Anadin View Post
                    I assume the widget you are pointing to there is also a PickListWidget?
                    The type doesn't matter. No type of our widgets populates the Asset drop down on Elements to Unlock. ElementsToUnlock is a TArray of ULuaWidgetClass*, which is the base class of all Widgets we use (Derives from UUserWidget).

                    Comment


                      #11
                      Can you go into the graph view and make an array of your widgets in there? as a Variable then change your luawidgetclass to take a variable?

                      Comment


                        #12
                        Hmm I can only add instanced widgets that way... I am not sure to be honest. It looks like it should work but it's certainly a bit odd.

                        Comment


                          #13
                          Originally posted by Anadin View Post
                          Can you go into the graph view and make an array of your widgets in there? as a Variable then change your luawidgetclass to take a variable?
                          What type did you use for the array? I gave making my variables on the BP instead of C++ but couldn't find a class that allowed for referencing in the designer. The arrays could be filled fine in the graph view.

                          I tried Widget references as well as the specific userwidget classes.
                          Last edited by MugenCity; 10-04-2015, 04:49 PM.

                          Comment

                          Working...
                          X