Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions flixel/addons/ui/FlxUIPopup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -188,29 +188,20 @@ class FlxUIPopup extends FlxUISubState implements IFlxUIWidget
switch (id)
{
case FlxUITypedButton.CLICK_EVENT:
var str = "";
if (eventParams != null)
{
if ((eventParams[0] is String))
var buttonAmount:Int = Std.int(eventParams[0]);
if ((_parentState is IFlxUIState))
{
str = Std.string(eventParams[0]);
// This fixes a bug where the event was being sent to this popup rather than the state that created it
castParent().getEvent(CLICK_EVENT, this, buttonAmount, eventParams);
}

var buttonAmount:Int = Std.int(eventParams[0]);
if (str == "affirm" || str == "cancel" || str == "alt")
else
{
if ((_parentState is IFlxUIState))
{
// This fixes a bug where the event was being sent to this popup rather than the state that created it
castParent().getEvent(CLICK_EVENT, this, buttonAmount, eventParams);
}
else
{
// This is a generic fallback in case something goes wrong
FlxUI.event(CLICK_EVENT, this, buttonAmount, eventParams);
}
close();
// This is a generic fallback in case something goes wrong
FlxUI.event(CLICK_EVENT, this, buttonAmount, eventParams);
}
close();
}
}
super.getEvent(id, sender, data, eventParams);
Expand Down