MCPcopy Create free account
hub / github.com/XorTroll/uLaunch / ShowController

Function ShowController

projects/uMenu/source/ul/menu/ui/ui_Common.cpp:316–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314 }
315
316 void ShowController() {
317 std::vector<std::string> options = { GetLanguageString("controllers_entry_support") };
318 if(hosversionAtLeast(3,0,0)) {
319 options.push_back(GetLanguageString("controllers_entry_update"));
320 }
321 if(hosversionAtLeast(11,0,0)) {
322 options.push_back(GetLanguageString("controllers_entry_mapping"));
323 }
324 options.push_back(GetLanguageString("cancel"));
325
326 const auto option = g_MenuApplication->DisplayDialog(GetLanguageString("special_entry_text_controllers"), GetLanguageString("controllers_entry_info"), options, true);
327 switch(option) {
328 case 0: {
329 // Controller support is light enough that can be shown over ourselves (and by the looks of the applet UI, it's meant to)
330 HidLaControllerSupportArg arg;
331 hidLaCreateControllerSupportArg(&arg);
332
333 UpdateBackgroundBeforeLibraryAppletLaunch();
334 hidLaShowControllerSupportForSystem(nullptr, &arg, true);
335 break;
336 }
337 case 1: {
338 // Same for firmware update, it can be shown over ourselves
339 HidLaControllerFirmwareUpdateArg arg;
340 hidLaCreateControllerFirmwareUpdateArg(&arg);
341
342 UpdateBackgroundBeforeLibraryAppletLaunch();
343 // TODO: put an extra dialog? This jumps directly to the update screen
344 hidLaShowControllerFirmwareUpdateForSystem(&arg, HidLaControllerSupportCaller_System);
345 break;
346 }
347 case 2: {
348 g_MenuApplication->FadeOutToLibraryApplet(AppletId_LibraryAppletController);
349 u32 style_set;
350 UL_RC_ASSERT(hidGetSupportedNpadStyleSet(&style_set));
351 HidNpadJoyHoldType hold_type;
352 UL_RC_ASSERT(hidGetNpadJoyHoldType(&hold_type));
353 UL_RC_ASSERT(ul::menu::smi::OpenControllerKeyRemapping(style_set, hold_type));
354 g_MenuApplication->Finalize();
355 break;
356 }
357 }
358 }
359
360 void ShowWebPage() {
361 SwkbdConfig swkbd;

Callers 1

Calls 6

DisplayDialogMethod · 0.80
FinalizeMethod · 0.80
GetLanguageStringFunction · 0.70

Tested by

no test coverage detected