mirror of
https://github.com/huderlem/porymap.git
synced 2026-04-24 23:07:52 -05:00
Speed up opening maps with many warp events
This commit is contained in:
parent
a898791a70
commit
e1aaf3c18e
|
|
@ -336,10 +336,12 @@ public:
|
|||
QString getDestinationWarpID() const { return this->destinationWarpID; }
|
||||
|
||||
void setWarningEnabled(bool enabled);
|
||||
bool getWarningEnabled() const { return this->warningEnabled; }
|
||||
|
||||
private:
|
||||
QString destinationMap;
|
||||
QString destinationWarpID;
|
||||
bool warningEnabled = false;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -425,7 +425,11 @@ QSet<QString> WarpEvent::getExpectedFields() {
|
|||
}
|
||||
|
||||
void WarpEvent::setWarningEnabled(bool enabled) {
|
||||
WarpFrame * frame = static_cast<WarpFrame*>(this->getEventFrame());
|
||||
this->warningEnabled = enabled;
|
||||
|
||||
// Don't call getEventFrame here, because it may create the event frame.
|
||||
// If the frame hasn't been created yet then we have nothing else to do.
|
||||
auto frame = static_cast<WarpFrame*>(this->eventFrame.data());
|
||||
if (frame && frame->warning)
|
||||
frame->warning->setVisible(enabled);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -516,7 +516,7 @@ void WarpFrame::setup() {
|
|||
this->warning = new QPushButton(warningText, this);
|
||||
this->warning->setFlat(true);
|
||||
this->warning->setStyleSheet("color: red; text-align: left");
|
||||
this->warning->setVisible(false);
|
||||
this->warning->setVisible(this->warp->getWarningEnabled());
|
||||
l_vbox_warning->addWidget(this->warning);
|
||||
this->layout_contents->addLayout(l_vbox_warning);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user