x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[UMG] Remove Widget isn't working when i press button.

Hey,

i have a Widget that represents my Singeplayer Game Creation Menu. I list the savegames there. I get all Savegames in the Construct node of the Singleplayer Menu and create a new Widget called "Savegame" for each. They are set as a child of a Vertical Box inside a Scrollbox. This all works fine.

Now my problem:

The Savegame Widget has a Button to delete the Savegame. This is working too, but i can't get the Widget removed from the Singleplayer Menu. Its only gone if i go out of the menu and go back in (so only if construct is called again).

For the button i tried several things. I used the remove from viewport node for the Savegame widget. I got the Parent of the widget and removed it child (self), but nothing is working. The Widget stays activ until i reload the Singleplayer Widget. Is there a method to reload a widget or why is the Savegame widget not disappearing?

The SaveGameWidget button Method:

savegame

And the Singeplayer Constuct Node:

singleplayer

Product Version: Not Selected
Tags:
more ▼

asked Aug 20 '14 at 12:10 PM in Blueprint Scripting

avatar image

eXi
6.8k 332 184 464

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

If you use Add Child, you need to get your Parent and call RemoveChild(self). In 4.5 there's just going to be a call you can make RemoveFromParent on any widget. Both these calls are separate from Add/Remove From Viewport, which is akin to saying, spawn this widget in a new window.

Cheers, Nick

more ▼

answered Aug 20 '14 at 12:49 PM

avatar image

Nick Darnell ♦♦ STAFF
6k 77 37 151

avatar image eXi Aug 20 '14 at 02:13 PM

Hey, thanks for the answer. Using GetParent->RemoveChild(self) alone without RemoveFroMViewport worked. I used both. I guess that's what you told me in your last sentence (my english isnt well enough to understand your last sentence :X) Anyway, thanks for the help!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This may have no bearing on your issue ... but I was just doing something like that. I used Add To Viewport and Removed From Viewport for the widget in GameState and that worked. Your calls to SaveGame probably should also be in GameState anyway. You can use an Interface Messenger function to send from your widget back to gamestate.

more ▼

answered Aug 20 '14 at 12:23 PM

avatar image

tomofnz
1.1k 46 47 87

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question