public override ContextMenuStrip GetContextMenuStrip()
        {
            if (_contextMenuStrip == null)
            {
                ToolStripMenuItem addMoreTrisItem = new ToolStripMenuItem("Add More Tris");
                addMoreTrisItem.Click += (sender, e) =>
                {
                    string      text           = DialogUtilities.GetStringFromDialog(labelText: "Enter triangle addresses as hex uints.");
                    List <uint> triAddressList = MapUtilities.ParseCustomTris(text, TriangleClassification.Wall);
                    if (triAddressList == null)
                    {
                        return;
                    }
                    _triList.AddRange(triAddressList.ConvertAll(address => TriangleDataModel.CreateLazy(address)));
                };

                _contextMenuStrip = new ContextMenuStrip();
                _contextMenuStrip.Items.Add(addMoreTrisItem);
                _contextMenuStrip.Items.Add(new ToolStripSeparator());
                GetWallToolStripMenuItems().ForEach(item => _contextMenuStrip.Items.Add(item));
                _contextMenuStrip.Items.Add(new ToolStripSeparator());
                GetTriangleToolStripMenuItems().ForEach(item => _contextMenuStrip.Items.Add(item));
            }

            return(_contextMenuStrip);
        }
        public static MapObjectCustomWall Create(string text)
        {
            List <uint> triAddressList = MapUtilities.ParseCustomTris(text, TriangleClassification.Wall);

            if (triAddressList == null)
            {
                return(null);
            }
            return(new MapObjectCustomWall(triAddressList));
        }
Exemple #3
0
        public static MapObjectLevelWall Create(string text)
        {
            List <uint> triAddressList = MapUtilities.ParseCustomTris(text, null);

            if (triAddressList == null)
            {
                return(null);
            }
            List <TriangleDataModel> triList = triAddressList.ConvertAll(address => TriangleDataModel.CreateLazy(address));

            return(new MapObjectLevelWall(triList));
        }