Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Sep 20, 2024
1 parent eb6d335 commit cd7dfdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
* Better controls system
* Simple source code reorganization
* Hit window options
* Options organization
* Options organization + better options system
* Customizable Main Menu + Scripted States
* Accuracy
12 changes: 3 additions & 9 deletions source/substates/PromptSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ class PromptSubState extends FlxSubState {
var callbackYes:Void->Void;
var 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) {
public function new(question:String, callbackYes:Void->Void, ?callbackNo:Void->Void) {
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 @@ -31,7 +25,7 @@ class PromptSubState extends FlxSubState {
questionTxt.scrollFactor.set();
add(questionTxt);

var btnYes:FlxButton = new FlxButton(0, box.height / 2 + 130, yesText, () -> {
var btnYes:FlxButton = new FlxButton(0, box.height / 2 + 130, Localization.get("yes", SaveData.settings.lang), () -> {
if (callbackYes != null)
callbackYes();
close();
Expand All @@ -42,7 +36,7 @@ class PromptSubState extends FlxSubState {
btnYes.label.screenCenter(XY);
add(btnYes);

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

0 comments on commit cd7dfdc

Please sign in to comment.