Ejemplo n.º 1
0
        private void OpenObjectList(ZipArchive archive)
        {
            objectList.Items.Clear();

            var entry = archive.GetEntry("objects.txt");

            if (!(entry is null))
            {
                using (var e = entry.Open())
                {
                    using (var s = new StreamReader(e))
                    {
                        while (!s.EndOfStream)
                        {
                            var str = s.ReadLine().Trim();
                            var obj = AbstractObject.ImportObject(str);
                            if (!(obj is null))
                            {
                                objectList.Items.Add(obj);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void ImgPanelPaint(object sender, PaintEventArgs e)
        {
            var p = sender as BufferedPanel;
            var g = e.Graphics;

            if (p.ImageLoaded())
            {
                p.DrawPanelImage(g);

                ActiveTool?.PaintHandler(p.Layer, p.RelativeToPanel, g);

                var selectedIndexes = objectList.SelectedIndices;
                for (int i = 0; i < objectList.Items.Count; i++)
                {
                    AbstractObject obj = objectList.Items[i] as AbstractObject;
                    obj.DrawObject(p.Layer, p.RelativeToPanel, g, selectedIndexes.Contains(i));
                }

                p.DrawPanelCrosshair(g, crosshair);
            }
        }
Ejemplo n.º 3
0
 public AbstractObject(AbstractObject o)
 {
     layer = o.layer;
 }