mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Add a "quick-edit" button for the current server host/ip, if it's custom
This was requested by Majin on Discord, whose server changes IP regularly for some reason.
This commit is contained in:
1 parent
44140e5175
commit
e33fd29bd2
5 files changed
+84
-11
No files matched your search
@@ -1023,9 +1023,16 @@ void GameSettingsScreen::CreateNetworkingSettings(UI::ViewGroup *networkingSetti
|
||||
|
||||
networkingSettings->Add(new ItemHeader(n->T("Ad Hoc multiplayer")));
|
||||
|
||||
networkingSettings->Add(new ChoiceWithValueDisplay(&g_Config.sProAdhocServer, n->T("Change proAdhocServer Address"), I18NCat::NONE))->OnClick.Add([=](UI::EventParams &) {
|
||||
LinearLayout *serverRow = networkingSettings->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
|
||||
serverRow->SetSpacing(0.0f);
|
||||
serverRow->Add(new ChoiceWithValueDisplay(&g_Config.sProAdhocServer, n->T("Change proAdhocServer Address"), I18NCat::NONE, new LinearLayoutParams(1.0f)))->OnClick.Add([=](UI::EventParams &) {
|
||||
screenManager()->push(new AdhocServerScreen(&g_Config.sProAdhocServer, n->T("Ad hoc server address")));
|
||||
});
|
||||
if (AdhocServerNameIsCustom()) {
|
||||
serverRow->Add(new Choice(ImageID("I_EDIT_TEXT"), new LinearLayoutParams(ITEM_HEIGHT, ITEM_HEIGHT)))->OnClick.Add([this](UI::EventParams &) {
|
||||
AskToEditCurrentServer(GetRequesterToken(), screenManager());
|
||||
});
|
||||
}
|
||||
|
||||
static const char *relayModes[] = {"Auto", "Yes", "No"};
|
||||
PopupMultiChoice *relayModePopup = networkingSettings->Add(new PopupMultiChoice(&g_Config.iAdhocServerRelayMode, n->T("Try to use server-provided packet relay"), relayModes, 0, ARRAY_SIZE(relayModes), I18NCat::DIALOG, screenManager()));
|
||||
|
||||
Reference in new issue
Block a user