MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / AddCustomStatic

Method AddCustomStatic

ogsr_engine/xrGame/UIGameCustom.cpp:110–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108void CUIGameCustom::RemoveCustomMessage(LPCSTR id) { GameCaptions()->removeCustomMessage(id); }
109
110SDrawStaticStruct* 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
135SDrawStaticStruct* CUIGameCustom::GetCustomStatic(LPCSTR id)
136{

Callers 6

IR_OnKeyboardPressMethod · 0.80
ExecuteMethod · 0.80
AddInfoMessageMethod · 0.80
UpdateCLMethod · 0.80
HitEntityMethod · 0.80
PerformTradeMethod · 0.80

Calls 6

ReadAttribFltMethod · 0.80
ReadAttribIntMethod · 0.80
findFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
InitStaticMethod · 0.45

Tested by

no test coverage detected