| 80 | |
| 81 | // Login display |
| 82 | |
| 83 | Control* DisplayLogin::OnCreateCtrl(int type, int idc, const ParamEntry& cls) |
| 84 | { |
| 85 | if (idc == IDC_LOGIN_USER) |
| 86 | { |
| 87 | // CCombo *combo = new CCombo(this, idc, cls); |
| 88 | C3DListBox* ctrl = new C3DListBox(this, idc, cls); |
| 89 | |
| 90 | auto profiles = ProfileManager::EnumerateProfiles(GamePaths::Instance().UserDir()); |
| 91 | for (const auto& profile : profiles) |
| 92 | { |
| 93 | ctrl->AddString(profile.name.c_str()); |
| 94 | } |
| 95 | ctrl->SortItems(); |
| 96 | ctrl->SetCurSel(0); |
| 97 | for (int i = 0; i < ctrl->GetSize(); i++) |
| 98 | { |
| 99 | if (Glob.header.playerName == ctrl->GetText(i)) |
| 100 | { |
| 101 | ctrl->SetCurSel(i); |
| 102 | } |
| 103 | } |
| 104 | return ctrl; |
| 105 | } |
| 106 | return Display::OnCreateCtrl(type, idc, cls); |
| 107 | } |
| 108 | |
| 109 | void DisplayLogin::OnButtonClicked(int idc) |
nothing calls this directly
no test coverage detected