git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1132 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2007-07-07 06:09:18 +00:00
parent 31a9197721
commit aa29971bf9
7 changed files with 195 additions and 5 deletions

View File

@@ -10,10 +10,38 @@ namespace OpenRa.TechTreeTest
{
public partial class Form1 : Form
{
TechTree techTree;
TechTree techTree = new TechTree();
public Form1()
{
InitializeComponent();
RefreshList();
}
void RefreshList()
{
buildableItems.Controls.Clear();
foreach (Building b in techTree.BuildableItems)
{
PictureBox box = new PictureBox();
box.SizeMode = PictureBoxSizeMode.AutoSize;
box.Image = b.Icon;
toolTip1.SetToolTip(box, b.Tag);
buildableItems.Controls.Add(box);
Building k = b;
box.Click += delegate { Build(k); };
}
}
void Build(Building b)
{
techTree.Build(b.Tag);
RefreshList();
}
}
}