MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / optsRename_DefaultKey

Method optsRename_DefaultKey

Goldleaf/source/ui/ui_AccountLayout.cpp:75–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73 }
74
75 void AccountLayout::optsRename_DefaultKey() {
76 const auto name = ShowKeyboard(cfg::Strings.GetString(213), this->cur_prof_base.nickname, 10, sizeof(this->cur_prof_base.nickname) - 1);
77 if(!name.empty()) {
78 strcpy(this->cur_prof_base.nickname, name.c_str());
79 const auto rc = acc::EditUser([&](AccountProfileBase *prof_base, AccountUserData *_user_data) {
80 memcpy(prof_base, &this->cur_prof_base, sizeof(this->cur_prof_base));
81 });
82 if(R_SUCCEEDED(rc)) {
83 g_MainApplication->LoadMenuHead(cfg::Strings.GetString(212) + " " + name);
84 g_MainApplication->ShowNotification(cfg::Strings.GetString(214) + " \'" + name + "\'.");
85 }
86 else {
87 HandleResult(rc, cfg::Strings.GetString(215));
88 }
89 }
90 }
91
92 void AccountLayout::optsIcon_DefaultKey() {
93 const auto base_icon_path = GLEAF_PATH_USER_DATA_DIR "/" + util::FormatHex128(acc::GetSelectedUser()) + ".jpg";

Callers

nothing calls this directly

Calls 5

ShowKeyboardFunction · 0.85
EditUserFunction · 0.85
HandleResultFunction · 0.85
LoadMenuHeadMethod · 0.80
ShowNotificationMethod · 0.80

Tested by

no test coverage detected