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

Method InitCharacter

ogsr_engine/xrGame/ui/UICharacterInfo.cpp:166–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void CUICharacterInfo::InitCharacter(u16 id)
167{
168 m_ownerID = id;
169
170 CCharacterInfo chInfo;
171 CSE_ALifeTraderAbstract* T = ch_info_get_from_id(m_ownerID);
172
173 chInfo.Init(T);
174
175 CStringTable stbl;
176 string256 str;
177 if (m_icons[eUIName])
178 {
179 m_icons[eUIName]->SetText(T->name_translated().c_str());
180 }
181
182 if (m_icons[eUIRankCaption])
183 {
184 strcpy_s(str, stbl.translate(m_text_ids[eUIRankCaptionText]).c_str());
185 m_icons[eUIRankCaption]->SetText(str);
186 }
187
188 if (m_icons[eUIRank])
189 {
190 strcpy_s(str, stbl.translate(GetRankAsText(chInfo.Rank().value())).c_str());
191 m_icons[eUIRank]->SetText(str);
192 }
193
194 if (m_icons[eUIReputationCaption])
195 {
196 strcpy_s(str, stbl.translate(m_text_ids[eUIReputationCaptionText]).c_str());
197 m_icons[eUIReputationCaption]->SetText(str);
198 }
199
200 if (m_icons[eUIReputation])
201 {
202 strcpy_s(str, stbl.translate(GetReputationAsText(chInfo.Reputation().value())).c_str());
203 m_icons[eUIReputation]->SetText(str);
204 }
205
206 if (m_icons[eUIRelationCaption])
207 {
208 strcpy_s(str, stbl.translate(m_text_ids[eUIRelationCaptionText]).c_str());
209 m_icons[eUIRelationCaption]->SetText(str);
210 }
211
212 if (m_icons[eUICommunityCaption])
213 {
214 strcpy_s(str, stbl.translate(m_text_ids[eUICommunityCaptionText]).c_str());
215 m_icons[eUICommunityCaption]->SetText(str);
216 }
217
218 if (m_icons[eUICommunity])
219 {
220 strcpy_s(str, stbl.translate(chInfo.Community().id()).c_str());
221 m_icons[eUICommunity]->SetText(str);
222 }
223

Callers

nothing calls this directly

Calls 15

ch_info_get_from_idFunction · 0.85
name_translatedMethod · 0.80
GetDesiredChildWidthMethod · 0.80
AdjustHeightToTextMethod · 0.80
AddWindowMethod · 0.80
InitMethod · 0.45
SetTextMethod · 0.45
c_strMethod · 0.45
translateMethod · 0.45
valueMethod · 0.45
RankMethod · 0.45
ReputationMethod · 0.45

Tested by

no test coverage detected