public TileSheetNewCommand(Map map, TileSheet newTileSheet, MapTreeView mapTreeView)
 {
     m_map          = map;
     m_newTileSheet = newTileSheet;
     m_mapTreeView  = mapTreeView;
     m_description  = "Add new tile sheet \"" + newTileSheet.Id + "\"";
 }
 public TileSheetDeleteCommand(Map map, TileSheet tileSheet, MapTreeView mapTreeView)
 {
     m_map         = map;
     m_tileSheet   = tileSheet;
     m_mapTreeView = mapTreeView;
     m_description = "Delete tile sheet \"" + tileSheet.Id + "\"";
 }
Esempio n. 3
0
        public TileSheetPropertiesDialog(TileSheet tileSheet, bool isNewTileSheet, MapTreeView mapTreeView)
        {
            InitializeComponent();

            m_tileSheet      = tileSheet;
            m_isNewTileSheet = isNewTileSheet;
            m_mapTreeView    = mapTreeView;
        }
Esempio n. 4
0
 public LayerDeleteCommand(Map map, Layer layer, MapTreeView mapTreeView)
 {
     m_map         = map;
     m_layer       = layer;
     m_layerIndex  = map.Layers.IndexOf(layer);
     m_mapTreeView = mapTreeView;
     m_description = "Delete layer \"" + layer.Id + "\"";
 }
Esempio n. 5
0
        public EditorBridge(MapPanel mapPanel, MapTreeView mapTreeView)
            : base(false)
        {
            m_mapPanel    = mapPanel;
            m_mapTreeView = mapTreeView;

            Panel innerPanel = m_mapPanel.InnerPanel;

            innerPanel.MouseDown                += OnMapPanelMouseDown;
            innerPanel.MouseMove                += OnMapPanelMouseMove;
            innerPanel.MouseUp                  += OnMapPanelMouseUp;
            m_mapPanel.DrawTileEvent            += OnDrawTile;
            m_mapPanel.SaveEvent                += OnSave;
            m_mapPanel.LoadEvent                += OnLoad;
            m_mapTreeView.LayerNewAction        += OnLayerNew;
            m_mapTreeView.LayerPropertiesAction += OnLayerProperties;
            m_mapTreeView.LayerDeleteAction     += OnLayerDelete;
        }
Esempio n. 6
0
        public ApplicationBridge(MenuStrip menuStrip, ToolStripContainer toolStripContainer, MapPanel mapPanel, MapTreeView mapTreeView) : base(false)
        {
            m_commandHistory = CommandHistory.Instance;

            m_menuStripBridge = new MenuStripBridge(menuStrip);

            m_toolStripContainer = toolStripContainer;
            m_toolBars           = new List <ToolBarBridge>();
            PopulateToolBars(toolStripContainer.TopToolStripPanel, mapPanel);
            PopulateToolBars(toolStripContainer.BottomToolStripPanel, mapPanel);
            PopulateToolBars(toolStripContainer.LeftToolStripPanel, mapPanel);
            PopulateToolBars(toolStripContainer.RightToolStripPanel, mapPanel);

            m_editorBridge = new EditorBridge(mapPanel, mapTreeView);
        }
Esempio n. 7
0
        public MainForm(ViewModel viewModel)
        {
            this.InitializeComponent();

            this.SuspendLayout();

            this.mapTreeView = new MapTreeView();
            this.LeftSplitContainer.Panel2.Controls.Add(this.mapTreeView);
            this.mapTreeView.BorderStyle = BorderStyle.None;
            this.mapTreeView.Dock = DockStyle.Fill;
            this.mapTreeView.DrawMode = TreeViewDrawMode.OwnerDrawAll;
            this.mapTreeView.FullRowSelect = true;
            this.mapTreeView.HideSelection = false;
            this.mapTreeView.ImageKey = "PageWhite"; // unused?
            this.mapTreeView.ItemHeight = 21;
            this.mapTreeView.ShowLines = false;
            this.mapTreeView.ShowRootLines = false;

            this.mapEditor = new MapEditor();
            this.mapEditor.BorderStyle = BorderStyle.Fixed3D;
            this.mapEditor.Dock = DockStyle.Fill;
            this.MainSplitContainer.Panel2.Controls.Add(this.mapEditor);

            this.tileSetPalette = new Shrimp.Views.TileSetPalette();
            this.tileSetPalette.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
            this.tileSetPalette.AutoScroll = true;
            this.LeftSplitContainer.Panel1.Controls.Add(this.tileSetPalette);

            this.ToolStrip.Renderer = new CustomToolStripSystemRenderer();
            this.TileSetPaletteToolStrip.Renderer = new CustomToolStripSystemRenderer();
            this.tileSetPalette.Size = new Size
            {
                Width = Util.PaletteGridSize * Util.PaletteHorizontalCount
                    + SystemInformation.VerticalScrollBarWidth,
                Height = this.tileSetPalette.Parent.ClientSize.Height
                    - this.TileSetPaletteToolStrip.Height,
            };
            this.MainSplitContainer.SplitterDistance -=
                this.tileSetPalette.Parent.ClientSize.Width - this.tileSetPalette.Width;

            this.ResumeLayout(false);

            this.Layer1ToolStripButton.Tag = LayerMode.Layer1;
            this.Layer2ToolStripButton.Tag = LayerMode.Layer2;
            this.LayerEventToolStripButton.Tag = LayerMode.Event;
            foreach (var item in this.LayerModeSwitchers)
            {
                item.Click += (sender, e) =>
                {
                    LayerMode layerMode = (LayerMode)((ToolStripButton)sender).Tag;
                    this.OnLayerModeSwitcherClick(new LayerModeSwitcherClickEventArgs(layerMode));
                };
            }

            this.PenToolStripButton.Tag = DrawingMode.Pen;
            foreach (var item in this.DrawingModeSwitchers)
            {
                item.Click += (sender, e) =>
                {
                    DrawingMode drawingMode = (DrawingMode)((ToolStripButton)sender).Tag;
                    this.OnDrawingModeSwitcherClick(new DrawingModeSwitcherClickEventArgs(drawingMode));
                };
            }

            this.Scale1ToolStripButton.Tag = ScaleMode.Scale1;
            this.Scale2ToolStripButton.Tag = ScaleMode.Scale2;
            this.Scale4ToolStripButton.Tag = ScaleMode.Scale4;
            this.Scale8ToolStripButton.Tag = ScaleMode.Scale8;
            foreach (var item in this.ScaleModeSwitchers)
            {
                item.Click += (sender, e) =>
                {
                    ScaleMode scaleMode = (ScaleMode)((ToolStripButton)sender).Tag;
                    this.OnScaleModeSwitcherClick(new ScaleModeSwitcherClickEventArgs(scaleMode));
                };
            }
        }
Esempio n. 8
0
 public PluginManager(MenuStrip menuStrip, ToolStripContainer toolStripContainer, MapPanel mapPanel, MapTreeView mapTreeView)
 {
     m_plugins           = new Dictionary <string, IPlugin>();
     m_applicationBridge = new ApplicationBridge(menuStrip, toolStripContainer, mapPanel, mapTreeView);
     //PurgePluginDomain();
 }