Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed May 19, 2023
1 parent dab2425 commit c8706cf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
59 changes: 30 additions & 29 deletions flixel/addons/ui/FlxUI.hx
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
package flixel.addons.ui;

import flash.Lib;
import flash.display.BitmapData;
import flash.errors.Error;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.Lib;
import flixel.addons.ui.FlxUI.MaxMinSize;

import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.group.FlxSpriteGroup;
import flixel.system.FlxAssets;
import flixel.text.FlxText;
import flixel.ui.FlxBar;
import flixel.util.FlxArrayUtil;
import flixel.util.FlxColor;
import flixel.math.FlxPoint;
import flixel.util.FlxStringUtil;

import flixel.addons.ui.ButtonLabelStyle;
import flixel.addons.ui.FlxUI.Rounding;
import flixel.addons.ui.FlxUI.VarValue;
import flixel.addons.ui.FlxUIBar.FlxBarStyle;
import flixel.addons.ui.FlxUICursor.WidgetList;
import flixel.addons.ui.FlxUIDropDownMenu;
import flixel.addons.ui.BorderDef;
import flixel.addons.ui.FlxUILine.LineAxis;
import flixel.addons.ui.FlxUIRadioGroup.CheckStyle;
import flixel.addons.ui.FlxUITooltipManager.FlxUITooltipData;
import flixel.addons.ui.FlxUIBar;
import flixel.addons.ui.FlxUICursor;
import flixel.addons.ui.FlxUIDropDownMenu;
import flixel.addons.ui.FlxUIGroup;
import flixel.addons.ui.FlxUILine;
import flixel.addons.ui.FlxUIRadioGroup;
import flixel.addons.ui.FlxUITooltipManager;
import flixel.addons.ui.FontDef;
import flixel.addons.ui.interfaces.IEventGetter;
import flixel.addons.ui.interfaces.IFireTongue;
Expand All @@ -27,18 +39,7 @@ import flixel.addons.ui.interfaces.IFlxUIWidget;
import flixel.addons.ui.interfaces.IHasParams;
import flixel.addons.ui.interfaces.ILabeled;
import flixel.addons.ui.interfaces.IResizable;
import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.group.FlxSpriteGroup;
import flixel.system.FlxAssets;
import flixel.text.FlxText;
import flixel.ui.FlxBar.FlxBarFillDirection;
import flixel.util.FlxArrayUtil;
import flixel.util.FlxColor;
import flixel.math.FlxPoint;
import flixel.util.FlxStringUtil;

import openfl.Assets;
import openfl.text.TextFormat;
#if haxe4
Expand Down Expand Up @@ -132,17 +133,17 @@ class FlxUI extends FlxUIGroup implements IEventGetter
*/
private function _tongueSet(list:Array<FlxSprite>, tongue:IFireTongue):Void
{
for (fs in list)
for (sprite in list)
{
if ((fs is FlxUIGroup))
if (sprite is FlxTypedUIGroup)
{
var g:FlxUIGroup = cast(fs, FlxUIGroup);
_tongueSet(g.members, tongue);
final group:FlxTypedUIGroup<FlxSprite> = cast sprite;
_tongueSet(group.members, tongue);
}
else if ((fs is FlxUI))
else if (sprite is FlxUI)
{
var fu:FlxUI = cast(fs, FlxUI);
fu.tongue = tongue;
final ui:FlxUI = cast sprite;
ui.tongue = tongue;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion flixel/addons/ui/FlxUIGroup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ class FlxTypedUIGroup<T:FlxSprite> extends FlxTypedSpriteGroup<T> implements IFl
{
if (members == null || members.length == 0)
{
width = height = 0;
if (rect != null) rect.set();
return width = height = 0;
return;
}

var left:Float = Math.POSITIVE_INFINITY;
Expand Down
2 changes: 1 addition & 1 deletion flixel/addons/ui/FlxUITabMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class FlxUITabMenu extends FlxUIGroup implements IResizable implements IFlxUICli
return; // DO NOT ADD A GROUP TO ITSELF
}

if (!hasThis(g))
if (!contains(g))
{ // ONLY ADD IF IT DOESN'T EXIST
g.y = (_back.y - y);
add(g);
Expand Down

0 comments on commit c8706cf

Please sign in to comment.