| 120 | } |
| 121 | |
| 122 | void CMainScreen::OnTextInput(const TextEvent &ev) |
| 123 | { |
| 124 | const auto ch = EvChar(ev); |
| 125 | if (!IsPrintable(ch) || !g_FontManager.IsPrintASCII((uint8_t)ch)) |
| 126 | { |
| 127 | return; |
| 128 | } |
| 129 | if (g_EntryPointer == nullptr) |
| 130 | { |
| 131 | g_EntryPointer = m_MainGump.m_PasswordFake; |
| 132 | } |
| 133 | |
| 134 | if (g_EntryPointer->Length() < 16) //add char to text field |
| 135 | { |
| 136 | if (g_EntryPointer == m_MainGump.m_PasswordFake) |
| 137 | { |
| 138 | if (g_EntryPointer->Insert(L'*')) |
| 139 | { |
| 140 | m_Password->Insert(ch); |
| 141 | } |
| 142 | } |
| 143 | else |
| 144 | { |
| 145 | g_EntryPointer->Insert(ch); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | m_Gump.WantRedraw = true; |
| 150 | } |
| 151 | |
| 152 | void CMainScreen::OnKeyDown(const KeyEvent &ev) |
| 153 | { |
nothing calls this directly
no test coverage detected