mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 02:29:51 +01:00
UI: Add a simple means of persisting data.
This commit is contained in:
1 parent
84d815768b
commit
f6772ec526
4 files changed
+31
-4
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#include <map>
|
||||
#include "base/display.h"
|
||||
#include "input/input_state.h"
|
||||
#include "input/keycodes.h"
|
||||
@@ -19,13 +20,23 @@ UIScreen::~UIScreen() {
|
||||
|
||||
void UIScreen::DoRecreateViews() {
|
||||
if (recreateViews_) {
|
||||
UI::PersistMap persisted;
|
||||
bool persisting = root_ != nullptr;
|
||||
if (persisting) {
|
||||
root_->PersistData(UI::PERSIST_SAVE, persisted);
|
||||
}
|
||||
|
||||
delete root_;
|
||||
root_ = 0;
|
||||
root_ = nullptr;
|
||||
CreateViews();
|
||||
if (root_ && root_->GetDefaultFocusView()) {
|
||||
root_->GetDefaultFocusView()->SetFocus();
|
||||
}
|
||||
recreateViews_ = false;
|
||||
|
||||
if (persisting) {
|
||||
root_->PersistData(UI::PERSIST_RESTORE, persisted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user