Skip to content

Commit

Permalink
yes
Browse files Browse the repository at this point in the history
  • Loading branch information
superpowers04 committed May 27, 2024
1 parent 62bef1a commit 96d1abb
Show file tree
Hide file tree
Showing 27 changed files with 378 additions and 181 deletions.
Binary file modified assets/preload/images/alphabet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions assets/preload/images/alphabet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
<SubTexture name=". bold0001" x="2" y="149" width="31" height="35"/>
<SubTexture name=". bold0002" x="35" y="149" width="31" height="35"/>
<SubTexture name=". bold0003" x="35" y="149" width="31" height="35"/> -->
<SubTexture name="-dash- bold0000" x="68" y="149" width="49" height="25"/>
<SubTexture name="-dash- bold0001" x="68" y="149" width="49" height="25"/>
<SubTexture name="-dash- bold0002" x="119" y="149" width="49" height="25"/>
<SubTexture name="-dash- bold0003" x="119" y="149" width="49" height="25"/>
<SubTexture name="- bold0000" x="68" y="149" width="49" height="25"/>
<SubTexture name="- bold0001" x="68" y="149" width="49" height="25"/>
<SubTexture name="- bold0002" x="119" y="149" width="49" height="25"/>
<SubTexture name="- bold0003" x="119" y="149" width="49" height="25"/>
<SubTexture name="-dash- bold0000" x="68" y="149" width="49" height="60"/>
<SubTexture name="-dash- bold0001" x="68" y="149" width="49" height="60"/>
<SubTexture name="-dash- bold0002" x="119" y="149" width="49" height="60"/>
<SubTexture name="-dash- bold0003" x="119" y="149" width="49" height="60"/>
<SubTexture name="- bold0000" x="68" y="149" width="49" height="60"/>
<SubTexture name="- bold0001" x="68" y="149" width="49" height="60"/>
<SubTexture name="- bold0002" x="119" y="149" width="49" height="60"/>
<SubTexture name="- bold0003" x="119" y="149" width="49" height="60"/>
<!-- <SubTexture name="-down arrow- bold0000" x="170" y="149" width="39" height="44"/>
<SubTexture name="-down arrow- bold0001" x="170" y="149" width="39" height="44"/>
<SubTexture name="-down arrow- bold0002" x="211" y="149" width="39" height="44"/>
Expand Down
Binary file added assets/shared/images/loadingIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion installDeps.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ haxelib run lime setup
haxelib install flixel-tools
haxelib install flixel-ui 2.6.0
haxelib install flixel-addons 3.2.2
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib git discord_rpc https://github.com/superpowers04/linc_discord-rpc
haxelib git linc_luajit https://github.com/superpowers04/linc_luajit
haxelib git flxanimate https://github.com/ShadowMario/flxanimate dev
2 changes: 1 addition & 1 deletion project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@

<!-- Expects https://github.com/superpowers04/linc_luajit, Nebula's fork will not work!-->
<haxelib name="linc_luajit" if="cpp" />
<!-- <haxelib name="discord_rpc" if="desktop cpp" /> -->
<haxelib name="discord_rpc" if="desktop cpp" />

<haxelib name="extension-androidtools" if="android" /> <!-- I am not reimplementing this shit myself -->

Expand Down
11 changes: 6 additions & 5 deletions source/AnimationDebug.hx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ class AnimationDebug extends MusicBeatState
}
try{
updateTxt();

super.create();
camGame = new FlxCamera();
camHUD = new FlxCamera();
camHUD.bgColor.alpha = 0;
Expand Down Expand Up @@ -265,7 +267,7 @@ class AnimationDebug extends MusicBeatState
stageFront.cameras = [camGame];
add(stageFront);

gf = new Character(400, 100, "gf",false,2,true);
gf = new Character(400, 100, "INTERNAL|gf",false,2,true);
gf.scrollFactor.set(0.90, 0.90);
gf.animation.finishCallback = function(name:String) gf.idleEnd(true);
gf.dance();
Expand All @@ -276,7 +278,7 @@ class AnimationDebug extends MusicBeatState
gf.alpha = 0.5;
gf.color = 0xA5004D;
}else{
bf = new Character((if(charType == 1) 100 else 790), 100, "bf",(charType == 0),charType,true);
bf = new Character((charType == 1 ? 100 : 790), 100, "INTERNAL|bf",(charType == 0),charType,true);
bf.scrollFactor.set(0.95, 0.95);
bf.dance();
bf.cameras = [camGame];
Expand Down Expand Up @@ -322,8 +324,8 @@ class AnimationDebug extends MusicBeatState

camGame.follow(camFollow);
updateTxt();
updateTxt();
spawnChar();
updateTxt();
if(chara == null)throw("Player object is null!");
if(charJson.clone != "" && charJson.clone != null){
showTempmessage('Older character loaded. Config has been reset!',FlxColor.RED);
Expand Down Expand Up @@ -357,7 +359,7 @@ class AnimationDebug extends MusicBeatState
add(offsetTopText);
add(contText);

quitHeldBG = new FlxSprite(0, 10).loadGraphic(Paths.image('healthBar','shared'));
quitHeldBG = new FlxSprite(0, 10).loadGraphic(SELoader.loadGraphic('assets/shared/images/healthBar.png',true));
quitHeldBG.screenCenter(X);
quitHeldBG.scrollFactor.set();
add(quitHeldBG);
Expand All @@ -369,7 +371,6 @@ class AnimationDebug extends MusicBeatState
quitHeldBar.createFilledBar(FlxColor.GRAY, FlxColor.LIME);
quitHeldBar.cameras = quitHeldBG.cameras = [camHUD];
add(quitHeldBar);
super.create();
updateTxt();
if(dragdrop)showTempmessage('Imported character $daAnim');
}catch(e) {MainMenuState.handleError('Error occurred, while loading Animation Debug. Current phase:${phases[phase]}; ${e.message}');}
Expand Down
19 changes: 9 additions & 10 deletions source/CharSelection.hx
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,22 @@ class CharSelection extends SearchMenuState
controlLabel.isMenuItem = true;
controlLabel.targetY = i;
if (i != 0) controlLabel.alpha = 0.6;
if(!isNameSpaced){

if(char[0].toLowerCase() == curChar){
curCharID = i;
controlLabel.color = FlxColor.GREEN;
trace('found at $i ${char[0]}/$curChar');
}else if(char[4] != null && char[4].getNamespacedName().toLowerCase() == curCharNameSpaced){
if(char[1] == 1){
controlLabel.color = FlxColor.RED;
}else if(!isNameSpaced){
if(char[4] != null && char[4].getNamespacedName().toLowerCase() == curCharNameSpaced){
curCharID = i;
isNameSpaced = true;
controlLabel.color = FlxColor.GREEN;
trace('found ns at $i ${char[0]}/$curChar');
}else if(char[0].toLowerCase() == curChar){
curCharID = i;
controlLabel.color = FlxColor.GREEN;
trace('found at $i ${char[0]}/$curChar');
}
}

if(char[1] == 1){
controlLabel.color = FlxColor.RED;
}

grpSongs.add(controlLabel);
}

Expand Down
90 changes: 57 additions & 33 deletions source/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import hscriptfork.InterpSE;


using StringTools;

class CharAnimController extends FlxAnimationController{
#if(flixel > "5.3.0")
override function findByPrefix(AnimFrames:Array<FlxFrame>, Prefix:String,logError:Bool = true):Void
Expand Down Expand Up @@ -610,12 +609,15 @@ class CharAnimController extends FlxAnimationController{
isCustom = true;
var charPropJson:String = "";
if(charInfo.internal){
charXml = Paths.xml(charInfo.internalAtlas);
if(frames == null) frames=tex=Paths.getSparrowAtlas(charInfo.internalAtlas);
charPropJson = charInfo.internalJSON;
try{
charProperties = Json.parse(CoolUtil.cleanJSON(charPropJson));
var p = SELoader.getRawPath("assets/shared/images/")+charInfo.internalAtlas; // This is to prevent loading custom bf for internal bf
charXml = SELoader.loadXML(p+".xml",true);
// trace('$charXml $p');
if(frames == null) frames=tex=FlxAtlasFrames.fromSparrow(SELoader.loadGraphic('$p.png',true),charXml);
// trace('$frames');
charProperties = Json.parse(charPropJson = charInfo.internalJSON);
}catch(e){
thrownError++;
MainMenuState.handleError(e,'Character ${curCharacter} is a hardcoded character and caused an error, Something went terribly wrong! ${e.message}');
return;
}
Expand Down Expand Up @@ -699,6 +701,7 @@ class CharAnimController extends FlxAnimationController{
animOffsets['all'] = [0.0,0.0];
}else{
if(curCharacter == "bf" || curCharacter == "gf"){
thrownError++;
MainMenuState.handleError('Character ${curCharacter} has no character json and is a hardcoded character, Something went terribly wrong!');
return;
}
Expand Down Expand Up @@ -780,7 +783,10 @@ class CharAnimController extends FlxAnimationController{


loadJSONChar(charProperties);
if(charInfo.internal){return trace('Finished loading hardcoded character: $curCharacter.');}
if(charInfo.internal){
trace('Finished loading hardcoded character: $curCharacter.');
return;
}
// Custom misses
if (charType == 0 && !amPreview && !debugMode){
switch(charProperties.custom_misses){
Expand Down Expand Up @@ -819,13 +825,16 @@ class CharAnimController extends FlxAnimationController{
e.hscriptGen = true;
return e;
}
var thrownError:Bool = false;
var thrownError:Int = 0;
var loaded:Bool=false;
public function handleError(error:String){
if(thrownError) return;
public function handleError(error:String,?pos:haxe.PosInfos){
thrownError++;
if(thrownError>1){
trace('$curCharacter Error $thrownError:$error');
return;
}
trace('$curCharacter:$error');
interp = null;
thrownError = true;
// if(!loaded){
// try{
// loaded=true;
Expand All @@ -839,7 +848,7 @@ class CharAnimController extends FlxAnimationController{
// PlayState.instance.errorHandle(error);
// // throw error;
// }else{
MainMenuState.handleError(error);
MainMenuState.handleError(error,pos);
// }
}

Expand All @@ -850,6 +859,7 @@ class CharAnimController extends FlxAnimationController{


public function new(?x:Float = 0, ?y:Float = 0, ?character:String = "", ?isPlayer:Bool = false,?charType:Int = 0,?preview:Bool = false,?exitex:FlxAtlasFrames = null,?charJson:CharacterJson = null,?useHscript:Bool = true,?charPath:String = "",?charInfo:Null<CharInfo> = null) { // CharTypes: 0=BF 1=Dad 2=GF
var part = "super call";
#if !debug
try{
#end
Expand All @@ -871,7 +881,7 @@ class CharAnimController extends FlxAnimationController{
if(charPath != "") charLoc = charPath;


if(curCharacter == "automatic" || curCharacter == "" || curCharacter == "bfHC" ) curCharacter = "bf";
if(curCharacter == "automatic" || curCharacter == "" || curCharacter == "bfHC" ) curCharacter = "INTERNAL|bf";

animation = new CharAnimController(this);

Expand All @@ -880,11 +890,12 @@ class CharAnimController extends FlxAnimationController{
definingColor = (preview ? definingColor : (charType == 1 ? FlxColor.RED : FlxColor.GREEN));

antialiasing = true;
part = "Loading Character";
loadChar();

dance();
if(frames == null){throw('$curCharacter is missing frames?');}
// var alloffset = animOffsets.get("all");

part = "Fake miss generation";
for (i in ['RIGHT','UP','LEFT','DOWN']) { // Add main animations over miss if miss isn't present
var miss = 'sing${i}miss';
if (animation.getByName(miss) == null){
Expand All @@ -894,46 +905,57 @@ class CharAnimController extends FlxAnimationController{
}
this.y += charY;
this.x += charX;
if (isPlayer && animation.getByName('singRIGHT') != null && flip && flipNotes) {
part = "Flipping sing animations";
if (isPlayer && flip && flipNotes) {
flipX = !flipX;

// var animArray
if(!charInfo.psychChar){ // Psych Characters aren't side dependant, SE characters use the same definitions for left and right
if(!(charInfo?.psychChar)
&& animation.getByName('singRIGHT') != null
&& animation.getByName('singLEFT') != null){ // Psych Characters don't use the same animation definitions for both sides, SE characters do

var oldRight = animation.getByName('singRIGHT').frames;
animation.getByName('singRIGHT').frames = animation.getByName('singLEFT').frames;
animation.getByName('singLEFT').frames = oldRight;

// IF THEY HAVE MISS ANIMATIONS??
var oldMissAnim = animation.getByName('singRIGHTmiss');
if (oldMissAnim != null) {
var oldMiss = oldMissAnim.frames;
animation.getByName('singRIGHTmiss').frames = animation.getByName('singLEFTmiss').frames;
animation.getByName('singLEFTmiss').frames = oldMiss;
var oldLeft = animation.getByName('singLEFT').frames;
if(oldRight != null && oldLeft != null){
animation.getByName('singRIGHT').frames = oldLeft;
animation.getByName('singLEFT').frames = oldRight;

// IF THEY HAVE MISS ANIMATIONS??
var oldMissRight = animation.getByName('singRIGHTmiss').frames;
var oldMissLeft = animation.getByName('singLEFTmiss').frames;
if (oldMissRight != null && oldMissLeft != null) {
animation.getByName('singRIGHTmiss').frames = oldMissLeft;
animation.getByName('singLEFTmiss').frames = oldMissRight;
}
}
}
}
part = "Dance";
dance();
part = "Calling interpeter New";

callInterp("new",[]);
if (animation.curAnim != null) setOffsets(animName); // Ensures that offsets are properly applied
part = "Animation callbacks";
animation.finishCallback = function(name:String){
animHasFinished = true;
callInterp("animFinish",[animation.curAnim]);
};
animation.callback = function(name:String,frameNumber:Int,frameIndex:Int){
callInterp("animFrame",[animation.curAnim,frameNumber,frameIndex]);
};

if(animation.curAnim == null && !lonely && !amPreview){throw('$curCharacter is missing an idle/dance animation!');}
part = "Finishing up";
if(animation.getByName('songStart') != null && !lonely && !amPreview) playAnim('songStart',true);
if(!charProperties.editableSprite){
// graphic.canBeDumped = true;
graphic.dump();
}
#if !debug
}catch(e){
}catch(e){

trace(e.details());
return handleError('Error with $curCharacter: ${e}');
return handleError('Error with $curCharacter at $part: ${e.details()}');

}
#end
Expand Down Expand Up @@ -1255,7 +1277,7 @@ class CharAnimController extends FlxAnimationController{
return (TitleState.retChar(char) != "");
}

public static var BFJSON(default,null):String = '{
public static var BFJSON(default,null):String = CoolUtil.cleanJSON('{
"embedded": true,
"path": "characters/BOYFRIEND",
"animations_offsets": [
Expand Down Expand Up @@ -1523,9 +1545,10 @@ class CharAnimController extends FlxAnimationController{
"flipx": false,
"indices": []
}
]
}';
public static var GFJSON(default,null) = '{
],
"editableSprite":true
}');
public static var GFJSON(default,null) = CoolUtil.cleanJSON('{
"animations_offsets": [
{
"player1": [0, 0],
Expand Down Expand Up @@ -1685,10 +1708,11 @@ class CharAnimController extends FlxAnimationController{
}
],
"embedded": true,
"editableSprite":true,
"path": "characters/GF_assets",
"color": "#A5004D",
"cam_pos3": [0, 0]
}';
}');


}
2 changes: 1 addition & 1 deletion source/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class CoolUtil {
}
@:keep inline public static function multiInt(?int:Int = 0) return (int==1?'':'s');

public static function cleanJSON(input:String):String{ // Haxe doesn't filter out comments?
@:keep inline public static function cleanJSON(input:String):String{ // Haxe doesn't filter out comments?
return (~/\/\*[\s\S]*?\*\/|\/\/.*/g).replace(input.trim(),'');
}
}
20 changes: 14 additions & 6 deletions source/FinishSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ class FinishSubState extends MusicBeatSubstate
cam = new FlxCamera();
FlxG.cameras.add(cam);
FlxG.cameras.setDefaultDrawTarget(cam,true);
add(PlayState.instance.remove(PlayState.bf));
add(PlayState.instance.remove(boyfriend));
FlxG.state.persistentUpdate = FlxG.state.persistentDraw = !pauseGame;

cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
// ready = true;
PlayState.bf.cameras=cameras;
PlayState.bf.scrollFactor.set(0,0);
PlayState.bf.x = 700;
PlayState.bf.y = 0;
boyfriend.cameras=cameras;
boyfriend.scrollFactor.set(0,0);
boyfriend.x = 700;
boyfriend.y = 0;
forceBFAnim = false;
}
}
Expand Down Expand Up @@ -542,7 +542,15 @@ class FinishSubState extends MusicBeatSubstate
#end

if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.S){saveScore(true);}
if (FlxG.keys.justPressed.R){if(win){FlxG.resetState();}else{restart();}}
if (FlxG.keys.justPressed.R){
// if(SESave.data.QuickReloading && !isError){
// PlayState.instance.restartSong();
// PlayState.instance.add(remove(PlayState.playerCharacter));
// close();
// return;
// }
if(win){FlxG.resetState();}else{restart();}
}
if (isError && FlxG.keys.justPressed.I){
PlayState.PSignoreScripts = true;
PlayState.scripts = [];
Expand Down
Loading

0 comments on commit 96d1abb

Please sign in to comment.