Show a message when no saves are there yet.

This commit is contained in:
Unknown W. Brackets 2015-06-28 18:30:22 -07:00
parent 7ce13694ec
commit 577beafeb3

View file

@ -279,6 +279,7 @@ void SavedataBrowser::Refresh() {
Add(new Spacer(1.0f));
I18NCategory *m = GetI18NCategory("MainMenu");
I18NCategory *s = GetI18NCategory("Savedata");
UI::LinearLayout *gl = new UI::LinearLayout(UI::ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
gl->SetSpacing(4.0f);
@ -310,6 +311,12 @@ void SavedataBrowser::Refresh() {
SavedataButton *b = gameList_->Add(savedataButtons[i]);
b->OnClick.Handle(this, &SavedataBrowser::SavedataButtonClick);
}
if (savedataButtons.empty()) {
ViewGroup *group = new LinearLayout(ORIENT_VERTICAL, new UI::LinearLayoutParams(UI::Margins(12, 0)));
group->Add(new TextView(s->T("None yet. Things will appear here after you save.")));
gameList_->Add(group);
}
}
UI::EventReturn SavedataBrowser::SavedataButtonClick(UI::EventParams &e) {