mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-27 15:42:42 -04:00
Overlay: I forgot about pop_document()
This in turn fixes a bug that I was about to bother encounter about, smh
This commit is contained in:
@@ -135,8 +135,7 @@ Overlay::Overlay(OverlayProps props)
|
||||
: Document("res/rml/overlay.rml"),
|
||||
mOption(props.option),
|
||||
mValueMin(props.valueMin),
|
||||
mValueMax(props.valueMax),
|
||||
mOpenerDocument(props.openerDocument) {
|
||||
mValueMax(props.valueMax) {
|
||||
if (mDocument == nullptr) {
|
||||
return;
|
||||
}
|
||||
@@ -216,10 +215,7 @@ void Overlay::dismiss() {
|
||||
return;
|
||||
}
|
||||
mDismissed = true;
|
||||
if (mOpenerDocument != nullptr) {
|
||||
mOpenerDocument->Show();
|
||||
}
|
||||
hide();
|
||||
pop_document();
|
||||
}
|
||||
|
||||
void Overlay::reset_default() {
|
||||
|
||||
@@ -50,7 +50,6 @@ struct OverlayProps {
|
||||
Rml::String helpText;
|
||||
int valueMin = 0;
|
||||
int valueMax = 0;
|
||||
Rml::ElementDocument* openerDocument = nullptr;
|
||||
};
|
||||
|
||||
class Overlay : public Document {
|
||||
@@ -78,7 +77,6 @@ private:
|
||||
GraphicsOption mOption;
|
||||
int mValueMin = 0;
|
||||
int mValueMax = 0;
|
||||
Rml::ElementDocument* mOpenerDocument = nullptr;
|
||||
std::vector<std::unique_ptr<Component> > mComponents;
|
||||
bool mDismissed = false;
|
||||
};
|
||||
|
||||
@@ -214,17 +214,12 @@ protected:
|
||||
|
||||
private:
|
||||
void open_overlay() {
|
||||
auto* openerDocument = mRoot != nullptr ? mRoot->GetOwnerDocument() : nullptr;
|
||||
if (openerDocument != nullptr) {
|
||||
openerDocument->Hide();
|
||||
}
|
||||
auto& overlay = push_document(std::make_unique<Overlay>(OverlayProps{
|
||||
push_document(std::make_unique<Overlay>(OverlayProps{
|
||||
.option = mOption,
|
||||
.title = mTitle,
|
||||
.helpText = mHelpText,
|
||||
.valueMin = mValueMin,
|
||||
.valueMax = mValueMax,
|
||||
.openerDocument = openerDocument,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user