mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-25 01:06:50 +00:00
Delete wrongful proxy CGUIManager::GetPreDefinedColor from f0d9806b3f.
It is wrong because the predefined colors should be loaded from the GUI page that requests to have the color parsed, which may be different from the topmost page. Similar to FindObjectByName removed inf9b529f2fb. Achieve this by implementing the CGUISetting<CGUIColor>::FromJSVal specialization, moved from ScriptInterface::FromJSVal<CGUIColor>, instead of adding a CGUI pointer to CGUIColor. Mark ScriptInterface::FromJSVal<GUIColor> and inherited CColor::ParseString explicitly as deleted, so that people get a compile error if they forget to check for predefined colors when parsing a color. Refs #5387, D1746 > D1684 > this >f9b529f2fb,9be8a560a9,415939b59b,2c47fbd66a,85a622b13a. Differential Revision: https://code.wildfiregames.com/D2108 Tested on: clang 8, VS2015 This was SVN commit r22663.
This commit is contained in:
@@ -144,7 +144,7 @@ void CGUIString::GenerateTextCall(const CGUI* pGUI, SFeedback& Feedback, CStrInt
|
||||
// Displace the sprite
|
||||
CSize displacement;
|
||||
// Parse the value
|
||||
if (!GUI<CSize>::ParseString(tagAttrib.value, displacement))
|
||||
if (!GUI<CSize>::ParseString(pGUI, tagAttrib.value, displacement))
|
||||
LOGERROR("Error parsing 'displace' value for tag [ICON]");
|
||||
else
|
||||
SpriteCall.m_Area += displacement;
|
||||
@@ -190,7 +190,7 @@ void CGUIString::GenerateTextCall(const CGUI* pGUI, SFeedback& Feedback, CStrInt
|
||||
case TextChunk::Tag::TAG_COLOR:
|
||||
TextCall.m_UseCustomColor = true;
|
||||
|
||||
if (!GUI<CGUIColor>::ParseString(tag.m_TagValue, TextCall.m_Color) && pObject)
|
||||
if (!GUI<CGUIColor>::ParseString(pGUI, tag.m_TagValue, TextCall.m_Color) && pObject)
|
||||
LOGERROR("Error parsing the value of a [color]-tag in GUI text when reading object \"%s\".", pObject->GetPresentableName().c_str());
|
||||
break;
|
||||
case TextChunk::Tag::TAG_FONT:
|
||||
|
||||
Reference in New Issue
Block a user