Skip to content

Commit

Permalink
jijijija
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Sep 20, 2024
1 parent 5e91612 commit eb6d335
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
7 changes: 0 additions & 7 deletions source/states/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ class ChartingState extends ExtendableState {
for (daSection in 0...song.notes.length)
song.notes[daSection].sectionNotes = [];
updateGrid();
closeSubState();
}, () -> {
closeSubState();
}));
});
add(clearSongButton);
Expand Down Expand Up @@ -242,10 +239,6 @@ class ChartingState extends ExtendableState {
+ "\n");
}

override function closeSubState() {
super.closeSubState();
}

function loadSong(daSong:String):Void {
if (FlxG.sound.music != null)
FlxG.sound.music.stop();
Expand Down
5 changes: 0 additions & 5 deletions source/states/OptionsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class OptionsState extends ExtendableState {
ExtendableState.resetState();
}, () -> {
FlxG.sound.play(Paths.sound('cancel'));
closeSubState();
}));
}

Expand All @@ -164,10 +163,6 @@ class OptionsState extends ExtendableState {
}
}

override function closeSubState() {
super.closeSubState();
}

private function changeSelection(change:Int = 0) {
FlxG.sound.play(Paths.sound('scroll'));
curSelected = FlxMath.wrap(curSelected + change, 0, options.length - 1);
Expand Down
26 changes: 20 additions & 6 deletions source/substates/PromptSubState.hx
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
package substates;

class PromptSubState extends FlxSubState {
public var question:String;
public var callbackYes:Void->Void;
public var callbackNo:Void->Void;
var question:String;
var callbackYes:Void->Void;
var callbackNo:Void->Void;

public function new(question:String, callbackYes:Void->Void, callbackNo:Void->Void) {
var yesText:String = Localization.get("yes", SaveData.settings.lang);
var noText:String = Localization.get("no", SaveData.settings.lang);

public function new(question:String, callbackYes:Void->Void, ?callbackNo:Void->Void, ?yesText:String, ?noText:String) {
super();

this.question = question;
this.callbackYes = callbackYes;
this.callbackNo = callbackNo;

if (yesText != null) this.yesText = yesText;
if (noText != null) this.noText = noText;

var width:Float = FlxG.width * 0.75;
var height:Float = FlxG.height * 0.5;

Expand All @@ -25,14 +31,22 @@ class PromptSubState extends FlxSubState {
questionTxt.scrollFactor.set();
add(questionTxt);

var btnYes:FlxButton = new FlxButton(0, box.height / 2 + 130, Localization.get("yes", SaveData.settings.lang), callbackYes);
var btnYes:FlxButton = new FlxButton(0, box.height / 2 + 130, yesText, () -> {
if (callbackYes != null)
callbackYes();
close();
});
btnYes.screenCenter(X);
btnYes.scale.set(2, 2);
btnYes.label.scale.set(2, 2);
btnYes.label.screenCenter(XY);
add(btnYes);

var btnNo:FlxButton = new FlxButton(0, btnYes.y + 50, Localization.get("no", SaveData.settings.lang), callbackNo);
var btnNo:FlxButton = new FlxButton(0, btnYes.y + 50, noText, () -> {
if (callbackNo != null)
callbackNo();
close();
});
btnNo.screenCenter(X);
btnNo.scale.set(2, 2);
btnNo.label.scale.set(2, 2);
Expand Down

0 comments on commit eb6d335

Please sign in to comment.