Inheritance: Inventory.Entry
コード例 #1
0
ファイル: ObjectRenderer.cs プロジェクト: NanoLP/FC3Editor
 private static void TriggerListeners(ObjectInventory.Entry entry, Image img)
 {
     ObjectRenderer.IListener[] array = ObjectRenderer.m_listeners.ToArray();
     for (int i = 0; i < array.Length; i++)
     {
         ObjectRenderer.IListener listener = array[i];
         listener.ProcessObject(entry, img);
     }
     if (img != null)
     {
         img.Dispose();
     }
 }
コード例 #2
0
ファイル: ObjectRenderer.cs プロジェクト: NanoLP/FC3Editor
        private static void GetSnapshot(out Image img, out ObjectInventory.Entry entry)
        {
            int      num;
            int      num2;
            int      num3;
            int      num4;
            Snapshot snapshot = new Snapshot(Binding.FCE_ObjectRenderer_GetSnapshot(out num, out num2, out num3, out num4));
            int      num5     = num3 - num;
            int      num6     = num4 - num2;

            if (num5 > num6)
            {
                int num7 = (num5 - num6) / 2;
                num2 -= num7;
                num4 += num7;
            }
            else
            {
                int num8 = (num6 - num5) / 2;
                num  -= num8;
                num3 += num8;
            }
            Image  image  = snapshot.GetImage();
            Bitmap bitmap = new Bitmap(256, 256);

            img = bitmap;
            using (Graphics graphics = Graphics.FromImage(img))
            {
                graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
                graphics.DrawImage(image, new Rectangle(3, 3, bitmap.Width - 6, bitmap.Height - 6), new Rectangle(num, num2, num3 - num, num4 - num2), GraphicsUnit.Pixel);
            }
            entry = new ObjectInventory.Entry(Binding.FCE_ObjectRenderer_GetSnapshotEntry());
            Directory.CreateDirectory(ObjectRenderer.cachePath);
            try
            {
                ObjectRenderer.WritePNG(ObjectRenderer.cachePath + entry.Id + ".png", bitmap);
            }
            catch (Exception)
            {
            }
        }
コード例 #3
0
ファイル: ToolObject.cs プロジェクト: Azerothian/fc3editor
 protected void OnValueChanged(ObjectInventory.Entry value)
 {
     this.m_value = value;
     if (this.ValueChanged != null)
     {
         this.ValueChanged(this, new EventArgs());
     }
 }
コード例 #4
0
ファイル: ToolObject.cs プロジェクト: Azerothian/fc3editor
 protected void OnFolderChanged(ObjectInventory.Entry folder)
 {
     this.m_folder = folder;
     if (this.FolderChanged != null)
     {
         this.FolderChanged(this, new EventArgs());
     }
 }
コード例 #5
0
ファイル: ToolObject.cs プロジェクト: Azerothian/fc3editor
 public ParamInventoryObject(string display)
     : base(display)
 {
     this.m_searchDirectory = (ObjectInventory.Entry)ObjectInventory.Instance.CreateDirectory();
 }
コード例 #6
0
 private static void GetSnapshot(out Image img, out ObjectInventory.Entry entry)
 {
     int num;
     int num2;
     int num3;
     int num4;
     Snapshot snapshot = new Snapshot(Binding.FCE_ObjectRenderer_GetSnapshot(out num, out num2, out num3, out num4));
     int num5 = num3 - num;
     int num6 = num4 - num2;
     if (num5 > num6)
     {
         int num7 = (num5 - num6) / 2;
         num2 -= num7;
         num4 += num7;
     }
     else
     {
         int num8 = (num6 - num5) / 2;
         num -= num8;
         num3 += num8;
     }
     Image image = snapshot.GetImage();
     Bitmap bitmap = new Bitmap(256, 256);
     img = bitmap;
     using (Graphics graphics = Graphics.FromImage(img))
     {
         graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
         graphics.DrawImage(image, new Rectangle(3, 3, bitmap.Width - 6, bitmap.Height - 6), new Rectangle(num, num2, num3 - num, num4 - num2), GraphicsUnit.Pixel);
     }
     entry = new ObjectInventory.Entry(Binding.FCE_ObjectRenderer_GetSnapshotEntry());
     Directory.CreateDirectory(ObjectRenderer.cachePath);
     try
     {
         ObjectRenderer.WritePNG(ObjectRenderer.cachePath + entry.Id + ".png", bitmap);
     }
     catch (Exception)
     {
     }
 }
コード例 #7
0
ファイル: ObjectAdmin.cs プロジェクト: Azerothian/fc3editor
 private void objectTree_AfterSelect(object sender, TreeViewEventArgs e)
 {
     if (this.m_dragging)
     {
         return;
     }
     ObjectInventory.Entry entry = (ObjectInventory.Entry)e.Node.Tag;
     this.m_root = entry;
     this.objectList.Entries = entry.Children;
 }
コード例 #8
0
ファイル: ObjectAdmin.cs プロジェクト: Azerothian/fc3editor
 private void objectList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.objectList.SelectedItems.Count == 0)
     {
         this.m_currentEntry = null;
     }
     else
     {
         this.m_currentEntry = (ObjectInventory.Entry)this.objectList.SelectedItems[0].Tag;
     }
     this.UpdateProperties();
 }
コード例 #9
0
ファイル: ObjectLegoBox.cs プロジェクト: NanoLP/FC3Editor
 public static void AddEntry(ObjectInventory.Entry entry)
 {
     Binding.FCE_ObjectLegoBox_AddEntry(entry.Pointer);
 }
コード例 #10
0
 public static EditorObject CreateFromEntry(ObjectInventory.Entry entry, bool managed)
 {
     return(new EditorObject(Binding.FCE_Object_Create_FromEntry(entry.Pointer, managed)));
 }
コード例 #11
0
 private void InitializeComponent()
 {
     this.components = new Container();
     this.label1 = new Label();
     this.tableLayoutPanel1 = new TableLayoutPanel();
     this.label4 = new Label();
     this.label3 = new Label();
     this.label2 = new Label();
     this.selObjNameLabel = new Label();
     this.selObjSizeLabel = new Label();
     this.textBoxSearchObjInv = new TextBox();
     this.parentButton = new NomadButton();
     this.objectList = new InventoryList(this.components);
     this.categoryComboBox = new IndentedComboBox();
     this.inventoryTree = new InventoryTree();
     this.tableLayoutPanel1.SuspendLayout();
     base.SuspendLayout();
     this.label1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
     this.label1.Location = new Point(3, 2);
     this.label1.Name = "label1";
     this.label1.Size = new Size(203, 13);
     this.label1.TabIndex = 1;
     this.label1.Text = "PARAM_OBJECT_BROWSER";
     this.tableLayoutPanel1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
     this.tableLayoutPanel1.AutoSize = true;
     this.tableLayoutPanel1.ColumnCount = 2;
     this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f));
     this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f));
     this.tableLayoutPanel1.Controls.Add(this.label4, 0, 0);
     this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
     this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
     this.tableLayoutPanel1.Controls.Add(this.selObjNameLabel, 1, 1);
     this.tableLayoutPanel1.Controls.Add(this.selObjSizeLabel, 1, 2);
     this.tableLayoutPanel1.Controls.Add(this.textBoxSearchObjInv, 1, 0);
     this.tableLayoutPanel1.GrowStyle = TableLayoutPanelGrowStyle.FixedSize;
     this.tableLayoutPanel1.Location = new Point(3, 365);
     this.tableLayoutPanel1.Name = "tableLayoutPanel1";
     this.tableLayoutPanel1.RowCount = 3;
     this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 23f));
     this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 16f));
     this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 16f));
     this.tableLayoutPanel1.Size = new Size(203, 55);
     this.tableLayoutPanel1.TabIndex = 9;
     this.label4.Dock = DockStyle.Fill;
     this.label4.Location = new Point(0, 0);
     this.label4.Margin = new Padding(0);
     this.label4.Name = "label4";
     this.label4.Size = new Size(101, 23);
     this.label4.TabIndex = 9;
     this.label4.Text = "PARAM_OBJECT_SEARCH";
     this.label4.TextAlign = ContentAlignment.MiddleLeft;
     this.label3.Dock = DockStyle.Fill;
     this.label3.Location = new Point(0, 39);
     this.label3.Margin = new Padding(0);
     this.label3.Name = "label3";
     this.label3.Size = new Size(101, 16);
     this.label3.TabIndex = 6;
     this.label3.Text = "PARAM_OBJECT_BROWSER_SIZE";
     this.label3.TextAlign = ContentAlignment.MiddleLeft;
     this.label2.Dock = DockStyle.Fill;
     this.label2.Location = new Point(0, 23);
     this.label2.Margin = new Padding(0);
     this.label2.Name = "label2";
     this.label2.Size = new Size(101, 16);
     this.label2.TabIndex = 3;
     this.label2.Text = "PARAM_OBJECT_BROWSER_SELECTED";
     this.label2.TextAlign = ContentAlignment.MiddleLeft;
     this.selObjNameLabel.BorderStyle = BorderStyle.Fixed3D;
     this.selObjNameLabel.Dock = DockStyle.Fill;
     this.selObjNameLabel.Location = new Point(101, 23);
     this.selObjNameLabel.Margin = new Padding(0);
     this.selObjNameLabel.Name = "selObjNameLabel";
     this.selObjNameLabel.Size = new Size(102, 16);
     this.selObjNameLabel.TabIndex = 5;
     this.selObjNameLabel.Text = "None";
     this.selObjNameLabel.TextAlign = ContentAlignment.MiddleRight;
     this.selObjSizeLabel.BorderStyle = BorderStyle.Fixed3D;
     this.selObjSizeLabel.Dock = DockStyle.Fill;
     this.selObjSizeLabel.Location = new Point(101, 39);
     this.selObjSizeLabel.Margin = new Padding(0);
     this.selObjSizeLabel.Name = "selObjSizeLabel";
     this.selObjSizeLabel.Size = new Size(102, 16);
     this.selObjSizeLabel.TabIndex = 7;
     this.selObjSizeLabel.Text = "None";
     this.selObjSizeLabel.TextAlign = ContentAlignment.MiddleRight;
     this.textBoxSearchObjInv.Dock = DockStyle.Fill;
     this.textBoxSearchObjInv.Location = new Point(101, 0);
     this.textBoxSearchObjInv.Margin = new Padding(0);
     this.textBoxSearchObjInv.Name = "textBoxSearchObjInv";
     this.textBoxSearchObjInv.Size = new Size(102, 20);
     this.textBoxSearchObjInv.TabIndex = 8;
     this.textBoxSearchObjInv.KeyDown += new KeyEventHandler(this.textBoxSearchObjInv_KeyDown);
     this.parentButton.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
     this.parentButton.AutoSizeMode = AutoSizeMode.GrowAndShrink;
     this.parentButton.Image = Resources.up;
     this.parentButton.Location = new Point(182, 17);
     this.parentButton.Name = "parentButton";
     this.parentButton.Size = new Size(26, 26);
     this.parentButton.TabIndex = 8;
     this.parentButton.UseVisualStyleBackColor = true;
     this.parentButton.Click += new EventHandler(this.parentButton_Click);
     this.objectList.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
     this.objectList.Entries = null;
     this.objectList.FirstVisibleIndex = -1;
     this.objectList.HideSelection = false;
     this.objectList.Location = new Point(3, 43);
     this.objectList.MultiSelect = false;
     this.objectList.Name = "objectList";
     this.objectList.OwnerDraw = true;
     this.objectList.Size = new Size(203, 319);
     this.objectList.TabIndex = 7;
     this.objectList.UseCompatibleStateImageBehavior = false;
     this.objectList.View = View.Tile;
     this.objectList.SelectedIndexChanged += new EventHandler(this.objectList_SelectedIndexChanged);
     this.objectList.DoubleClick += new EventHandler(this.objectList_DoubleClick);
     this.categoryComboBox.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
     this.categoryComboBox.Location = new Point(3, 18);
     this.categoryComboBox.MaximumSize = new Size(9999, 24);
     this.categoryComboBox.MinimumSize = new Size(0, 24);
     this.categoryComboBox.Name = "categoryComboBox";
     this.categoryComboBox.SelectedItem = null;
     this.categoryComboBox.Size = new Size(176, 24);
     this.categoryComboBox.TabIndex = 6;
     this.categoryComboBox.SelectedItemChanged += new EventHandler<IndentedComboboxItemEventArgs>(this.indentedComboBox1_SelectedItemChanged);
     this.inventoryTree.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
     this.inventoryTree.HideSelection = false;
     this.inventoryTree.ImageIndex = 0;
     this.inventoryTree.Location = new Point(3, 18);
     this.inventoryTree.Name = "inventoryTree";
     this.inventoryTree.OnlyDirectories = false;
     this.inventoryTree.Root = null;
     this.inventoryTree.SelectedImageIndex = 0;
     this.inventoryTree.ShowRoot = false;
     this.inventoryTree.Size = new Size(203, 190);
     this.inventoryTree.TabIndex = 0;
     this.inventoryTree.Value = null;
     this.inventoryTree.Visible = false;
     this.inventoryTree.ValueChanged += new EventHandler(this.inventoryTree_ValueChanged);
     base.AutoScaleDimensions = new SizeF(6f, 13f);
     base.AutoScaleMode = AutoScaleMode.Font;
     base.Controls.Add(this.tableLayoutPanel1);
     base.Controls.Add(this.parentButton);
     base.Controls.Add(this.objectList);
     base.Controls.Add(this.categoryComboBox);
     base.Controls.Add(this.label1);
     base.Controls.Add(this.inventoryTree);
     base.Name = "ParamObjectInventoryTree";
     base.Size = new Size(209, 425);
     this.tableLayoutPanel1.ResumeLayout(false);
     this.tableLayoutPanel1.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
コード例 #12
0
 public ObjectInventory.Entry CreatePrefabObject(ObjectInventory.Entry parent, string id)
 {
     return(new ObjectInventory.Entry(Binding.FCE_Inventory_Object_CreatePrefabObject(parent.Pointer, id)));
 }
コード例 #13
0
 public ObjectInventory.Entry CreateDirectory(ObjectInventory.Entry parent)
 {
     return(new ObjectInventory.Entry(Binding.FCE_Inventory_Object_CreateDirectory(parent.Pointer)));
 }
コード例 #14
0
ファイル: ObjectRenderer.cs プロジェクト: NanoLP/FC3Editor
 public static void RequestObjectImage(ObjectInventory.Entry entry)
 {
 }
コード例 #15
0
ファイル: ObjectRenderer.cs プロジェクト: NanoLP/FC3Editor
 private static void RenderObject(ObjectInventory.Entry entry)
 {
     Binding.FCE_ObjectRenderer_RenderObject(entry.Pointer);
 }