UI: Make popups transition their button.

This commit is contained in:
Unknown W. Brackets committed 2017-03-21 18:45:49 -07:00
1 parent 4fb8ac96ce
commit 07d2b4fb46
7 files changed
+57 -11

No files matched your search

+2
View File
@@ -266,6 +266,8 @@ UI::EventReturn ControlMappingScreen::OnAutoConfigure(UI::EventParams &params) {
}
I18NCategory *km = GetI18NCategory("KeyMapping");
ListPopupScreen *autoConfList = new ListPopupScreen(km->T("Autoconfigure for device"), items, -1);
if (params.v)
autoConfList->SetPopupOrigin(params.v);
screenManager()->push(autoConfList);
return UI::EVENT_DONE;
}
+3 -1
View File
@@ -287,6 +287,8 @@ UI::EventReturn LogConfigScreen::OnLogLevel(UI::EventParams &e) {
auto logLevelScreen = new LogLevelScreen(dev->T("Log Level"));
logLevelScreen->OnChoice.Handle(this, &LogConfigScreen::OnLogLevelChange);
if (e.v)
logLevelScreen->SetPopupOrigin(e.v);
screenManager()->push(logLevelScreen);
return UI::EVENT_DONE;
}
@@ -294,7 +296,7 @@ UI::EventReturn LogConfigScreen::OnLogLevel(UI::EventParams &e) {
LogLevelScreen::LogLevelScreen(const std::string &title) : ListPopupScreen(title) {
int NUMLOGLEVEL = 6;
std::vector<std::string> list;
for(int i = 0; i < NUMLOGLEVEL; ++i) {
for (int i = 0; i < NUMLOGLEVEL; ++i) {
list.push_back(logLevelList[i]);
}
adaptor_ = UI::StringVectorListAdaptor(list, -1);
+4 -1
View File
@@ -792,7 +792,10 @@ void EmuScreen::CreateViews() {
UI::EventReturn EmuScreen::OnDevTools(UI::EventParams &params) {
releaseButtons();
screenManager()->push(new DevMenu());
DevMenu *devMenu = new DevMenu();
if (params.v)
devMenu->SetPopupOrigin(params.v);
screenManager()->push(devMenu);
return UI::EVENT_DONE;
}
+4
View File
@@ -1101,6 +1101,8 @@ UI::EventReturn GameSettingsScreen::OnLanguage(UI::EventParams &e) {
I18NCategory *dev = GetI18NCategory("Developer");
auto langScreen = new NewLanguageScreen(dev->T("Language"));
langScreen->OnChoice.Handle(this, &GameSettingsScreen::OnLanguageChange);
if (e.v)
langScreen->SetPopupOrigin(e.v);
screenManager()->push(langScreen);
return UI::EVENT_DONE;
}
@@ -1118,6 +1120,8 @@ UI::EventReturn GameSettingsScreen::OnPostProcShader(UI::EventParams &e) {
I18NCategory *gr = GetI18NCategory("Graphics");
auto procScreen = new PostProcScreen(gr->T("Postprocessing Shader"));
procScreen->OnChoice.Handle(this, &GameSettingsScreen::OnPostProcShaderChange);
if (e.v)
procScreen->SetPopupOrigin(e.v);
screenManager()->push(procScreen);
return UI::EVENT_DONE;
}
+5 -1
View File
@@ -379,7 +379,11 @@ void SavedataScreen::CreateViews() {
UI::EventReturn SavedataScreen::OnSavedataButtonClick(UI::EventParams &e) {
GameInfo *ginfo = g_gameInfoCache->GetInfo(screenManager()->getDrawContext(), e.s, 0);
screenManager()->push(new SavedataPopupScreen(e.s, ginfo->GetTitle()));
SavedataPopupScreen *popupScreen = new SavedataPopupScreen(e.s, ginfo->GetTitle());
if (e.v) {
popupScreen->SetPopupOrigin(e.v);
}
screenManager()->push(popupScreen);
// the game path: e.s;
return UI::EVENT_DONE;
}