Merge pull request #599 from craftersshaft/creffyspatches

fixed modcharts and added playActorAnimation
This commit is contained in:
Kade M 2021-05-27 11:57:15 -07:00 committed by GitHub
commit 2cec5ba7ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 10 deletions

View File

@ -412,6 +412,18 @@ Returns the width for the sprite id
Returns the height for the sprite id Returns the height for the sprite id
##### changeBoyfriendCharacter(string id)
Changes the Boyfriend sprite to another character
##### changeDadCharacter(string id)
Changes the Dad sprite to another character
##### playActorAnimation(string/int id, string anim, bool force, bool reverse)
Plays an animation on a sprite
### Tweens ### Tweens
*Note, On Complete functions are based by the function name (and they also well get called when the tween completes)* *Note, On Complete functions are based by the function name (and they also well get called when the tween completes)*
@ -440,14 +452,6 @@ Smoothly fade in to an alpha
Smoothly fade out to an alpha Smoothly fade out to an alpha
##### changeBoyfriendCharacter(string id)
Changes the Boyfriend sprite to another character
##### changeDadCharacter(string id)
Changes the Dad sprite to another character

View File

@ -527,6 +527,10 @@ class ModchartState
Lua_helper.add_callback(lua,"setActorX", function(x:Int,id:String) { Lua_helper.add_callback(lua,"setActorX", function(x:Int,id:String) {
getActorByName(id).x = x; getActorByName(id).x = x;
}); });
Lua_helper.add_callback(lua,"playActorAnimation", function(id:String,anim:String,force:Bool = false,reverse:Bool = false) {
getActorByName(id).playAnim(anim, force, reverse);
});
Lua_helper.add_callback(lua,"setActorAlpha", function(alpha:Float,id:String) { Lua_helper.add_callback(lua,"setActorAlpha", function(alpha:Float,id:String) {
getActorByName(id).alpha = alpha; getActorByName(id).alpha = alpha;

View File

@ -125,7 +125,7 @@ class PlayState extends MusicBeatState
private var curSong:String = ""; private var curSong:String = "";
private var gfSpeed:Int = 1; private var gfSpeed:Int = 1;
private var health:Float = 1; public var health:Float = 1; //making public because sethealth doesnt work without it
private var combo:Int = 0; private var combo:Int = 0;
public static var misses:Int = 0; public static var misses:Int = 0;
private var accuracy:Float = 0.00; private var accuracy:Float = 0.00;
@ -143,7 +143,7 @@ class PlayState extends MusicBeatState
private var generatedMusic:Bool = false; private var generatedMusic:Bool = false;
private var startingSong:Bool = false; private var startingSong:Bool = false;
public var iconP1:HealthIcon; //making these public for modcharts cause i dont know how else to do it public var iconP1:HealthIcon; //making these public again because i may be stupid
public var iconP2:HealthIcon; //what could go wrong? public var iconP2:HealthIcon; //what could go wrong?
public var camHUD:FlxCamera; public var camHUD:FlxCamera;
private var camGame:FlxCamera; private var camGame:FlxCamera;
@ -2831,6 +2831,7 @@ class PlayState extends MusicBeatState
if (controls.DOWN_P){luaModchart.executeState('keyPressed',["down"]);}; if (controls.DOWN_P){luaModchart.executeState('keyPressed',["down"]);};
if (controls.UP_P){luaModchart.executeState('keyPressed',["up"]);}; if (controls.UP_P){luaModchart.executeState('keyPressed',["up"]);};
if (controls.RIGHT_P){luaModchart.executeState('keyPressed',["right"]);}; if (controls.RIGHT_P){luaModchart.executeState('keyPressed',["right"]);};
if (controls.ACCEPT){luaModchart.executeState('keyPressed',["accept"]);};
}; };
#end #end