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

Method SendMessage

ogsr_engine/xrGame/ui/UIEncyclopediaWnd.cpp:100–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99#include "../string_table.h"
100void CUIEncyclopediaWnd::SendMessage(CUIWindow* pWnd, s16 msg, void* pData)
101{
102 if (UIIdxList == pWnd && LIST_ITEM_CLICKED == msg)
103 {
104 CUITreeViewItem* pTVItem = static_cast<CUITreeViewItem*>(pData);
105 R_ASSERT(pTVItem);
106
107 if (pTVItem->vSubItems.size())
108 {
109 auto& A = m_ArticlesDB[pTVItem->vSubItems[0]->GetValue()];
110
111 xr_string caption = ALL_PDA_HEADER_PREFIX;
112 caption += "/";
113 caption += CStringTable().translate(A.data()->group).c_str();
114
115 UIEncyclopediaInfoHeader->UITitleText.SetText(caption.c_str());
116 UIArticleHeader->SetTextST(*(A.data()->group));
117 SetCurrentArtice(NULL);
118 }
119 else
120 {
121 auto& A = m_ArticlesDB[pTVItem->GetValue()];
122 xr_string caption = ALL_PDA_HEADER_PREFIX;
123 caption += "/";
124 caption += CStringTable().translate(A.data()->group).c_str();
125 caption += "/";
126 caption += CStringTable().translate(A.data()->name).c_str();
127
128 UIEncyclopediaInfoHeader->UITitleText.SetText(caption.c_str());
129 SetCurrentArtice(pTVItem);
130 UIArticleHeader->SetTextST(*(A.data()->name));
131 }
132 }
133
134 inherited::SendMessage(pWnd, msg, pData);
135}
136
137void CUIEncyclopediaWnd::Draw()
138{

Callers

nothing calls this directly

Calls 8

CStringTableClass · 0.85
GetValueMethod · 0.80
SetTextSTMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45
translateMethod · 0.45
dataMethod · 0.45
SetTextMethod · 0.45

Tested by

no test coverage detected