Skip to content

Commit f615e48

Browse files
committed
Merge branch 'AP-CustomEx' of https://github.com/Z11Coding/Mixtape-Engine-Rework into AP-CustomEx
2 parents bb38494 + c27a30f commit f615e48

File tree

6 files changed

+52
-36
lines changed

6 files changed

+52
-36
lines changed

source/backend/Paths.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class Paths
230230

231231
// The "If All Else Fails" option
232232
// The "If All Else Fails" option
233-
public static function nukeMemory(?useAlt:Bool = true){
233+
public static function nukeMemory(?useAlt:Bool = false){
234234
if (useAlt) {
235235
clearStoredWithoutStickers();
236236

source/games/uno/HandSwapSubstate.hx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ class HandSwapSubstate extends MusicBeatSubstate {
3838
private var shouldBeClosed:Bool = false;
3939

4040

41-
public function new(currentPlayer:UnoPlayer, availablePlayers:Array<UnoPlayer>, onPlayerSelected:UnoPlayer->Void, ?onPlayerCancel:UnoPlayer->Void) {
41+
public function new(currentPlayer:UnoPlayer, availablePlayers:Array<UnoPlayer>, onPlayerSelected:UnoPlayer->Void) {
4242
super();
4343
this.currentPlayer = currentPlayer;
4444
this.availablePlayers = availablePlayers.copy();
4545
this.onPlayerSelected = onPlayerSelected;
46-
this.onPlayerCancel = onPlayerCancel;
4746

4847
if (this.onPlayerCancel == null) {
4948
this.onPlayerCancel = function(_) {};
@@ -721,13 +720,11 @@ class HandSwapSubstate extends MusicBeatSubstate {
721720
}
722721
try {
723722
animateOut(function() {
724-
onPlayerCancel(currentPlayer);
725723
close();
726724
});
727725
} catch(e:Dynamic) {
728726
trace("Error in escape animateOut: " + e);
729727
try {
730-
onPlayerCancel(currentPlayer);
731728
close();
732729
} catch(e2:Dynamic) {
733730
trace("Error in escape close: " + e2);

source/objects/StrumNote.hx

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,17 @@ class StrumNote extends NoteObject
105105

106106
var skin:String = null;
107107
if(PlayState.SONG != null && PlayState.SONG.arrowSkin != null && PlayState.SONG.arrowSkin.length > 1) skin = PlayState.SONG.arrowSkin;
108-
else skin = Note.defaultNoteSkin;
109108

110-
if (Note.getNoteSkinPostfix() != '')
111-
{
112-
var customSkin:String = skin + Note.getNoteSkinPostfix();
113-
if(Paths.fileExists('images/$customSkin.png', IMAGE)) skin = customSkin;
114-
}
115-
else {
116-
var customSkin:String = 'NOTE_assets';
117-
skin = (PlayState.isPixelStage ? customSkin : 'noteSkins/strums');
109+
if (skin == null || skin == '') {
110+
if (Note.getNoteSkinPostfix() != '')
111+
{
112+
var customSkin:String = skin + Note.getNoteSkinPostfix();
113+
if(Paths.fileExists('images/$customSkin.png', IMAGE)) skin = customSkin;
114+
}
115+
else {
116+
var customSkin:String = (PlayState.SONG != null && PlayState.SONG.arrowSkin != null ? PlayState.SONG.arrowSkin : 'NOTE_assets') + Note.getNoteSkinPostfix();
117+
skin = (PlayState.isPixelStage ? customSkin : 'noteSkins/strums');
118+
}
118119
}
119120

120121
texture = skin; //Load texture and anims
@@ -128,29 +129,39 @@ class StrumNote extends NoteObject
128129
public function reloadNote()
129130
{
130131
var postfix:String = Note.getNoteSkinPostfix();
132+
var skin:String = texture + postfix;
133+
if (!PlayState.isPixelStage) {
134+
if(texture.length < 1 || skin == 'null')
135+
{
136+
skin = (PlayState.SONG != null ? PlayState.SONG.arrowSkin : (texture + postfix));
137+
if (skin == null || skin.length < 1) {
138+
if (postfix == null || postfix.length < 1)
139+
skin = "noteSkins/strums";
140+
else
141+
skin = "noteSkins/NOTE_assets" + postfix;
142+
}
143+
}
144+
}
145+
131146
if (PlayState.isPixelStage || postfix.toLowerCase() == '-retribution')
132147
useRGBShader = false;
133148

134149
var lastAnim:String = null;
135150
if(animation.curAnim != null) lastAnim = animation.curAnim.name;
136151
var pxDV:Int = Note.pixelNotesDivisionValue[1];
137152

138-
var ogSkin:String = texture;
139-
if (texture == 'noteSkins/NOTE_assets')
140-
texture = 'noteSkins/' + (PlayState.isPixelStage ? ogSkin : 'strums');
141-
142153
animationArray[0] = Note.keysShit.get(PlayState.mania).get('strumAnims')[column];
143154
animationArray[1] = Note.keysShit.get(PlayState.mania).get('letters')[column];
144155
animationArray[2] = Note.keysShit.get(PlayState.mania).get('letters')[column]; //jic
145156

146157
if(PlayState.isPixelStage)
147158
{
148-
loadGraphic(Paths.image('pixelUI/' + texture));
159+
loadGraphic(Paths.image('pixelUI/noteSkins/' + skin));
149160
pxDV = Note.pixelNotesDivisionValue[width == 306 ? 1 : 0];
150161
width = width / pxDV;
151162
height = height / 5;
152163
antialiasing = false;
153-
loadGraphic(Paths.image('pixelUI/' + texture), true, Math.floor(width), Math.floor(height));
164+
loadGraphic(Paths.image('pixelUI/noteSkins/' + skin), true, Math.floor(width), Math.floor(height));
154165
var daFrames:Array<Int> = Note.keysShit.get(PlayState.mania).get('pixelAnimIndex');
155166

156167
setGraphicSize(Std.int(width * PlayState.daPixelZoom * Note.pixelScales[PlayState.mania]));
@@ -163,7 +174,20 @@ class StrumNote extends NoteObject
163174
}
164175
else
165176
{
166-
frames = Paths.getSparrowAtlas(texture);
177+
var postfix:String = Note.getNoteSkinPostfix();
178+
var skin:String = texture + postfix;
179+
//trace("Skin: " + skin);
180+
if(texture.length < 1)
181+
{
182+
skin = (PlayState.SONG != null ? PlayState.SONG.arrowSkin : (texture + postfix));
183+
if (skin == 'noteSkins/NOTE_assets') {
184+
skin = "noteSkins/strums";
185+
}
186+
}
187+
188+
//trace("Skin: " + skin);
189+
190+
frames = Paths.getSparrowAtlas(skin);
167191
antialiasing = ClientPrefs.data.antialiasing;
168192
setGraphicSize(Std.int(width * Note.scales[PlayState.mania]));
169193

source/states/LoadingState.hx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ class LoadingState extends MusicBeatState
351351
if (stopMusic && FlxG.sound.music != null)
352352
FlxG.sound.music.stop();
353353

354-
MusicBeatState.allowNuke = false;
355-
356354
FlxG.camera.visible = false;
357355
MusicBeatState.switchState(target);
358356
transitioning = true;

source/states/PlayState.hx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ class PlayState extends MusicBeatState
539539

540540
override public function create()
541541
{
542-
543542
#if MULTITHREADED_LOADING
544543
// Due to the Main thread and Discord thread, we decrease it by 2.
545544
var threadCount:Int = Std.int(Math.max(1, LoadingState.getCPUThreadsCount() - #if DISCORD_ALLOWED 2 #else 1 #end));
@@ -5333,13 +5332,15 @@ class PlayState extends MusicBeatState
53335332

53345333
public function die(?trueKill:Bool = false, ?cod:String):Void
53355334
{
5336-
bfkilledcheck = true;
5337-
health = 0;
5338-
if (trueKill) lives = 0;
5339-
// else lives -= 1;
5340-
noteMissPress(3, opponentmode ? dadField : playerField); // just to make sure you actually die
5341-
if (cod != null || cod.trim() != "") backend.COD.COD.COD = cod;
5342-
doDeathCheck(true);
5335+
if (cod != null || cod.trim() != "") backend.COD.COD.COD = cod;
5336+
if (trueKill)
5337+
doDeathCheck(true);
5338+
else {
5339+
bfkilledcheck = true;
5340+
health = 0;
5341+
noteMissPress(3, opponentmode ? dadField : playerField); // just to make sure you actually die
5342+
doDeathCheck();
5343+
}
53435344
}
53445345

53455346
// the void varient of the function above with trueKill set to true
@@ -6594,7 +6595,6 @@ class PlayState extends MusicBeatState
65946595

65956596
LoadingState.noteCache = [];
65966597
curChart = [];
6597-
MusicBeatState.allowNuke = true;
65986598

65996599
ClientPrefs.openChartEditor();
66006600
}
@@ -7944,7 +7944,6 @@ class PlayState extends MusicBeatState
79447944
{
79457945
LoadingState.noteCache = [];
79467946
curChart = [];
7947-
MusicBeatState.allowNuke = true;
79487947
#if !switch
79497948
var percent:Float = comboManager.ratingPercent;
79507949
if(Math.isNaN(percent)) percent = 0;
@@ -10266,7 +10265,7 @@ class PlayState extends MusicBeatState
1026610265
modManager.setValue('transform${i}Y', offsetY, field.playerId);
1026710266
} else {
1026810267
// If the strum has been moved significantly, update the base position
10269-
trace('ModchartSync: Strum ${i} moved significantly (${Math.abs(offsetY)}px), updating base Y from ${baseY} to ${strumNote.y}');
10268+
//trace('ModchartSync: Strum ${i} moved significantly (${Math.abs(offsetY)}px), updating base Y from ${baseY} to ${strumNote.y}');
1027010269
field.updateBaseYPosition(i, strumNote.y);
1027110270
}
1027210271
//strumNote.y = strumNote.y;

source/substates/RankingSubstate.hx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class RankingSubstate extends MusicBeatSubstate
4141

4242
if (!PlayState.instance.cpuControlled)
4343
backend.Highscore.saveRank(PlayState.SONG.song, rankingNum, PlayState.storyDifficulty);
44-
45-
MusicBeatState.allowNuke = true;
4644
}
4745

4846
function getPauseSong()

0 commit comments

Comments
 (0)