Exemplo n.º 1
0
        public MapViewerForm(TileMap map)
        {
            InitializeComponent();
            Map = map;
            mv = new MapViewer(picMapViewer.Handle, picMapViewer.Width, picMapViewer.Height);
            mv.changeMap(Map);
            mv.UpdateView();

            lstLayer.DataSource = Map.myLayer;
            lstLayer.DisplayMember = "Name";

            updateLayer();
            ve = new ViewEvent();

            _layerCache = new List<LayerCache>();
            for (int i = 0; i < Map.myLayer.Count; i++ )
            {
                LayerCache lc = new LayerCache(Map.maxX, map.maxY, Map.myLayer[i]);
                _layerCache.Add(lc);
            }

            cm = (CurrencyManager)BindingContext[Map.myLayer];

            SetScrollSize();

            tmrRefresh.Interval = 180;
            tmrRefresh.Start();
        }
Exemplo n.º 2
0
        public NewEvent(List<Event> toadd, ViewEvent forRefresh)
        {
            InitializeComponent();

            _toAdd = toadd;
            _forRefresh = forRefresh;
        }
Exemplo n.º 3
0
        public NewConditioner(List<Event> toadd, ViewEvent forRefresh)
        {
            InitializeComponent();
            _toAdd = toadd;
            _forRefresh = forRefresh;

            lstSwitch.DataSource = Editor.Instance.curGame.MySwitch;
            lstVariable.DataSource = Editor.Instance.curGame.MyVariable;
            lstSwitch.DisplayMember = "Name";
            lstVariable.DisplayMember = "Name";
        }
Exemplo n.º 4
0
        public SetSwitch(List<Event> toadd, ViewEvent toRefresh)
        {
            InitializeComponent();
            _toAdd = toadd;
            _forRefresh = toRefresh;

            lstSwitch.DataSource = Editor.Instance.curGame.MySwitch;
            lstSwitch.DisplayMember = "Name";

            lstSwitch.Refresh();
        }
Exemplo n.º 5
0
        private void picMapViewer_DoubleClick(object sender, EventArgs e)
        {
            if (chkBlock.Checked || chkBackground.Checked || ve.Visible)
                return;

            int pickedX = mv.getMouseLoc.X;
            int pickedY = mv.getMouseLoc.Y;

            if (pickedX < 0 || pickedY < 0 || pickedX > picMapViewer.Width || pickedY > picMapViewer.Height)
                return;

            pickedX = mv.getMouseLoc.X + mv.xOffSet;
            pickedY = mv.getMouseLoc.Y + mv.yOffSet;

            pickedX /= Editor.Instance.curGame.TileX;
            pickedY /= Editor.Instance.curGame.TileY;

            ViewEvent v = new ViewEvent(Map.EM[pickedX, pickedY].MyEvent);
            v.ShowDialog();
        }