mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-01-17 14:28:30 +01:00
Emscripten: Remove blocking prompt functions
This commit is contained in:
parent
96dea30480
commit
1094cc9dc9
@ -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();
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user