mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
UI: Reset views when analog speed mapped.
This commit is contained in:
parent
3cb4207369
commit
f18c1a6e8f
2 changed files with 9 additions and 1 deletions
|
@ -93,6 +93,7 @@ GameSettingsScreen::GameSettingsScreen(const Path &gamePath, std::string gameID,
|
|||
: UIDialogScreenWithGameBackground(gamePath), gameID_(gameID), editThenRestore_(editThenRestore) {
|
||||
lastVertical_ = UseVerticalLayout();
|
||||
prevInflightFrames_ = g_Config.iInflightFrames;
|
||||
analogSpeedMapped_ = KeyMap::AxisFromPspButton(VIRTKEY_SPEED_ANALOG, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
bool GameSettingsScreen::UseVerticalLayout() const {
|
||||
|
@ -336,7 +337,7 @@ void GameSettingsScreen::CreateViews() {
|
|||
altSpeed2->SetZeroLabel(gr->T("Unlimited"));
|
||||
altSpeed2->SetNegativeDisable(gr->T("Disabled"));
|
||||
|
||||
if (KeyMap::AxisFromPspButton(VIRTKEY_SPEED_ANALOG, nullptr, nullptr, nullptr)) {
|
||||
if (analogSpeedMapped_) {
|
||||
PopupSliderChoice *analogSpeed = graphicsSettings->Add(new PopupSliderChoice(&iAlternateSpeedPercentAnalog_, 1, 1000, gr->T("Analog Alternative Speed", "Analog alternative speed (in %)"), 5, screenManager(), gr->T("%")));
|
||||
altSpeed2->SetFormat("%i%%");
|
||||
}
|
||||
|
@ -1412,6 +1413,12 @@ void GameSettingsScreen::dialogFinished(const Screen *dialog, DialogResult resul
|
|||
|
||||
RecreateViews();
|
||||
}
|
||||
|
||||
bool mapped = KeyMap::AxisFromPspButton(VIRTKEY_SPEED_ANALOG, nullptr, nullptr, nullptr);
|
||||
if (mapped != analogSpeedMapped_) {
|
||||
analogSpeedMapped_ = mapped;
|
||||
RecreateViews();
|
||||
}
|
||||
}
|
||||
|
||||
void GameSettingsScreen::RecreateViews() {
|
||||
|
|
|
@ -141,6 +141,7 @@ private:
|
|||
int prevInflightFrames_;
|
||||
bool enableReports_ = false;
|
||||
bool enableReportsSet_ = false;
|
||||
bool analogSpeedMapped_ = false;
|
||||
std::string shaderNames_[256];
|
||||
std::string searchFilter_;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue