Announcement

Collapse
No announcement yet.

Closing UI resets checkbox/reverts it to unchecked?

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

    Closing UI resets checkbox/reverts it to unchecked?

    I press CAPS LOCK and it draws my new UI. I then check one of the checkboxes and it executes the console command assigned and draws some text on the screen to confirm.
    If I CAPS LOCK again, the UI closes... that's fine. But when I re-open the UI, the checkbox has reverted to unchecked.

    I've tried adding SetCheckedState -> to "checked" in the blueprint both before and after the functionality of the checkbox but to no avail.

    Anyone got any ideas? I've probably overlooked something simple.

    Thanks.
    And so is the Golden City blackened
    With each step you take in my Hall.
    Marvel at perfection, for it is fleeting.
    You have brought Sin to Heaven
    And doom upon all the world.

    #2
    How are you closing the UI?
    Logitech Wheel Plugin

    Comment


      #3
      Is there any possibility that you are changing the state of the checkbox on 'Event Construct'? And yes, how are you closing the UI?

      Edit: You said that you have tried setting the check state in the blueprint, so how are you accessing the widget? Are you casting?
      Last edited by Jamendxman3; 08-24-2015, 01:05 AM.
      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
        Would you mind adding Pictures of your Widget and Blueprints, which you use for this?
        Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

        My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
        (Including 100+ Pages Multiplayer Network Compendium to get you started.)

        Comment


          #5
          Originally posted by Jamendxman3 View Post
          Is there any possibility that you are changing the state of the checkbox on 'Event Construct'? And yes, how are you closing the UI?

          Edit: You said that you have tried setting the check state in the blueprint, so how are you accessing the widget? Are you casting?
          I think I'm in over my head here. :-/ I'm not a programmer and never dabbled in the UDK before. (Just started playing around with it for the Ark competition.)

          Event Construct is not linked to anything. (In the UI graph.)
          UI is closed using Remove From Parent (in the FirstPersonCharacter template project blueprint/graph.)
          In the graph for the UI, when the OnCheckStateChanged is called I "Set Is Checked" then "Execute Console Command" then "Print Text".

          In this image, in an attempt to figure things out, I made two checkboxes and played around with their output in different ways.
          http://i.imgur.com/hKP6YJu.jpg
          Both "work" but the checkboxes don't stay checked so I guess I'm closing the UI wrong or I need to read up on this (type?)casting stuff.
          Attached Files
          And so is the Golden City blackened
          With each step you take in my Hall.
          Marvel at perfection, for it is fleeting.
          You have brought Sin to Heaven
          And doom upon all the world.

          Comment


            #6
            My guess is you just spawn a new UI widget when you press caps lock instead of showing/adding the one that you created first.

            Comment


              #7
              There's your problem. Whenever you remove a widget from a parent and then add it back, it creates a new instance of the widget, so everything will be reset. Instead of removing and adding it back to the viewport, add the widget to viewport a single time. For example in the Post Begin Play of your character blueprint. Then whenever you want the Widget to be hidden/disabled, you need to set the widget's visibility to Hidden (use the Set Visibility node) and Disable the widget (use the Set Is Enabled node). And vice versa for when you want it to be visible/enabled.
              Logitech Wheel Plugin

              Comment


                #8
                Thank you very much for the guidance everyone.

                I moved the Create Widget block to be straight after the Begin Play function rather than after the key press event and the checkboxes appear to be working fine now.
                (The menu starts on the screen rather than waiting for the keypress so I'll have to fiddle around with it and figure that out. Disregard. Fixed it )

                Side-question, if anyone fancies answering it, is the blueprinting system a visual representation of the C++ that's happening in the background? Or is it something simpler?
                Last edited by DY357LX; 08-24-2015, 07:03 PM.
                And so is the Golden City blackened
                With each step you take in my Hall.
                Marvel at perfection, for it is fleeting.
                You have brought Sin to Heaven
                And doom upon all the world.

                Comment

                Working...
                X