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

Method SetupCurrentMap

ogsr_engine/xrGame/UIZoneMap.cpp:145–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void CUIZoneMap::SetupCurrentMap()
146{
147 CInifile* pLtx = pGameIni;
148
149 R_ASSERT(pLtx->section_exist(Level().name()));
150
151 // dsh: очередной костыль. Если не создавать новый CUIMiniMap, то после
152 // перехода с локации, на которой нет текстуры миникарты, на локацию,
153 // где эта текстура есть (например, из X-10 на Радар), миникарта
154 // перестает показываться.
155 m_clipFrame->DetachChild(m_activeMap);
156 m_clipFrame->DetachChild(m_center);
157
158 m_activeMap = xr_new<CUIMiniMap>();
159 m_clipFrame->AttachChild(m_activeMap);
160
161 m_activeMap->SetAutoDelete(true);
162 m_activeMap->EnableHeading(true);
163 m_activeMap->SetRounded(m_rounded);
164
165 m_activeMap->Init(Level().name(), *pLtx, "hud\\default");
166 m_activeMap->SetWindowName("minimap"); // имя нужно задавать позже чем Init
167
168 m_activeMap->SetTextureColor(color_argb(m_alpha, 255, 255, 255));
169
170 m_clipFrame->AttachChild(m_center);
171
172 Frect r;
173 m_clipFrame->GetAbsoluteRect(r);
174 m_activeMap->SetClipRect(r);
175 m_activeMap->WorkingArea().set(r);
176
177 ApplyZoom();
178}
179
180void CUIZoneMap::ApplyZoom() const
181{

Callers 1

OnConnectedMethod · 0.80

Calls 13

color_argbFunction · 0.85
section_existMethod · 0.80
AttachChildMethod · 0.80
SetRoundedMethod · 0.80
SetWindowNameMethod · 0.80
GetAbsoluteRectMethod · 0.80
SetClipRectMethod · 0.80
nameMethod · 0.45
DetachChildMethod · 0.45
EnableHeadingMethod · 0.45
InitMethod · 0.45
SetTextureColorMethod · 0.45

Tested by

no test coverage detected