Emscripten: Remove blocking prompt functions

This commit is contained in:
Tamás Bálint Misius 2023-02-12 09:28:55 +01:00
parent 96dea30480
commit 1094cc9dc9
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
6 changed files with 0 additions and 36 deletions

View File

@ -67,17 +67,6 @@ ConfirmPrompt::ConfirmPrompt(String title, String message, ResultCallback callba
MakeActiveWindow();
}
bool ConfirmPrompt::Blocking(String title, String message, String buttonText)
{
bool outputResult;
new ConfirmPrompt(title, message, {
[&outputResult] { outputResult = true; ui::Engine::Ref().Break(); },
[&outputResult] { outputResult = false; ui::Engine::Ref().Break(); },
}, buttonText);
EngineProcess();
return outputResult;
}
void ConfirmPrompt::OnDraw()
{
Graphics * g = GetGraphics();

View File

@ -16,6 +16,5 @@ public:
ConfirmPrompt(String title, String message, ResultCallback callback_ = {}, String buttonText = String("Confirm"));
virtual ~ConfirmPrompt() = default;
static bool Blocking(String title, String message, String buttonText = String("Confirm"));
void OnDraw() override;
};

View File

@ -46,14 +46,6 @@ ErrorMessage::ErrorMessage(String title, String message, DismissCallback callbac
MakeActiveWindow();
}
void ErrorMessage::Blocking(String title, String message)
{
new ErrorMessage(title, message, { [] {
ui::Engine::Ref().Break();
} });
EngineProcess();
}
void ErrorMessage::OnDraw()
{
Graphics * g = GetGraphics();

View File

@ -16,6 +16,5 @@ public:
ErrorMessage(String title, String message, DismissCallback callback_ = {});
virtual ~ErrorMessage() = default;
static void Blocking(String title, String message);
void OnDraw() override;
};

View File

@ -6,7 +6,6 @@
#include "gui/interface/Textbox.h"
#include "gui/Style.h"
#include "PowderToySDL.h"
#include "graphics/Graphics.h"
@ -76,19 +75,6 @@ TextPrompt::TextPrompt(String title, String message, String text, String placeho
MakeActiveWindow();
}
String TextPrompt::Blocking(String title, String message, String text, String placeholder, bool multiline)
{
String outputString;
new TextPrompt(title, message, text, placeholder, multiline, { [&outputString](String const &resultText) {
outputString = resultText;
ui::Engine::Ref().Break();
}, [](){
ui::Engine::Ref().Break();
}});
EngineProcess();
return outputString;
}
void TextPrompt::OnDraw()
{
Graphics * g = GetGraphics();

View File

@ -25,6 +25,5 @@ public:
TextPrompt(String title, String message, String text, String placeholder, bool multiline, TextDialogueCallback callback_ = {});
virtual ~TextPrompt() = default;
static String Blocking(String title, String message, String text, String placeholder, bool multiline);
void OnDraw() override;
};