!B (Sandbox) (CE-21795) Importing models with multisubmaterials via fbx switches...
[CRYENGINE.git] / Code / Tools / Statoscope / Statoscope / ProfilerItemInfoControl.cs
blob36dd7b1a3a7f78e9a7ff692401181ebc49351101
1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
3 using System;
4 using System.Collections.Generic;
5 using System.ComponentModel;
6 using System.Drawing;
7 using System.Data;
8 using System.Linq;
9 using System.Text;
10 using System.Windows.Forms;
12 namespace Statoscope
14 partial class ProfilerItemInfoControl : DesignableBasePIIC
16 public ProfilerItemInfoControl(LogControl logControl, ProfilerRDI prdiTree, RDICheckboxTreeView<ProfilerRDI> prdiCTV)
17 : base(logControl, prdiTree, prdiCTV)
19 InitializeComponent();
20 ItemPathLabel = itemPathLabel;
23 protected override ProfilerRDI RDI
25 set
27 base.RDI = value;
29 itemPathLabel.Text = RDI.Path;
30 ItemPathLabelToolTip.SetToolTip(itemPathLabel, RDI.Path);
32 itemColourGroupBox.Enabled = (RDI.IsLeaf || RDI.IsCollapsed);
33 itemColourButton.BackColor = RDI.Colour.ConvertToSysDrawCol();
34 itemColourGroupBox.Show();
36 itemDescriptionLabel.Text = "Value: " + RDI.LeafName + Environment.NewLine;
37 if (LogControl.m_logViews.Count > 1)
39 EItemType itemType = LogControl.m_logViews[0].m_baseLogData.ItemMetaData[RDI.LeafPath].m_type;
40 bool itemTypeMatches = true;
42 for (int i = 0; i < LogControl.m_logViews.Count; i++)
44 ItemMetaData itemMetaData;
45 bool hasMetaData = LogControl.m_logViews[i].m_baseLogData.ItemMetaData.TryGetValue(RDI.LeafPath, out itemMetaData);
46 if (hasMetaData && itemMetaData.m_type != itemType)
48 itemTypeMatches = false;
49 break;
53 itemDescriptionLabel.Text += "Type: " + (itemTypeMatches ? (itemType == EItemType.Float ? "Float" : "Int") : "Mixed");
55 else
57 ItemMetaData itemMetaData = LogControl.m_logViews[0].m_baseLogData.ItemMetaData[RDI.LeafPath];
58 itemDescriptionLabel.Text += "Type: " + (itemMetaData.m_type == EItemType.Float ? "Float" : "Int");
61 itemStatsGroupBox.Hide();
62 itemStatsGroupBox.Controls.Clear();
63 itemStatsGroupBox.Controls.Add(new StatsListView(LogControl.m_logViews, RDI.LeafPath));
64 itemStatsGroupBox.Enabled = true;
65 itemStatsGroupBox.Show();
69 protected override void SetItemColour(RGB colour)
71 base.SetItemColour(colour);
72 itemColourButton.BackColor = colour.ConvertToSysDrawCol();
75 public override void OnLogChanged()
77 itemStatsGroupBox.Invalidate(true);
80 private void itemColourButton_Click(object sender, EventArgs e)
82 ItemColourButton_Click();
85 private void itemColourRandomButton_Click(object sender, EventArgs e)
87 ItemColourRandomButton_Click();
91 class DesignableBasePIIC : RDIInfoControl<ProfilerRDI>
93 public DesignableBasePIIC()
94 : this(null, null, null)
98 public DesignableBasePIIC(LogControl logControl, ProfilerRDI prdiTree, RDICheckboxTreeView<ProfilerRDI> prdiCTV)
99 : base(logControl, prdiTree, prdiCTV)