Skip to content

Commit 1e60d69

Browse files
committed
some adjustments
1 parent ab39c1a commit 1e60d69

File tree

6 files changed

+45
-24
lines changed

6 files changed

+45
-24
lines changed
4 Bytes
Binary file not shown.

source/archipelago/APGameState.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ class APGameState {
436436
}
437437
}
438438

439-
nonSongsNames.sort(function(a:String, b:String):Int {
439+
/*nonSongsNames.sort(function(a:String, b:String):Int {
440440
a = a.toUpperCase();
441441
b = b.toUpperCase();
442442
@@ -448,7 +448,7 @@ class APGameState {
448448
} else {
449449
return 0;
450450
}
451-
});
451+
});*/
452452

453453
trace(nonSongsNames);
454454

@@ -467,11 +467,11 @@ class APGameState {
467467
archipelago.APItem.createItemByName(items);
468468
}
469469
archipelago.APItem.doCheck();
470-
isSync = false;
471470

472471
trace("AP State Saving...");
473472
updateSaveData();
474473
}
474+
isSync = false;
475475
}
476476

477477
// A bandage fix till we have enough brainpower to fix this properly

source/archipelago/APItem.hx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ class APItem {
134134
return allItems.getItems().copy();
135135
}
136136

137-
public static function popup(desc:String):Void {
137+
public static function popup(desc:String, ?title:String, ?isWhite:Bool = false):Void {
138138
if (!APGameState.haventranyet) {
139-
archipelago.ArchPopup.startPopupCustom("AP Item!", desc, "archColor", function() {
139+
archipelago.ArchPopup.startPopupCustom(title != null ? title : "AP Item!", desc, isWhite ? "archWhite" : "archColor", function() {
140140
FlxG.sound.playMusic(Paths.sound('secret'));});
141141
}
142142
}
@@ -148,7 +148,7 @@ class APItem {
148148
// Check if shields are available
149149
if (shields > 0) {
150150
shields--;
151-
ArchPopup.startPopupCustom("Death Avoided!", 'Shields left: $shields', "archWhite");
151+
popup('Shields left: $shields', "Death Avoided!", true);
152152
return; // Do nothing else if shields are consumed
153153
}
154154

@@ -177,31 +177,39 @@ class APItem {
177177
case "Fake Transition":
178178
return new APItem(name, ConditionHelper.Special(), function() TransitionState.fakeTransition({transitionType:"transparent close"}), true, false);
179179
case "Ticket":
180-
return new APItem(name, ConditionHelper.Everywhere(), function() {popup("You got a ticket!");
180+
return new APItem(name, ConditionHelper.Everywhere(), function() {
181+
popup("One step closer...", "You got a ticket!");
181182
archipelago.APInfo.ticketCount++;
182183
}, true, true);
183184
case "SvC Effect":
184-
return new APItem(name, ConditionHelper.PlayState(), function() APPlayState.instance.doEffect(APPlayState.instance.effectArray[APPlayState.instance.curEffect]), true, false);
185+
return new APItem(name, ConditionHelper.PlayState(), function() {
186+
popup('Effect: ${APPlayState.instance.effectArray[APPlayState.instance.curEffect]}', "APItem: SvC Effect", true);
187+
APPlayState.instance.doEffect(APPlayState.instance.effectArray[APPlayState.instance.curEffect]);
188+
}, true, false);
185189
case "Ghost Chat":
186-
return new APItem(name, ConditionHelper.PlayState(), function() APPlayState.instance.triggerGhostChat(), true, false);
190+
return new APItem(name, ConditionHelper.PlayState(), function() {
191+
popup('May the chat be merciful on you...', "APItem: Ghost Chat", true);
192+
APPlayState.instance.triggerGhostChat();
193+
}, true, false);
187194
case "Shield":
188195
return new APItem(name, ConditionHelper.Everywhere(), function() {
189196
shields++;
190197
trace("Shield acquired! Current shields: " + shields);
191-
popup("You got a shield!");
198+
popup('Shields Left: $shields', "You got a shield!");
192199
}, true, true);
193200
case "Max HP Up":
194201
return new APItem(name, ConditionHelper.Everywhere(), function() {
195202
maxHPUp++;
196203
trace("Max HP increased! Current max HP: " + maxHPUp);
197-
popup("You got a max HP up!");
204+
popup('Current Max HP: +$maxHPUp', "You got a max HP up!");
198205
}, true, true);
199206
case "Tutorial Trap":
200207
return new APItem(name, ConditionHelper.PlayState(), function() {
201208
// Wait for PlayState's startedCountdown to become active
202209
haxe.Timer.delay(function checkCountdown() {
203210
var playState:archipelago.APPlayState = cast states.PlayState.instance;
204211
if (playState != null && playState.startedCountdown) {
212+
popup('Go relearn the basics', "APItem: Tutorial Trap");
205213
APPlayState.instance.doEffect('songSwitch');
206214
} else {
207215
// Retry after a short delay if countdown hasn't started
@@ -212,7 +220,7 @@ class APItem {
212220
default:
213221
throw "Unknown item name: " + name;
214222
}
215-
}
223+
}
216224

217225
public function trigger():Void {
218226
trace('is Gonna Run Sync: ${APGameState.isSync}');

source/backend/MusicBeatState.hx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,25 @@ class MusicBeatState extends FlxState
4949
super.create();
5050

5151
// if (backend.window.CppAPI.getWindowOpacity()!=1)
52-
FlxTween.num(0, 1, 0.5, {
53-
ease: FlxEase.sineInOut,
54-
onComplete: function(tween:FlxTween)
52+
if (emergencyOpacityFix) {
53+
CppAPI.setWindowOppacity(1);
54+
}
55+
56+
if (firstRun) {
57+
FlxTween.num(0, 1, 0.5, {
58+
ease: FlxEase.sineInOut,
59+
onComplete: function(tween:FlxTween)
60+
{
61+
#if cpp
62+
backend.window.CppAPI.setWindowOpacity(1);
63+
#end
64+
firstRun = false;
65+
}
66+
}, function(num)
5567
{
56-
#if cpp
57-
backend.window.CppAPI.setWindowOpacity(1);
58-
#end
59-
}
60-
}, function(num)
61-
{
62-
CppAPI.setWindowOpacity(num);
63-
});
68+
CppAPI.setWindowOpacity(num);
69+
});
70+
}
6471

6572
if (!skip)
6673
{
@@ -94,6 +101,8 @@ class MusicBeatState extends FlxState
94101
}
95102
}
96103

104+
public static var firstRun:Bool = true;
105+
public static var emergencyOpacityFix:Bool = false;
97106
public function initPsychCamera():PsychCamera
98107
{
99108
var camera = new PsychCamera();

source/backend/TransitionState.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package backend;
22

3+
import archipelago.ArchPopup;
34
import backend.window.CppAPI;
45
import flixel.FlxState;
56
import flixel.tweens.FlxTween;
@@ -477,6 +478,7 @@ class TransitionState {
477478
// Start processing with the first object
478479
processNextObject();
479480
case 'transparent fade':
481+
MusicBeatState.emergencyOpacityFix = true;
480482
FlxTween.num(1, 0, 2, {ease: FlxEase.sineInOut, onComplete:
481483
function(twn:FlxTween)
482484
{
@@ -497,12 +499,14 @@ class TransitionState {
497499
{
498500
FlxG.sound.play(Paths.music('gameOverEnd'));
499501
}
502+
MusicBeatState.emergencyOpacityFix = true;
500503
if (ClientPrefs.data.flashing) FlxG.camera.flash(FlxColor.WHITE, 2);
501504
FlxTween.num(1, 0, 2, {ease: FlxEase.sineInOut, onComplete:
502505
function(twn:FlxTween)
503506
{
504507
restoreSprites();
505508
CppAPI.setWindowOppacity(1);
509+
ArchPopup.startPopupCustom('APItem: Fake Transition', "Gotcha!", "ArchWhite");
506510
}},
507511
function(num)
508512
{

source/states/FreeplayState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class FreeplayState extends MusicBeatState
131131
Cursor.cursorMode = Default;
132132
instance = this; // For Archipelago
133133

134-
if (APEntryState.apGame != null && APEntryState.apGame.info() != null && APEntryState.gonnaRunSync) {
134+
if (APEntryState.apGame != null && APEntryState.apGame.info() != null) {
135135
APEntryState.apGame.info().Sync();
136136
APEntryState.gonnaRunSync = false;
137137

0 commit comments

Comments
 (0)