Exemplo n.º 1
0
        private void comboBoxMaps_SelectionChangeCommitted(object sender, EventArgs e)
        {
            char[] seps = { '[', ']' };
            string item = (string)comboBoxMaps.Items[comboBoxMaps.SelectedIndex];

            string[] split = item.Split(seps, 3); //befor, between, after ;)

            if (item == "")
            {
                return;
            }

            if (split.Length < 2)
            {
                return;
            }

            string region = split[1];


            int id = int.Parse(region);

            RegionMgr.Region reg = RegionMgr.GetRegion(id);

            if (reg != null)
            {
                RegionMgr.LoadRegion(reg);
            }
        }
Exemplo n.º 2
0
        public void ShowLocation(Vector3 point, int regionID)
        {
            if (Common.DeviceReady)
            {
                RegionMgr.LoadRegion(regionID);

                if (point.X <= hScrollBar.Maximum && point.X >= hScrollBar.Minimum)
                {
                    hScrollBar.Value = (int)point.X;
                }
                if (point.Y <= vScrollBar.Maximum && point.Y >= vScrollBar.Minimum)
                {
                    vScrollBar.Value = (int)point.Y;
                }
                SetZoom(0.25F);
            }
            else
            {
                cachedRegionID = regionID;
                cachedLocation = point;
            }
        }
Exemplo n.º 3
0
        private void DXControl_Load(object sender, EventArgs e)
        {
            RegionMgr.LoadRegions();
            ModulMgr.LoadModules();

            ZoomSlider.KeyDown += new KeyEventHandler(DXControl_KeyDown);

            if (cachedRegionID >= 0)
            {
                RegionMgr.LoadRegion(cachedRegionID);
                if (cachedLocation.X <= hScrollBar.Maximum && cachedLocation.X >= hScrollBar.Minimum)
                {
                    //hScrollBar.Value += diffX;
                    hScrollBar.Value = (int)cachedLocation.X;
                }
                if (cachedLocation.Y <= vScrollBar.Maximum && cachedLocation.Y >= vScrollBar.Minimum)
                {
                    //vScrollBar.Value += diffY;
                    vScrollBar.Value = (int)cachedLocation.Y;
                }

                Invalidate();
            }
        }