| 108 | void CUIGameCustom::RemoveCustomMessage(LPCSTR id) { GameCaptions()->removeCustomMessage(id); } |
| 109 | |
| 110 | SDrawStaticStruct* CUIGameCustom::AddCustomStatic(LPCSTR id, bool bSingleInstance) |
| 111 | { |
| 112 | if (bSingleInstance) |
| 113 | { |
| 114 | st_vec::iterator it = std::find(m_custom_statics.begin(), m_custom_statics.end(), id); |
| 115 | if (it != m_custom_statics.end()) |
| 116 | return &(*it); |
| 117 | } |
| 118 | |
| 119 | CUIXmlInit xml_init; |
| 120 | auto& sss = m_custom_statics.emplace_back(); |
| 121 | |
| 122 | sss.m_static = xr_new<CUIStatic>(); |
| 123 | sss.m_name = id; |
| 124 | xml_init.InitStatic(*m_msgs_xml, id, 0, sss.m_static); |
| 125 | float ttl = m_msgs_xml->ReadAttribFlt(id, 0, "ttl", -1); |
| 126 | if (ttl > 0.0f) |
| 127 | sss.m_endTime = Device.fTimeGlobal + ttl; |
| 128 | sss.m_priority = m_msgs_xml->ReadAttribInt(id, 0, "priority"); |
| 129 | |
| 130 | UpdateStaticPriorityIndex(); |
| 131 | |
| 132 | return &sss; |
| 133 | } |
| 134 | |
| 135 | SDrawStaticStruct* CUIGameCustom::GetCustomStatic(LPCSTR id) |
| 136 | { |
no test coverage detected