1
0
forked from 0ad/0ad

Ignore color and font tags when typing something in a Dropdown gui element to select an item.

Differential Revision: https://code.wildfiregames.com/D462
Refs D435
Reviewed By: Vladislav
This was SVN commit r19545.
This commit is contained in:
elexis 2017-05-09 13:29:19 +00:00
parent 228ba51d5c
commit 8bf732453e
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016 Wildfire Games.
/* Copyright (C) 2017 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -347,7 +347,7 @@ InReaction CDropDown::ManuallyHandleEvent(const SDL_Event_* ev)
int diff = 0;
for (size_t j = 0; j < m_InputBuffer.length(); ++j)
{
diff = abs(pList->m_Items[i].GetOriginalString().LowerCase()[j] - (int)m_InputBuffer[j]);
diff = std::abs(pList->m_Items[i].GetRawString().LowerCase()[j] - (int)m_InputBuffer[j]);
if (diff == 0)
indexOfDifference = j+1;
else

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015 Wildfire Games.
/* Copyright (C) 2017 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -290,6 +290,11 @@ public:
*/
const CStrW& GetOriginalString() const { return m_OriginalString; }
/**
* Get String, stripped of tags
*/
const CStrW& GetRawString() const { return m_RawString; }
/**
* Generate Text Call from specified range. The range
* must span only within ONE TextChunk though. Otherwise