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

Method OnSrcListItemClicked

ogsr_engine/xrGame/ui/UIDiaryWnd2.cpp:193–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193void CUIDiaryWnd::OnSrcListItemClicked(CUIWindow* w, void* p)
194{
195 CUITreeViewItem* pSelItem = (CUITreeViewItem*)p;
196 m_DescrView->Clear();
197 if (!pSelItem->IsRoot())
198 {
199 CUIEncyclopediaArticleWnd* article_info = xr_new<CUIEncyclopediaArticleWnd>();
200 article_info->Init("encyclopedia_item.xml", "encyclopedia_wnd:objective_item");
201 article_info->SetArticle(&m_ArticlesDB[pSelItem->GetValue()]);
202 m_DescrView->AddWindow(article_info, true);
203
204 // Исправление отображения зеленым цветом прочитанных записей в дневнике КПК
205 if (!pSelItem->IsArticleReaded())
206 {
207 if (Actor()->encyclopedia_registry->registry().objects_ptr())
208 {
209 for (ARTICLE_VECTOR::iterator it = Actor()->encyclopedia_registry->registry().objects().begin(); it != Actor()->encyclopedia_registry->registry().objects().end();
210 it++)
211 {
212 if (ARTICLE_DATA::eJournalArticle == it->article_type && m_ArticlesDB[pSelItem->GetValue()].Id() == it->article_id)
213 {
214 it->readed = true;
215 break;
216 }
217 }
218 }
219 }
220 }
221}
222
223void draw_sign(CUIStatic* s, Fvector2& pos);
224void CUIDiaryWnd::Draw()

Callers

nothing calls this directly

Calls 12

ActorFunction · 0.85
IsRootMethod · 0.80
SetArticleMethod · 0.80
GetValueMethod · 0.80
AddWindowMethod · 0.80
IsArticleReadedMethod · 0.80
objects_ptrMethod · 0.80
IdMethod · 0.80
ClearMethod · 0.45
InitMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected