Skip to content

Commit

Permalink
Add NFC and serial number settings
Browse files Browse the repository at this point in the history
  • Loading branch information
XorTroll committed Nov 15, 2019
1 parent 8da3cd0 commit 7bf7fb9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions Common/Source/cfg/cfg_Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ namespace cfg
rec.name = entry.value("name", "");
rec.author = entry.value("author", "");
rec.version = entry.value("version", "");
rec.icon = entry.value("icon", "");

auto find = STL_FIND_IF(titles, tit, (tit.app_id == appid));
if(STL_FOUND(titles, find))
Expand Down
2 changes: 2 additions & 0 deletions LibraryAppletQMenu/RomFs/LangDefault.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
"set_wireless_lan": "Wireless LAN enabled",
"set_bluetooth": "Bluetooth enabled",
"set_usb_30": "USB 3.0 enabled",
"set_nfc": "NFC enabled (amiibo)",
"set_serial_no": "Console serial number",
"swkbd_console_nick_guide": "Enter new console nickname",
"set_enable_conf": "Do you want to enable it?",
"set_disable_conf": "Do you want to disable it?",
Expand Down
15 changes: 15 additions & 0 deletions LibraryAppletQMenu/Source/ui/ui_SettingsMenuLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ namespace ui
bool usb_30 = false;
setsysGetFlag(SetSysFlag_Usb30Enable, &usb_30);
this->PushSettingItem(cfg::GetLanguageString(config.main_lang, config.default_lang, "set_usb_30"), EncodeForSettings(usb_30), 10);
bool nfc = false;
setsysGetFlag(SetSysFlag_NfcEnable, &nfc);
this->PushSettingItem(cfg::GetLanguageString(config.main_lang, config.default_lang, "set_nfc"), EncodeForSettings(nfc), 11);
char serial[0x20] = {0};
setsysGetSerialNumber(serial);
this->PushSettingItem(cfg::GetLanguageString(config.main_lang, config.default_lang, "set_serial_no"), EncodeForSettings<std::string>(serial), -1);
}

void SettingsMenuLayout::PushSettingItem(std::string name, std::string value_display, int id)
Expand Down Expand Up @@ -236,6 +242,15 @@ namespace ui
setsysGetFlag(SetSysFlag_Usb30Enable, &usb_30);
setsysSetFlag(SetSysFlag_Usb30Enable, !usb_30);

reload_need = true;
break;
}
case 11:
{
bool nfc = false;
setsysGetFlag(SetSysFlag_NfcEnable, &nfc);
setsysSetFlag(SetSysFlag_NfcEnable, !nfc);

reload_need = true;
break;
}
Expand Down

0 comments on commit 7bf7fb9

Please sign in to comment.