Skip to content

Commit 067385d

Browse files
committed
SONG LIMITING YEAAAAAAAAAAAAAAAAHHHHHHHHH
1 parent a395d18 commit 067385d

File tree

15 files changed

+169
-139
lines changed

15 files changed

+169
-139
lines changed
636 Bytes
Binary file not shown.

source/Main.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class Main extends Sprite
106106
Lib.current.addChild(new Main());
107107
//Stolen from Psych Online. Thanks for making the next hour of my life not hell.
108108
Lib.current.addChild(new archipelago.console.SideUI());
109-
Lib.current.addChild(new objects.Nightlight());
109+
//Lib.current.addChild(new objects.Nightlight());
110110
}
111111

112112
@:dox(hide)

source/archipelago/APCategoryState.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class APCategoryState extends states.CategoryState {
2121
};
2222

2323
var quitFunc = function() {
24-
AP.disconnect_socket();
24+
try{AP.disconnect_socket();}
25+
catch(e){}
2526
states.ExitState.addExitCallback(function() {
2627
var restartProcess = new Process("Mixtape.exe", ["APDisconnectError", "restart"]);
27-
2828
});
2929
FlxG.switchState(new states.ExitState());
3030
};

source/archipelago/APConnectingSubState.hx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ class APConnectingSubState extends FlxSubState
2020

2121
override function create()
2222
{
23+
var bg = new FlxSprite();
24+
bg.makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
25+
bg.screenCenter();
26+
27+
2328
var connectingText = new FlxText(0, 0, 0, "Connecting...", 20);
2429
connectingText.color = FlxColor.WHITE;
2530

@@ -39,6 +44,8 @@ class APConnectingSubState extends FlxSubState
3944

4045
connectingText.y = backdrop.y + 5;
4146
cancelButton.y = connectingText.y + connectingText.height + 5;
47+
48+
add(bg);
4249

4350
for (item in [backdrop, connectingText, cancelButton])
4451
{

source/archipelago/APEntryState.hx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ typedef APOptions =
6464
var fakeTransWeight:Int;
6565
var shieldWeight:Int;
6666
var MHPWeight:Int;
67+
var song_limit:Int;
6768
}
6869

6970
enum ComboRank {
@@ -161,7 +162,8 @@ class APEntryState extends MusicBeatState
161162
tutorialWeight: 15,
162163
fakeTransWeight: 15,
163164
shieldWeight: 15,
164-
MHPWeight: 15
165+
MHPWeight: 15,
166+
song_limit: 320,
165167
}
166168
};
167169

@@ -311,7 +313,7 @@ class APEntryState extends MusicBeatState
311313
{
312314
if(!fileDialog.completed) return;
313315
lowFilterAmount = 0.0134;
314-
fileDialog.open(_slotInput.text, [new FileFilter('YAML', 'yaml')], function()
316+
/*fileDialog.open(_slotInput.text, [new FileFilter('YAML', 'yaml')], function()
315317
{
316318
FlxTween.num(0.0134, 1, 1, {ease: FlxEase.sineInOut}, function(t) {
317319
APEntryState.lowFilterAmount = t;
@@ -345,12 +347,13 @@ class APEntryState extends MusicBeatState
345347
gameSettings.FNF.MHPWeight = Std.parseInt(fnfData.get('MHPWeight'));
346348
gameSettings.FNF.accrequirement = fnfData.get('accrequirement');
347349
gameSettings.FNF.graderequirement = fnfData.get('graderequirement');
350+
gameSettings.FNF.song_limit = fnfData.get('song_limit');
348351
}
349352
catch(e:Exception)
350353
{
351354
trace(e.stack);
352355
}
353-
});
356+
});*/
354357
});
355358
yamlImport.x = (FlxG.width / 2) + 10 + yamlImport.width;
356359
yamlImport.y = yamlGen.y - 50;
@@ -472,10 +475,10 @@ class APEntryState extends MusicBeatState
472475
fullSongCount = slotData.fullSongCount;
473476
APInfo.ticketWinCount = slotData.ticketWinCount;
474477
APInfo.ticketCount = 0;
475-
FlxG.save.data.gradesandacc = [slotData.gradeNeeded, slotData.accuracyNeeded];
476-
FlxG.save.flush();
478+
APInfo.grabLimits(slotData.gradeNeeded, slotData.accuracyNeeded);
477479
APInfo.unlockMethod = slotData.locationType;
478480
//APInfo.unlockType = slotData.locationMethod;
481+
FlxG.save.flush();
479482
trace(APInfo.unlockMethod);
480483
closeSubState();
481484
inArchipelagoMode = true;
@@ -788,7 +791,9 @@ class APEntryState extends MusicBeatState
788791
+ "\nShield Weight: "
789792
+ gameSettings.FNF.shieldWeight
790793
+ "\nMax HP Weight: "
791-
+ gameSettings.FNF.MHPWeight;
794+
+ gameSettings.FNF.MHPWeight
795+
+ "\nSong Limit: "
796+
+ gameSettings.FNF.song_limit;
792797
} catch (e:Dynamic) {
793798
trace("Error updating bpmTxt: " + e);
794799
}

source/archipelago/APInfo.hx

Lines changed: 93 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package archipelago;
22

3+
import substates.RankingSubstate;
34
class APInfo {
45
public static var ap:Client;
56
public static var apGame:APGameState;
@@ -10,13 +11,46 @@ class APInfo {
1011
public static var unlockMethod:String = "Song Completion";
1112
public static var unlockType:String = "Per Song";
1213

13-
public static var hasNoteChecks(get, never):Bool;
14+
public static var accRankSetLimit:Int = 0;
15+
public static var comboRankSetLimit:Int = 0;
1416

17+
public static var hasNoteChecks(get, never):Bool;
1518
public static var hasSongChecks(get, never):Bool;
16-
1719
public static var hintPoints(get, never):Int;
1820
public static var hintCost(get, never):Int;
1921

22+
public static var gradeList:Array<String> =
23+
[
24+
'Any',
25+
"MFC",
26+
"SFC",
27+
"GFC",
28+
"AFC",
29+
"FC",
30+
"SDCB"
31+
];
32+
33+
public static var accuracyList:Array<String> =
34+
[
35+
"Any",
36+
"P",
37+
"X",
38+
"X-",
39+
"SS+",
40+
"SS",
41+
"SS-",
42+
"S+",
43+
"S",
44+
"S-",
45+
"A+",
46+
"A",
47+
"A-",
48+
"B",
49+
"C",
50+
"D",
51+
"E",
52+
];
53+
2054
// All things to escape when making song names.
2155
public static var YAMLEscapeMap:Map<String, String> = [
2256
"<cOpen>" => "{",
@@ -143,5 +177,62 @@ class APInfo {
143177
'Beat Battle 2'
144178
];
145179

180+
// TODO: Make this better lol
181+
public static function grabLimits(grade:String, accuracy:String) {
182+
switch (grade) {
183+
case 'Any':
184+
comboRankSetLimit = 0;
185+
case "MFC":
186+
comboRankSetLimit = 1;
187+
case "SFC":
188+
comboRankSetLimit = 2;
189+
case "GFC":
190+
comboRankSetLimit = 3;
191+
case "AFC":
192+
comboRankSetLimit = 4;
193+
case "FC":
194+
comboRankSetLimit = 5;
195+
case "SDCB":
196+
comboRankSetLimit = 6;
197+
}
198+
199+
switch (accuracy) {
200+
case "Any":
201+
accRankSetLimit = 0;
202+
case "P":
203+
accRankSetLimit = 1;
204+
case "X":
205+
accRankSetLimit = 2;
206+
case "X-":
207+
accRankSetLimit = 3;
208+
case "SS+":
209+
accRankSetLimit = 4;
210+
case "SS":
211+
accRankSetLimit = 5;
212+
case "SS-":
213+
accRankSetLimit = 6;
214+
case "S+":
215+
accRankSetLimit = 7;
216+
case "S":
217+
accRankSetLimit = 8;
218+
case "S-":
219+
accRankSetLimit = 9;
220+
case "A+":
221+
accRankSetLimit = 10;
222+
case "A":
223+
accRankSetLimit = 11;
224+
case "A-":
225+
accRankSetLimit = 12;
226+
case "B":
227+
accRankSetLimit = 13;
228+
case "C":
229+
accRankSetLimit = 14;
230+
case "D":
231+
accRankSetLimit = 15;
232+
case "E":
233+
accRankSetLimit = 16;
234+
}
235+
}
236+
146237

147238
}

source/archipelago/APPlayState.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,14 @@ class APPlayState extends PlayState {
220220
dad.shader = originalShaders.get(dad);
221221
if (gf != null) gf.shader = originalShaders.get(gf);
222222
blurEffect.setStrength(0, 0);
223-
camGamefilters.remove(filterMap.get("BlurLittle").filter);
223+
camGame.filters.remove(filterMap.get("BlurLittle").filter);
224224
};
225225
var playSound:String = "blur";
226226
var playSoundVol:Float = 0.7;
227227
var noIcon:Bool = false;
228228

229229
if (effectsActive["blur"] == null || effectsActive["blur"] <= 0) {
230-
camGamefilters.push(filterMap.get("BlurLittle").filter);
230+
camGame.filters.push(filterMap.get("BlurLittle").filter);
231231
if (PlayState.curStage.startsWith('school'))
232232
blurEffect.setStrength(2, 2);
233233
else
@@ -1047,7 +1047,7 @@ class APPlayState extends PlayState {
10471047
blurEffect.setStrength(32, 32);
10481048
}
10491049

1050-
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon, 'lowpass');
1050+
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon, true, 'lowpass');
10511051
},
10521052
'songSwitch' => function() {
10531053
// var haltTween:NumTween = new NumTween(null, null);

source/archipelago/APSettingsSubState.hx

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class APSettingsSubState extends MusicBeatSubstate {
3535
var fakeTransWeight:PsychUISlider;
3636
var shieldWeight:PsychUISlider;
3737
var MHPWeight:PsychUISlider;
38+
var songLimit:PsychUISlider;
3839
var gradientBar:FlxSprite;
3940
var dim:FlxSprite;
4041
public static function generateSongList() {
@@ -123,37 +124,8 @@ class APSettingsSubState extends MusicBeatSubstate {
123124
unlockType.list = ["Per Song", "Per Week"];
124125
unlockMethod.list = ["Note Checks", "Song Completion", "Both"];
125126

126-
gradeRequirement.list =
127-
[
128-
'Any',
129-
"MFC",
130-
"SFC",
131-
"GFC",
132-
"AFC",
133-
"FC",
134-
"SDCB"
135-
];
136-
137-
accRequirement.list =
138-
[
139-
"Any",
140-
"P",
141-
"X",
142-
"X-",
143-
"SS+",
144-
"SS",
145-
"SS-",
146-
"S+",
147-
"S",
148-
"S-",
149-
"A+",
150-
"A",
151-
"A-",
152-
"B",
153-
"C",
154-
"D",
155-
"E",
156-
];
127+
gradeRequirement.list = APInfo.gradeList;
128+
accRequirement.list = APInfo.accuracyList;
157129

158130
setDefaults();
159131

@@ -179,6 +151,7 @@ class APSettingsSubState extends MusicBeatSubstate {
179151
chartmodifierchance.value = APEntryState.gameSettings.FNF.chart_modifier_change_chance;
180152
shieldWeight.value = APEntryState.gameSettings.FNF.shieldWeight;
181153
MHPWeight.value = APEntryState.gameSettings.FNF.MHPWeight;
154+
songLimit.value = APEntryState.gameSettings.FNF.song_limit;
182155
}
183156

184157
function addMainSettings()
@@ -249,6 +222,9 @@ class APSettingsSubState extends MusicBeatSubstate {
249222
{
250223
APEntryState.gameSettings.FNF.mods_enabled = allowMods.checked;
251224
generateSongList();
225+
songLimit.max = globalSongList.length;
226+
if (songLimit.value > songLimit.max)
227+
songLimit.value = songLimit.max;
252228
});
253229

254230
objY += 50;
@@ -265,9 +241,18 @@ class APSettingsSubState extends MusicBeatSubstate {
265241
trace(id);
266242
});
267243

244+
objX -= 150;
245+
objY += 50;
246+
songLimit = new PsychUISlider(objX, objY, function(v:Float) APEntryState.gameSettings.FNF.song_limit = Std.int(v));
247+
songLimit.decimals = 0;
248+
songLimit.min = 5;
249+
songLimit.max = globalSongList.length;
250+
268251
tab_group.add(new FlxText(gradeRequirement.x, gradeRequirement.y - 15, 120, 'Grade Requirement:'));
269252
tab_group.add(new FlxText(accRequirement.x, accRequirement.y - 15, 120, 'Accuracy Requirement:'));
253+
tab_group.add(new FlxText(songLimit.x, songLimit.y - 15, 120, 'Song Limit:'));
270254
tab_group.add(allowMods);
255+
tab_group.add(songLimit);
271256
tab_group.add(accRequirement);
272257
tab_group.add(gradeRequirement);
273258
}
@@ -374,6 +359,9 @@ class APSettingsSubState extends MusicBeatSubstate {
374359
}
375360
}
376361

362+
// for that true random type beat
363+
FlxG.random.shuffle(APEntryState.gameSettings.FNF.songList);
364+
377365

378366
var mainSettings = {name: APEntryState.yamlName, description: APEntryState.gameSettings.description, game: APEntryState.gameSettings.game};
379367
var document = Yaml.render(mainSettings, Renderer.options().setFlowLevel(1));

source/debug/FPSCounter.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class FPSCounter extends TextField
185185

186186
if (ClientPrefs.data.performanceCounter.contains('mem'))
187187
{
188-
curMemory = _updateMemTimer >= 100.0 ? curMemory : obtainMemory();
188+
curMemory = _updateMemTimer >= 100.0 ? curMemory : MemoryUtil.currentMemUsage();
189189
if (curMemory >= maxMemory)
190190
maxMemory = curMemory;
191191
text += 'MEM: ${CoolUtil.formatMemory(Std.int(curMemory))}';
@@ -212,7 +212,7 @@ class FPSCounter extends TextField
212212

213213
function obtainMemory():Dynamic
214214
{
215-
return Math.abs(FlxMath.roundDecimal(System.totalMemory / 1000000, 1));
215+
return System.totalMemory;
216216
}
217217
// #end
218218

0 commit comments

Comments
 (0)