| 299 | } |
| 300 | |
| 301 | void ApplicationContentsLayout::LoadApplication(const u32 app_i) { |
| 302 | this->cnts_menu->ClearItems(); |
| 303 | this->app_idx = app_i; |
| 304 | |
| 305 | auto app_itm = pu::ui::elm::MenuItem::New(cfg::Strings.GetString(501)); |
| 306 | app_itm->SetColor(g_Settings.GetColorScheme().text); |
| 307 | app_itm->AddOnKey(std::bind(&ApplicationContentsLayout::DisplayApplicationInfo, this)); |
| 308 | this->cnts_menu->AddItem(app_itm); |
| 309 | |
| 310 | const auto &app = cnt::GetApplications().at(app_i); |
| 311 | u32 cnt_i = 0; |
| 312 | for(const auto &cnt_status: app.meta_status_list) { |
| 313 | std::string name; |
| 314 | if(cnt_status.meta_type == NcmContentMetaType_AddOnContent) { |
| 315 | const auto aoc_id = cnt::GetAddOnContentId(cnt_status.application_id); |
| 316 | name = cfg::Strings.GetString(263) + " " + std::to_string(aoc_id); |
| 317 | } |
| 318 | else if(cnt_status.meta_type == NcmContentMetaType_Patch) { |
| 319 | name = cfg::Strings.GetString(262); |
| 320 | } |
| 321 | else if(cnt_status.meta_type == NcmContentMetaType_Application) { |
| 322 | name = cfg::Strings.GetString(261); |
| 323 | } |
| 324 | else { |
| 325 | name = cfg::Strings.GetString(502); |
| 326 | } |
| 327 | |
| 328 | auto itm = pu::ui::elm::MenuItem::New(name); |
| 329 | itm->SetColor(g_Settings.GetColorScheme().text); |
| 330 | itm->AddOnKey(std::bind(&ApplicationContentsLayout::DisplayContentInfo, this, cnt_i)); |
| 331 | this->cnts_menu->AddItem(itm); |
| 332 | cnt_i++; |
| 333 | } |
| 334 | |
| 335 | g_MainApplication->LoadMenuData(true, app.cache.display_name, GetApplicationIcon(app.record.id), app.cache.display_author + ", v" + app.misc_data.display_version); |
| 336 | } |
| 337 | |
| 338 | } |
no test coverage detected