Bug Fix
This commit is contained in:
@@ -16,7 +16,7 @@ public partial class MainControlPanel : HBoxContainer
|
||||
private Label FreeVolume { get; set; }
|
||||
private Label Stiffness { get; set; }
|
||||
private Tree Compounds { get; set; }
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
EnvTemperature = GetNode<HSlider>("V1/EnvTemperature");
|
||||
@@ -53,13 +53,43 @@ public partial class MainControlPanel : HBoxContainer
|
||||
BuildTree();
|
||||
}
|
||||
|
||||
public void BuildAllTree()
|
||||
{
|
||||
Compounds.Clear();
|
||||
TreeItem root = Compounds.CreateItem();
|
||||
root.SetText(0, "Mixtures: ");
|
||||
int i = 1;
|
||||
foreach (HomogeneousMixture h in GlobalScene.Flask.Content.LayerOrder)
|
||||
{
|
||||
TreeItem sRoot = Compounds.CreateItem(root);
|
||||
sRoot.SetText(0,$"Mixture{i} Amt{h.Amount}");
|
||||
foreach (var group in h.Compounds.GroupBy(x => x.Expression))
|
||||
{
|
||||
TreeItem t = Compounds.CreateItem(root);
|
||||
t.SetText(0, group.Key);
|
||||
t.SetSelectable(0, false);
|
||||
int j = 1;
|
||||
foreach (Compound c in group)
|
||||
{
|
||||
TreeItem x = Compounds.CreateItem(t);
|
||||
x.SetText(0, $"{j}th isomer");
|
||||
x.SetMeta("isoExp", c.IsoRepresentation);
|
||||
j++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BuildTree()
|
||||
{
|
||||
Compounds.Clear();
|
||||
var groups = SelectedMixture.Compounds.GroupBy(x => x.Expression);
|
||||
TreeItem root = Compounds.CreateItem(null);
|
||||
root.SetText(0, "Compounds: ");
|
||||
foreach (var group in groups)
|
||||
{
|
||||
TreeItem t = Compounds.CreateItem();
|
||||
TreeItem t = Compounds.CreateItem(root);
|
||||
t.SetText(0, group.Key);
|
||||
t.SetSelectable(0, false);
|
||||
int i = 1;
|
||||
@@ -108,4 +138,14 @@ public partial class MainControlPanel : HBoxContainer
|
||||
GlobalScene.Flask.ContainerVolume = vol;
|
||||
GlobalScene.Flask.Update();
|
||||
}
|
||||
|
||||
private void SetElasticContainer(bool on)
|
||||
{
|
||||
GlobalScene.ElasticContainer = on;
|
||||
if (on)
|
||||
ContainerVolume.Editable = false;
|
||||
else
|
||||
ContainerVolume.Editable = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user