| 1794 | } |
| 1795 | |
| 1796 | void DisplayMap::OnChildDestroyed(int idd, int exit) |
| 1797 | { |
| 1798 | if (idd == IDD_INSERT_MARKER && exit == IDC_OK) |
| 1799 | { |
| 1800 | DisplayInsertMarker* display = dynamic_cast<DisplayInsertMarker*>((ControlsContainer*)_child); |
| 1801 | PoseidonAssert(display); |
| 1802 | |
| 1803 | int index = markersMap.Add(); |
| 1804 | ArcadeMarkerInfo& marker = markersMap[index]; |
| 1805 | marker.position = _map->ScreenToWorld(DrawCoord(display->_x, display->_y)); |
| 1806 | char buffer[256]; |
| 1807 | snprintf(buffer, sizeof(buffer), "_USER_DEFINED #%d/%d", GetNetworkManager().GetPlayer(), index); |
| 1808 | marker.name = buffer; |
| 1809 | marker.text = display->_text; |
| 1810 | marker.markerType = MTIcon; |
| 1811 | const ParamEntry& markers = Pars >> "CfgMarkers"; |
| 1812 | if (display->_picture >= 0 && display->_picture < markers.GetEntryCount()) |
| 1813 | { |
| 1814 | const ParamEntry& markerCfg = markers.GetEntry(display->_picture); |
| 1815 | marker.type = markerCfg.GetName(); |
| 1816 | marker.OnTypeChanged(); |
| 1817 | } |
| 1818 | |
| 1819 | const ParamEntry& colors = Pars >> "CfgMarkerColors"; |
| 1820 | if (display->_color >= 0 && display->_color < colors.GetEntryCount()) |
| 1821 | { |
| 1822 | const ParamEntry& colorCfg = colors.GetEntry(display->_color); |
| 1823 | marker.colorName = colorCfg.GetName(); |
| 1824 | marker.OnColorChanged(); |
| 1825 | } |
| 1826 | |
| 1827 | marker.fillName = "Solid"; |
| 1828 | marker.OnFillChanged(); |
| 1829 | marker.a = 1; |
| 1830 | marker.b = 1; |
| 1831 | ChatChannel channel = ActualChatChannel(); |
| 1832 | Person* veh = GWorld->GetRealPlayer(); |
| 1833 | AIUnit* unit = veh ? veh->Brain() : nullptr; |
| 1834 | if (channel == CCGlobal || unit) |
| 1835 | { |
| 1836 | SendMarker(channel, unit, marker); |
| 1837 | } |
| 1838 | } |
| 1839 | Display::OnChildDestroyed(idd, exit); |
| 1840 | } |
nothing calls this directly
no test coverage detected