| 38 | } |
| 39 | |
| 40 | void CUIZoneMap::Init() |
| 41 | { |
| 42 | CUIXml uiXml; |
| 43 | const bool xml_result = uiXml.Init(CONFIG_PATH, UI_PATH, "zone_map.xml"); |
| 44 | R_ASSERT(xml_result, "xml file not found", "zone_map.xml"); |
| 45 | |
| 46 | // load map background |
| 47 | CUIXmlInit xml_init; |
| 48 | |
| 49 | xml_init.InitStatic(uiXml, "minimap:background", 0, m_background); |
| 50 | // m_background->SetAutoDelete(true); |
| 51 | |
| 52 | xml_init.InitStatic(uiXml, "minimap:background:dist_text", 0, m_pointerDistanceText); |
| 53 | m_background->AttachChild(m_pointerDistanceText); |
| 54 | m_pointerDistanceText->SetAutoDelete(true); |
| 55 | |
| 56 | if (uiXml.NavigateToNode("minimap:clock_wnd", 0)) |
| 57 | { |
| 58 | xml_init.InitStatic(uiXml, "minimap:clock_wnd", 0, m_clock_wnd); |
| 59 | m_background->AttachChild(m_clock_wnd); |
| 60 | m_clock_wnd->SetAutoDelete(true); |
| 61 | } |
| 62 | |
| 63 | xml_init.InitStatic(uiXml, "minimap:level_frame", 0, m_clipFrame); |
| 64 | // m_clipFrame->SetAutoDelete(true); |
| 65 | |
| 66 | xml_init.InitStatic(uiXml, "minimap:center", 0, m_center); |
| 67 | |
| 68 | m_rounded = uiXml.ReadAttribInt("minimap", 0, "rounded", 0) == 1; |
| 69 | m_alpha = uiXml.ReadAttribInt("minimap", 0, "alpha", 127); |
| 70 | |
| 71 | m_clipFrame->AttachChild(m_activeMap); |
| 72 | |
| 73 | m_activeMap->SetAutoDelete(true); |
| 74 | m_activeMap->EnableHeading(true); |
| 75 | m_activeMap->SetWindowName("minimap"); |
| 76 | m_activeMap->SetRounded(m_rounded); |
| 77 | |
| 78 | xml_init.InitStatic(uiXml, "minimap:compass", 0, m_compass); |
| 79 | // m_compass->SetAutoDelete(true); |
| 80 | |
| 81 | m_activeMap->SetTextureColor(color_argb(m_alpha, 255, 255, 255)); |
| 82 | |
| 83 | // m_background.AttachChild(&m_compass); |
| 84 | |
| 85 | m_clipFrame->AttachChild(m_center); |
| 86 | m_center->SetWndPos(m_clipFrame->GetWidth() / 2, m_clipFrame->GetHeight() / 2); |
| 87 | // m_center->SetAutoDelete(true); |
| 88 | m_fScale = 1.f; |
| 89 | } |
| 90 | |
| 91 | void CUIZoneMap::Render() |
| 92 | { |
no test coverage detected