DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ProcessIntoIPAddress()

bool ScriptedWidgetEventHandler::ProcessIntoIPAddress ( out string potential_ip)
inlineprotected

Removes all characters from the given string whirh are NOT a number, '.' or ':'. Returns true if any change was done to the input text.

См. определение в файле ServerBrowserFilterContainer.c строка 255

256 {
257 bool was_text_changed = false;
258 int length = potential_ip.Length();
259
260 // Filter out incompatible characters
261 for (int i = length - 1 ; i >= 0; --i)
262 {
263 string character = potential_ip.Get(i);
264
265 if (character.ToInt() == 0 && character != "0" && character != "." && character != ":")
266 {
267 potential_ip = potential_ip.SubstringInverted(potential_ip, i, i + 1);
268 was_text_changed = true;
269 }
270 }
271
272 bool text_was_shortened = LimitTextBoxCharacterCount(potential_ip, 21);
273
274 return (was_text_changed || text_was_shortened);
275 }
bool LimitTextBoxCharacterCount(out string text, int max_length)
Limits the given text to 'max_length' character count. Returns true if any change was done to the inp...
Определения ServerBrowserFilterContainer.c:278
proto native int ToInt()
Converts string to integer.

Перекрестные ссылки LimitTextBoxCharacterCount() и string::ToInt().

Используется в OnChange().