mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Fix a minor misbehavior with "non-added" adhoc server names
This commit is contained in:
@@ -394,12 +394,18 @@ void AdhocServerScreen::CreatePopupContents(UI::ViewGroup *parent) {
|
||||
CollapsibleSection *customSection = innerView->Add(new CollapsibleSection(n->T("Custom server list"), new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
|
||||
|
||||
if (!currentServerFound) {
|
||||
// Add a virtual entry.
|
||||
// Add the entry to one of the lists.
|
||||
AdhocServerListEntry entry;
|
||||
entry.name = editValue_;
|
||||
entry.host = editValue_;
|
||||
// Let's do a heuristic, we don't have a good value here..
|
||||
entry.mode = (AdhocServerRelayMode)g_Config.iAdhocServerRelayMode == AdhocServerRelayMode::AlwaysOn ? AdhocDataMode::AemuPostoffice : AdhocDataMode::P2P;
|
||||
if (entry.mode == AdhocDataMode::AemuPostoffice) {
|
||||
g_Config.vCustomAdhocServerListWithRelay.insert(g_Config.vCustomAdhocServerListWithRelay.begin(), editValue_);
|
||||
} else {
|
||||
g_Config.vCustomAdhocServerList.insert(g_Config.vCustomAdhocServerList.begin(), editValue_);
|
||||
}
|
||||
recreateParent_ = true;
|
||||
AddButtonFromEntry(customSection, entry, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ public:
|
||||
|
||||
const char *tag() const override { return "AdhocServer"; }
|
||||
|
||||
bool RecreateParent() const {
|
||||
return recreateParent_;
|
||||
}
|
||||
|
||||
protected:
|
||||
void OnCompleted(DialogResult result) override;
|
||||
bool CanComplete(DialogResult result) override;
|
||||
@@ -52,6 +56,7 @@ private:
|
||||
bool toResolveResult_ = false;
|
||||
std::string lastResolved_ = "";
|
||||
bool lastResolvedResult_ = false;
|
||||
bool recreateParent_ = false;
|
||||
};
|
||||
|
||||
void AskToEditCurrentServer(int requestToken, ScreenManager *screenManager);
|
||||
|
||||
@@ -1684,6 +1684,14 @@ void GameSettingsScreen::dialogFinished(const Screen *dialog, DialogResult resul
|
||||
}
|
||||
|
||||
bool recreate = false;
|
||||
|
||||
if (equals(dialog->tag(), "AdhocServer")) {
|
||||
const AdhocServerScreen *scr = dynamic_cast<const AdhocServerScreen *>(dialog);
|
||||
if (scr && scr->RecreateParent()) {
|
||||
recreate = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (result == DialogResult::DR_OK) {
|
||||
g_Config.iFpsLimit1 = iAlternateSpeedPercent1_ < 0 ? -1 : (iAlternateSpeedPercent1_ * 60) / 100;
|
||||
g_Config.iFpsLimit2 = iAlternateSpeedPercent2_ < 0 ? -1 : (iAlternateSpeedPercent2_ * 60) / 100;
|
||||
|
||||
Reference in New Issue
Block a user