public bool Load(string mapName)
        {
            var zoneMap = MapsHelper.GetMap(mapName);

            if (zoneMap == null)
            {
                Host.Log($"Could not load zone map: {mapName}");

                return(false);
            }


            bool success = false;

            switch (zoneMap.MapUseType)
            {
            case MapUseType.Local:
                success = LoadDataBase(zoneMap.GetMapPath());

                if (zoneMap.MeshExists())
                {
                    Host.LoadNavMesh(zoneMap.GetMeshPath(), false);
                }

                break;

            case MapUseType.Internal:
                success = LoadDataBase(zoneMap.GetByteMap());

                if (zoneMap.MeshExists())
                {
                    Host.LoadNavMesh(zoneMap.GetByteMesh(), false);
                }

                break;
            }


            if (success)
            {
                if (zoneMap.MeshExists())
                {
                    MeshEnabled = true;
                }

                IsLoaded = true;

                return(true);
            }

            return(false);
        }
        private void cmbox_ZoneMaps_SelectedIndexChanged(object sender, EventArgs e)
        {
            Utils.InvokeOn(this, () =>
            {
                int index = cmbox_ZoneMaps.SelectedIndex;

                // Clear box
                lbox_GpsPoints.Items.Clear();

                if (index == 0)
                {
                    return;
                }


                var mapName = cmbox_ZoneMaps.SelectedItem.ToString();
                var map     = MapsHelper.GetMap(mapName);

                if (map == null)
                {
                    return;
                }


                var gps = new Gps(Host);

                switch (map.MapUseType)
                {
                case MapUseType.Local:
                    gps.LoadDataBase(map.GetMapPath());
                    break;

                case MapUseType.Internal:
                    gps.LoadDataBase(map.GetByteMap());
                    break;
                }


                var points = gps.GetAllGpsPoints().Where
                                 (p => p.name.Contains("Fight")).Select(p => p.name + " : " + p.radius);

                if (points.Count() > 0)
                {
                    lbox_GpsPoints.Items.AddRange(points.ToArray());
                }
            });
        }
        public bool Load(string mapName)
        {
            var zoneMap = MapsHelper.GetMap(mapName);

            if (zoneMap == null)
            {
                Host.Log("Failed to acquire zone map!");
                return(false);
            }

            if (!zoneMap.MeshExists())
            {
                Host.Log("Failed to load or missing mesh map!");
                return(false);
            }


            bool success = false;

            switch (zoneMap.MapUseType)
            {
            case MapUseType.Local:
                success = LoadDataBase(zoneMap.GetMapPath());
                Host.LoadNavMesh(zoneMap.GetMeshPath(), false);
                break;

            case MapUseType.Internal:
                success = LoadDataBase(zoneMap.GetByteMap());
                Host.LoadNavMesh(zoneMap.GetByteMesh(), false);
                break;
            }

            if (success)
            {
                MeshEnabled = true;
                return(true);
            }

            return(false);
        }