Skip to content

Commit

Permalink
Oope
Browse files Browse the repository at this point in the history
  • Loading branch information
superpowers04 committed Jun 23, 2024
1 parent 253f527 commit ad8be4c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/se/objects/SENotification.hx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SENotification extends FlxGroup{
public function set_y(v){
for (member in members){
var member = cast(member,FlxObject);
member.y+=(-x)+v;
member.y+=(-y)+v;
}
return y=v;
}
Expand Down Expand Up @@ -79,7 +79,7 @@ class SENotification extends FlxGroup{
FlxTween.tween(this,{y:y},1,{startDelay:duration});
}else{
x=(direction==1 ? -bg.width : FlxG.width);
y=30;
y=600;
FlxTween.tween(this,{x:(direction==1?10:FlxG.width-(bg.width+10))},0.5);
FlxTween.tween(this,{x:x},0.5,{startDelay:duration,onComplete:function(_){
currentNotification=null;
Expand Down
54 changes: 54 additions & 0 deletions source/se/utilities/SEUIUtilities.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package se.utilities;

import flixel.group.FlxGroup;
import flixel.FlxObject;
import flixel.text.FlxText;
import flixel.addons.ui.FlxInputText;

@:publicFields @:structInit class SEUIPosition {
var x:Int = 10;
var y:Int = 10;
var spacingY:Int = 5;
var spacingX:Int = 5;
var objects:Array<Array<FlxObject>> = [];

}

class SEUIUtilities{
public static function addSpacedUI(group:Dynamic, objects:SEUIPosition){
if (group.add == null) throw('Expected FlxGroup, got ${Type.typeof(group)}');
var x = objects.x;
var y = objects.y;
var spacingX=objects.spacingX;
var spacingY=objects.spacingY;
for (i in 0...objects.objects.length){
var list = objects.objects[i];
if(list == null || list.length == 0){
y+=spacingY*2;
continue;
}
var currentHeight = 0;
var xOffset = 0;
var x = x;
for (i in 0...list.length){
var object = list[i];
if(object == null){
x+=spacingX;
continue;
}
object.x=x;
object.y=y;
if(currentHeight < object.height) currentHeight = Std.int(object.height);
var obj:Dynamic = object;
if(obj is FlxInputText) (cast(obj,FlxInputText)).fieldWidth -= xOffset;
// trace(x);
x+=Std.int(object.width+spacingX);
xOffset+=Std.int(object.width+spacingX);
group.add(object);
}

y+=currentHeight+spacingY;
}
}

}
2 changes: 1 addition & 1 deletion version.downloadMe
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
24.06.22.2242;
24.06.22.2248;
* Better Psych character support(Still kinda experimental but should be more stable)
* Fix some small errors
* Fix characters not loading due to using ID instead of folderName
Expand Down

0 comments on commit ad8be4c

Please sign in to comment.