Skip to content

Commit

Permalink
More 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Blantados committed Mar 13, 2024
1 parent 78bd658 commit 2609add
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 71 deletions.
22 changes: 21 additions & 1 deletion source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,34 @@ class Main extends Sprite
fpsCounter = new FPS(10, 3, 0xFFFFFF);
addChild(fpsCounter);
Lib.current.stage.align = "tl";
Lib.current.stage.scaleMode = StageScaleMode.NO_SCALE;
Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL;
var daBool:Bool = FlxG.save.data.fps || FlxG.save.data.showFPS;
toggleFPS(daBool);
#end

#if CRASH_HANDLER
Lib.current.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onCrash);
#end

// shader coords fix
FlxG.signals.gameResized.add(function (w, h) {
if (FlxG.cameras != null) {
for (cam in FlxG.cameras.list) {
if (cam != null && cam.filters != null)
resetSpriteCache(cam.flashSprite);
}
}

if (FlxG.game != null)
resetSpriteCache(FlxG.game);
});
}

static function resetSpriteCache(sprite:Sprite):Void {
@:privateAccess {
sprite.__cacheBitmap = null;
sprite.__cacheBitmapData = null;
}
}

public static function dumpCache()
Expand Down
4 changes: 2 additions & 2 deletions source/luafiles/DeprecatedFunctions.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class DeprecatedFunctions

Lua_helper.add_callback(lua, "objectPlayAnimation", function(obj:String, name:String, forced:Bool = false, ?startFrame:Int = 0) {
//ModchartState.luaTrace("objectPlayAnimation is deprecated! Use playAnim instead", false, true); // i still use this
if(PlayState.instance.getLuaObject(obj,false) != null) {
PlayState.instance.getLuaObject(obj,false).animation.play(name, forced, false, startFrame);
if(LuaUtils.getObjectDirectly(obj) != null) {
LuaUtils.getObjectDirectly(obj).animation.play(name, forced, false, startFrame);
return true;
}

Expand Down
1 change: 1 addition & 0 deletions source/luafiles/TweenFunctions.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class TweenFunctions
Lua_helper.add_callback(lua, "doTweenZoom", function(tag:String, vars:String, value:Dynamic, duration:Float, ease:String) {
oldTweenFunction(tag, vars, {zoom: value}, duration, ease, 'doTweenZoom');
});

Lua_helper.add_callback(lua, "cancelTween", function(tag:String) {
LuaUtils.cancelTween(tag);
});
Expand Down
11 changes: 4 additions & 7 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3169,9 +3169,6 @@ class PlayState extends MusicBeatState
public var paused:Bool = false;
public var startedCountdown:Bool = false;
public var canPause:Bool = true;
public var spookyText:FlxText;
public var spookyRendered:Bool = false;
public var spookySteps:Int = 0;
public var nps:Int = 0;
public var maxNPS:Int = 0;

Expand Down Expand Up @@ -3213,22 +3210,22 @@ class PlayState extends MusicBeatState
paused = true;
pauseCameraEffects = true;

// 1 / 1000 chance for Gitaroo Man easter egg
if (FlxG.random.bool(0.1))
// I finally got tired with it
/*if (FlxG.random.bool(0.1))
{
cancelMusicFadeTween();
MusicBeatState.switchState(new states.GitarooPause());
}
else
{
{*/
if(FlxG.sound.music != null) {
FlxG.sound.music.pause();
vocals.pause();
}

isPaused = true;
openSubState(new substates.PauseSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
}
//}

#if desktop
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconP2.getCharacter());
Expand Down
2 changes: 1 addition & 1 deletion source/states/SecretState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SecretState extends MusicBeatState

lolText = new FlxText(0, 0, FlxG.width - 100, 32);
lolText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, CENTER);
lolText.text = "The version 1.7 update for BETADCIU Engine! Optimized the code for the engine a LOT and fixed some features that previously didn't work as intended. As always, I've also added some more lua stuff and made some more minor adjustments. \n\nMore BETADCIU Modpacks will be released soon! Hope you enjoy the update!";
lolText.text = "Here's version 1.8 of BETADCIU Engine! All hx files are now organized in folders like 0.7+ Psych so any code that breaks when porting from 0.6 to 0.7+ Psych will probably also need to be fixed for this version. Not sure what else broke along the way so I will be fixing and reuploading all existing modpacks.\n\nMore BETADCIU Modpacks will be released soon! Hope you enjoy the update!";
lolText.borderColor = FlxColor.BLACK;
lolText.borderSize = 3;
lolText.borderStyle = FlxTextBorderStyle.OUTLINE;
Expand Down
Loading

0 comments on commit 2609add

Please sign in to comment.