Add confirmation dialog when generating a new Mac address

This is just to quickly patch over the horrible usability issue, while
not needing any new translated strings. Will make the confirmation box
nicer after the 1.13.x release process.
This commit is contained in:
Henrik Rydgård 2022-07-27 23:17:18 +02:00
parent 52fd811299
commit c1a96a550d

View file

@ -1637,7 +1637,17 @@ UI::EventReturn GameSettingsScreen::OnChangeproAdhocServerAddress(UI::EventParam
}
UI::EventReturn GameSettingsScreen::OnChangeMacAddress(UI::EventParams &e) {
g_Config.sMACAddress = CreateRandMAC();
auto n = GetI18NCategory("Networking");
auto di = GetI18NCategory("Dialog");
auto confirmScreen = new PromptScreen(
n->T("Change Mac Address"), di->T("Yes"), di->T("No"),
[&](bool success) {
if (success) {
g_Config.sMACAddress = CreateRandMAC();
}}
);
screenManager()->push(confirmScreen);
return UI::EVENT_DONE;
}