コード例 #1
0
        public NFilePickerTextBox(NewAssetPicker.ObjectType objecttype, int filetype)
        {
            this.ObjType        = objecttype;
            this.FileType       = filetype;
            base.Height         = 16;
            this.propLeftMargin = 0;
            Color color = Color.FromKnownColor(KnownColor.ControlLightLight);

            this.DropButtonLightBorderBrush = new SolidBrush(color);
            Color color2 = Color.FromKnownColor(KnownColor.ControlDark);

            this.DropButtonDarkBorderBrush = new SolidBrush(color2);
            Color color3 = Color.FromKnownColor(KnownColor.Control);

            this.DropButtonBackgroundBrush = new SolidBrush(color3);
            Color color4 = Color.FromKnownColor(KnownColor.ControlText);

            this.DropButtonTextBrush = new SolidBrush(color4);
            Control control = new Control();

            this.DraggerButton = control;
            control.Dock       = DockStyle.Right;
            Size size = new Size(16, 16);

            this.DraggerButton.Size       = size;
            this.DraggerButton.MouseDown += new MouseEventHandler(this.DraggerButton_MouseDown);
            this.DraggerButton.Click     += new EventHandler(this.DraggerButton_Click);
            this.DraggerButton.Paint     += new PaintEventHandler(this.DraggerButton_Paint);
            this.FileTextBox              = new TextBox();
            Point location = new Point(this.propLeftMargin, 1);

            this.FileTextBox.Location = location;
            Size size2 = new Size(base.Width - this.DraggerButton.Width - this.propLeftMargin, base.Height - 1);

            this.FileTextBox.Size         = size2;
            this.FileTextBox.KeyDown     += new KeyEventHandler(this.FileTextBox_KeyDown);
            this.FileTextBox.MouseDown   += new MouseEventHandler(this.FileTextBox_MouseDown);
            this.FileTextBox.Validated   += new EventHandler(this.FileTextBox_Validated);
            this.FileTextBox.TextChanged += new EventHandler(this.FileTextBox_TextChanged);
            base.Controls.Add(this.DraggerButton);
            base.Controls.Add(this.FileTextBox);
            Color foreColor = Color.FromKnownColor(KnownColor.WindowText);

            this.FileTextBox.ForeColor = foreColor;
            Color unValidatedColor = Color.FromKnownColor(KnownColor.WindowText);

            this.UnValidatedColor = unValidatedColor;
        }
コード例 #2
0
        public unsafe NewAssetPicker(NewAssetPicker.ObjectType objecttype, int filetype)
        {
            this.InitializeComponent();
            this.AcceptBtn.Enabled = false;
            FilePickerControl filePickerControl = new FilePickerControl();

            this.control = filePickerControl;
            filePickerControl.ViewMode = FilePickerControl.Mode.Composite;
            switch (objecttype)
            {
            case NewAssetPicker.ObjectType.MissingAsset:
                switch (filetype)
                {
                case 0:
                {
                    string[] extensions = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BICDMHKB@wav?$AA@))
                    };
                    this.Text               = "Select new sound";
                    this.control.Root       = "sounds";
                    this.control.ThumbRoot  = "Sounds";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Sound;
                    this.control.Extensions = extensions;
                    break;
                }

                case 1:
                {
                    string[] extensions2 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BFLBBCNI@mat?$AA@))
                    };
                    this.Text               = "Select new decal";
                    this.control.Root       = "decals";
                    this.control.ThumbRoot  = "Decals";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Material;
                    this.control.Extensions = extensions2;
                    break;
                }

                case 2:
                {
                    string[] extensions3 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03MBBDFFBP@4dp?$AA@)),
                        new string((sbyte *)(& < Module >.?? _C@_02CCENMFAC@4d?$AA@))
                    };
                    this.Text               = "Select new object";
                    this.control.Root       = "objects";
                    this.control.ThumbRoot  = "Objects";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Model;
                    this.control.Extensions = extensions3;
                    break;
                }

                case 3:
                {
                    string[] extensions4 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BFLBBCNI@mat?$AA@))
                    };
                    this.Text               = "Select new road";
                    this.control.Root       = "roads";
                    this.control.ThumbRoot  = "Roads";
                    this.control.ViewMode   = FilePickerControl.Mode.Composite;
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Tile;
                    this.control.Extensions = extensions4;
                    break;
                }

                case 4:
                {
                    string[] extensions5 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BFLBBCNI@mat?$AA@))
                    };
                    this.Text               = "Select new tile";
                    this.control.Root       = "tiles";
                    this.control.ThumbRoot  = "Tiles";
                    this.control.ViewMode   = FilePickerControl.Mode.Composite;
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Tile;
                    this.control.Extensions = extensions5;
                    break;
                }

                case 5:
                {
                    string[] extensions6 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_04NPEDKLDA@unit?$AA@))
                    };
                    this.Text               = "Select new unit";
                    this.control.Root       = "units";
                    this.control.ThumbRoot  = "Units";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Unit;
                    this.control.Extensions = extensions6;
                    break;
                }

                case 6:
                {
                    string[] extensions7 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_04NPEDKLDA@unit?$AA@))
                    };
                    this.Text               = "Select new building";
                    this.control.Root       = "buildings";
                    this.control.ThumbRoot  = "Buildings";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Unit;
                    this.control.Extensions = extensions7;
                    break;
                }

                case 7:
                {
                    string[] extensions8 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_02KLACGCIB@fx?$AA@))
                    };
                    this.Text               = "Select new effect";
                    this.control.Root       = "effects";
                    this.control.ThumbRoot  = "Effects";
                    this.control.ViewMode   = FilePickerControl.Mode.Composite;
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Effect;
                    this.control.Extensions = extensions8;
                    break;
                }
                }
                break;

            case NewAssetPicker.ObjectType.UnitEditor:
                switch (filetype)
                {
                case 27:
                {
                    string[] extensions9 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03MBBDFFBP@4dp?$AA@))
                    };
                    this.control.Text       = "Models";
                    this.control.Root       = "units_data";
                    this.control.ThumbRoot  = "units";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Model;
                    this.control.Extensions = extensions9;
                    break;
                }

                case 28:
                {
                    string[] extensions10 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_02KLACGCIB@fx?$AA@))
                    };
                    this.control.Text       = "Effects";
                    this.control.Root       = "effects";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Effect;
                    this.control.Extensions = extensions10;
                    break;
                }

                case 29:
                {
                    string[] extensions11 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03LJIJAGL@tga?$AA@))
                    };
                    this.control.Text       = "Textures";
                    this.control.Root       = "units_data";
                    this.control.ThumbRoot  = "units";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Material;
                    this.control.Extensions = extensions11;
                    break;
                }

                case 30:
                {
                    string[] extensions12 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_04NPEDKLDA@unit?$AA@))
                    };
                    this.control.Text      = "Units";
                    this.control.Root      = "units";
                    this.control.ThumbRoot = "units";
                    this.control.ThumbMode = ThumbnailServer.ThumbType.Unit;
                    this.control.FilterNonEditableUnits = false;
                    this.control.Extensions             = extensions12;
                    break;
                }

                case 31:
                {
                    string[] extensions13 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BICDMHKB@wav?$AA@))
                    };
                    this.control.Text       = "Sound";
                    this.control.Root       = "sounds";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Sound;
                    this.control.Extensions = extensions13;
                    break;
                }

                case 33:
                {
                    string[] extensions14 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BFLBBCNI@mat?$AA@))
                    };
                    this.control.Text       = "Materials";
                    this.control.Root       = "units_data";
                    this.control.ThumbRoot  = "units";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Material;
                    this.control.Extensions = extensions14;
                    break;
                }
                }
                break;

            case NewAssetPicker.ObjectType.EffectEditor:
                switch (filetype)
                {
                case 27:
                {
                    string[] extensions15 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03MBBDFFBP@4dp?$AA@))
                    };
                    this.control.Text       = "Models";
                    this.control.Root       = "effects_data";
                    this.control.ThumbRoot  = "effects";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Model;
                    this.control.Extensions = extensions15;
                    break;
                }

                case 29:
                {
                    string[] extensions16 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03LJIJAGL@tga?$AA@))
                    };
                    this.control.Text       = "Textures";
                    this.control.Root       = "effects_data";
                    this.control.ThumbRoot  = "effects";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Material;
                    this.control.Extensions = extensions16;
                    break;
                }

                case 31:
                {
                    string[] extensions17 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BICDMHKB@wav?$AA@))
                    };
                    this.control.Text       = "Sound";
                    this.control.Root       = "sounds";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Sound;
                    this.control.Extensions = extensions17;
                    break;
                }

                case 33:
                {
                    string[] extensions18 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BFLBBCNI@mat?$AA@))
                    };
                    this.control.Text       = "Materials";
                    this.control.Root       = "decals";
                    this.control.ThumbRoot  = "effects";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Material;
                    this.control.Extensions = extensions18;
                    break;
                }

                case 34:
                {
                    string[] extensions19 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_08PKKGOGAD@particle?$AA@))
                    };
                    this.control.Text       = "Particles";
                    this.control.Root       = "effects_data";
                    this.control.ThumbRoot  = "effects";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Material;
                    this.control.Extensions = extensions19;
                    break;
                }
                }
                break;

            case NewAssetPicker.ObjectType.GameVariablesEditor:
                if (filetype != 30)
                {
                    if (filetype == 36)
                    {
                        string[] extensions20 = new string[]
                        {
                            new string((sbyte *)(& < Module >.?? _C@_03HBNNNHNM@map?$AA@))
                        };
                        this.control.Text       = "Maps";
                        this.control.Root       = "maps";
                        this.control.ThumbRoot  = "map";
                        this.control.ThumbMode  = ThumbnailServer.ThumbType.Map;
                        this.control.Extensions = extensions20;
                    }
                }
                else
                {
                    string[] extensions21 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_04NPEDKLDA@unit?$AA@))
                    };
                    this.control.Text      = "Units";
                    this.control.Root      = "units";
                    this.control.ThumbRoot = "units";
                    this.control.ThumbMode = ThumbnailServer.ThumbType.Unit;
                    this.control.FilterNonEditableUnits = false;
                    this.control.Extensions             = extensions21;
                }
                break;

            case NewAssetPicker.ObjectType.MissionVariablesEditor:
                switch (filetype)
                {
                case 28:
                {
                    string[] extensions22 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_02KLACGCIB@fx?$AA@))
                    };
                    this.control.Text       = "Effects";
                    this.control.Root       = "effects";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Effect;
                    this.control.Extensions = extensions22;
                    break;
                }

                case 30:
                {
                    string[] extensions23 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_04NPEDKLDA@unit?$AA@))
                    };
                    this.control.Text      = "Units";
                    this.control.Root      = "units";
                    this.control.ThumbRoot = "units";
                    this.control.ThumbMode = ThumbnailServer.ThumbType.Unit;
                    this.control.FilterNonEditableUnits = false;
                    this.control.Extensions             = extensions23;
                    break;
                }

                case 31:
                {
                    string[] extensions24 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BICDMHKB@wav?$AA@))
                    };
                    this.control.Text       = "Music";
                    this.control.Root       = "music";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Sound;
                    this.control.Extensions = extensions24;
                    break;
                }

                case 32:
                {
                    string[] extensions25 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03BICDMHKB@wav?$AA@))
                    };
                    this.control.Text       = "Speech";
                    this.control.Root       = "sounds/dialog";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Sound;
                    this.control.Extensions = extensions25;
                    break;
                }

                case 35:
                {
                    string[] extensions26 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03KCBANMCB@loc?$AA@))
                    };
                    this.control.Text       = "Locales";
                    this.control.Root       = "locales";
                    this.control.ThumbRoot  = "locales";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Locale;
                    this.control.Extensions = extensions26;
                    break;
                }

                case 36:
                {
                    string[] extensions27 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03HBNNNHNM@map?$AA@))
                    };
                    this.control.Text       = "Maps";
                    this.control.Root       = "maps";
                    this.control.ThumbRoot  = "map";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Map;
                    this.control.Extensions = extensions27;
                    break;
                }

                case 37:
                {
                    string[] extensions28 = new string[]
                    {
                        new string((sbyte *)(& < Module >.?? _C@_03LJIJAGL@tga?$AA@))
                    };
                    this.control.Text       = "Backgrounds";
                    this.control.Root       = "menu/backgrounds";
                    this.control.ThumbRoot  = "backgrounds";
                    this.control.ThumbMode  = ThumbnailServer.ThumbType.Material;
                    this.control.Extensions = extensions28;
                    break;
                }
                }
                break;

            case NewAssetPicker.ObjectType.SkyBoxLoader:
            {
                string[] extensions29 = new string[]
                {
                    new string((sbyte *)(& < Module >.?? _C@_03LJIJAGL@tga?$AA@))
                };
                this.Text               = "Select new skybox texture";
                this.control.Root       = "skybox";
                this.control.ThumbRoot  = "skybox";
                this.control.ThumbMode  = ThumbnailServer.ThumbType.Box;
                this.control.Extensions = extensions29;
                break;
            }

            case NewAssetPicker.ObjectType.EnvMapLoader:
            {
                string[] extensions30 = new string[]
                {
                    new string((sbyte *)(& < Module >.?? _C@_03LJIJAGL@tga?$AA@))
                };
                this.Text               = "Select new environment map texture";
                this.control.Root       = "envmap";
                this.control.ThumbRoot  = "envmap";
                this.control.ThumbMode  = ThumbnailServer.ThumbType.Box;
                this.control.Extensions = extensions30;
                break;
            }

            case NewAssetPicker.ObjectType.CloudLoader:
            {
                string[] extensions31 = new string[]
                {
                    new string((sbyte *)(& < Module >.?? _C@_03LJIJAGL@tga?$AA@))
                };
                this.Text               = "Select new cloud texture";
                this.control.Root       = "clouds";
                this.control.ThumbRoot  = "clouds";
                this.control.ThumbMode  = ThumbnailServer.ThumbType.Cloud;
                this.control.Extensions = extensions31;
                break;
            }
            }
            this.control.ViewMode              = FilePickerControl.Mode.Treeview;
            this.control.SingleClickSelection += new FilePickerControl.FilePickedHandler(this.FileSelectedSingle);
            this.control.DoubleClickSelection += new FilePickerControl.FilePickedHandler(this.FileSelectedDouble);
            base.Controls.Add(this.control);
        }
コード例 #3
0
        public unsafe PropertyTree(int descriptionlines, NewAssetPicker.ObjectType objecttype, NPropertyClipboard *clipboard)
        {
            this.ItemChanged          = null;
            this.SelectedIndexChanged = null;
            this.TrackSelected        = null;
            Color backColor = Color.FromKnownColor(KnownColor.Window);

            this.BackColor           = backColor;
            this.PropTreeDescription = new Label();
            Color backColor2 = Color.FromKnownColor(KnownColor.Control);

            this.PropTreeDescription.BackColor = backColor2;
            Color foreColor = Color.FromKnownColor(KnownColor.ControlText);

            this.PropTreeDescription.ForeColor   = foreColor;
            this.PropTreeDescription.BorderStyle = BorderStyle.Fixed3D;
            this.PropTreeDescription.Width       = base.Width;
            this.PropTreeDescription.Height      = (this.Font.Height + 2) * descriptionlines;
            this.PropTreeDescription.Dock        = DockStyle.Bottom;
            this.PropTreeCore = new PropertyTreeCore(base.Width, base.Height, base.Height, 2, this.PropTreeDescription, objecttype, clipboard);
            Point location = new Point(0, 20);

            this.PropTreeCore.Location = location;
            ArrayList arrayList = new ArrayList();

            arrayList.Add(new ColumnItem(new string((sbyte *)(& < Module >.?? _C@_07CKMABNOK@Setting?$AA@)), 90));
            arrayList.Add(new ColumnItem(new string((sbyte *)(& < Module >.?? _C@_05LPIJGKJ@Value?$AA@)), 70));
            IEnumerator enumerator = arrayList.GetEnumerator();
            float       proportion = 1f / (float)arrayList.Count;

            if (enumerator.MoveNext())
            {
                do
                {
                    ColumnItem columnItem = enumerator.Current as ColumnItem;
                    ColumnData columnData = new ColumnData(columnItem.Name, (int)((double)columnItem.MinWidth));
                    columnData.Proportion = proportion;
                    this.ColumnDatas.Add(columnData);
                }while (enumerator.MoveNext());
            }
            this.PropTreeHeader        = new HeaderControl(this.PropTreeCore);
            this.PropTreeHeader.Width  = this.PropTreeCore.GetViewControlWidth();
            this.PropTreeHeader.Height = 20;
            this.PropTreeCorner        = new Control();
            Point location2 = new Point(this.PropTreeHeader.Width, 0);

            this.PropTreeCorner.Location = location2;
            this.PropTreeCorner.Width    = base.Width - this.PropTreeHeader.Width;
            this.PropTreeCorner.Height   = 20;
            Color backColor3 = Color.FromKnownColor(KnownColor.Control);

            this.PropTreeCorner.BackColor = backColor3;
            int num = base.Height - this.PropTreeHeader.Height;

            this.PropTreeCore.Height = num - this.PropTreeDescription.Height;
            this.PropTreeHeader.RecalcColumnDatas();
            this.PropTreeHeader.Refresh();
            this.PropTreeCore.Refresh();
            this.OwnControls.Add(this.PropTreeHeader);
            this.OwnControls.Add(this.PropTreeCorner);
            this.OwnControls.Add(this.PropTreeCore);
            this.OwnControls.Add(this.PropTreeDescription);
            this.PropTreeCore.ItemChanged          += new PropertyTreeCore.__Delegate_ItemChanged(this.PropTreeCore_ItemChanged);
            this.PropTreeCore.SelectedIndexChanged += new PropertyTreeCore.__Delegate_SelectedIndexChanged(this.PropTreeCore_SelectedIndexChanged);
            this.PropTreeCore.TrackSelected        += new PropertyTreeCore.TrackSelectedHandler(this.PropTreeCore_TrackSelected);
        }