floater window changes

This commit is contained in:
katzsmile
2010-09-16 00:34:43 +04:00
committed by Paul Chote
parent ad00193a17
commit 2ae6983bc2
2 changed files with 49 additions and 49 deletions

View File

@@ -43,7 +43,6 @@ namespace OpenRA.Editor
} }
void MakeDirty() { dirty = true; } void MakeDirty() { dirty = true; }
string loadedMapName; string loadedMapName;
string currentMod = "ra"; string currentMod = "ra";
TileSet tileset; TileSet tileset;
@@ -51,7 +50,7 @@ namespace OpenRA.Editor
void LoadMap(string mapname) void LoadMap(string mapname)
{ {
tilePalette.Controls.Clear(); tilePalette.Controls.Clear();
actorPalette.Controls.Clear(); actorPalette.Controls.Clear();
resourcePalette.Controls.Clear(); resourcePalette.Controls.Clear();
@@ -94,13 +93,12 @@ namespace OpenRA.Editor
tileset = Rules.TileSets[map.Theater]; tileset = Rules.TileSets[map.Theater];
tileset.LoadTiles(); tileset.LoadTiles();
var palette = new Palette(FileSystem.Open(tileset.Palette), true); var palette = new Palette(FileSystem.Open(tileset.Palette), true);
surface1.Bind(map, tileset, palette); surface1.Bind(map, tileset, palette);
// construct the palette of tiles // construct the palette of tiles
var palettes = new[] { tilePalette, actorPalette, resourcePalette }; var palettes = new[] { tilePalette, actorPalette, resourcePalette };
foreach (var p in palettes) { p.Visible = false; p.SuspendLayout(); } foreach (var p in palettes) { p.Visible = false; p.SuspendLayout(); }
foreach (var t in tileset.Templates) foreach (var t in tileset.Templates)
{ {
try try
@@ -119,7 +117,6 @@ namespace OpenRA.Editor
var template = t.Value; var template = t.Value;
tilePalette.Controls.Add(ibox); tilePalette.Controls.Add(ibox);
tt.SetToolTip(ibox, tt.SetToolTip(ibox,
"{1}:{0} ({2}x{3})".F( "{1}:{0} ({2}x{3})".F(
template.Image, template.Image,
@@ -148,6 +145,7 @@ namespace OpenRA.Editor
BorderStyle = BorderStyle.FixedSingle BorderStyle = BorderStyle.FixedSingle
}; };
ibox.Click += (_, e) => surface1.SetActor(template); ibox.Click += (_, e) => surface1.SetActor(template);
actorPalette.Controls.Add(ibox); actorPalette.Controls.Add(ibox);
@@ -178,6 +176,8 @@ namespace OpenRA.Editor
SizeMode = PictureBoxSizeMode.StretchImage SizeMode = PictureBoxSizeMode.StretchImage
}; };
ibox.Click += (_, e) => surface1.SetResource(template); ibox.Click += (_, e) => surface1.SetResource(template);
resourcePalette.Controls.Add(ibox); resourcePalette.Controls.Add(ibox);
@@ -523,10 +523,8 @@ namespace OpenRA.Editor
private void layersFloaterToolStripMenuItem_Click(object sender, EventArgs e) private void layersFloaterToolStripMenuItem_Click(object sender, EventArgs e)
{ {
using (var npb = new PaletteBox()) var pb = new PaletteBox();
{ pb.Show();
npb.Show();
}
} }
} }
} }

View File

@@ -31,11 +31,11 @@
this.LayerBox = new System.Windows.Forms.ComboBox(); this.LayerBox = new System.Windows.Forms.ComboBox();
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.tilePalette = new System.Windows.Forms.FlowLayoutPanel(); this.pbtilePalette = new System.Windows.Forms.FlowLayoutPanel();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.actorPalette = new System.Windows.Forms.FlowLayoutPanel(); this.pbactorPalette = new System.Windows.Forms.FlowLayoutPanel();
this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage3 = new System.Windows.Forms.TabPage();
this.resourcePalette = new System.Windows.Forms.FlowLayoutPanel(); this.pbresourcePalette = new System.Windows.Forms.FlowLayoutPanel();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout(); this.tabPage2.SuspendLayout();
@@ -67,7 +67,7 @@
// //
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.tilePalette); this.tabPage1.Controls.Add(this.pbtilePalette);
this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1"; this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
@@ -76,19 +76,19 @@
this.tabPage1.Text = "Templates"; this.tabPage1.Text = "Templates";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// tilePalette // pbtilePalette
// //
this.tilePalette.AutoScroll = true; this.pbtilePalette.AutoScroll = true;
this.tilePalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.pbtilePalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tilePalette.Dock = System.Windows.Forms.DockStyle.Fill; this.pbtilePalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.tilePalette.Location = new System.Drawing.Point(3, 3); this.pbtilePalette.Location = new System.Drawing.Point(3, 3);
this.tilePalette.Name = "tilePalette"; this.pbtilePalette.Name = "pbtilePalette";
this.tilePalette.Size = new System.Drawing.Size(180, 325); this.pbtilePalette.Size = new System.Drawing.Size(180, 325);
this.tilePalette.TabIndex = 1; this.pbtilePalette.TabIndex = 1;
// //
// tabPage2 // tabPage2
// //
this.tabPage2.Controls.Add(this.actorPalette); this.tabPage2.Controls.Add(this.pbactorPalette);
this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2"; this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3); this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
@@ -97,19 +97,19 @@
this.tabPage2.Text = "Actors"; this.tabPage2.Text = "Actors";
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.UseVisualStyleBackColor = true;
// //
// actorPalette // pbactorPalette
// //
this.actorPalette.AutoScroll = true; this.pbactorPalette.AutoScroll = true;
this.actorPalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.pbactorPalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.actorPalette.Dock = System.Windows.Forms.DockStyle.Fill; this.pbactorPalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.actorPalette.Location = new System.Drawing.Point(3, 3); this.pbactorPalette.Location = new System.Drawing.Point(3, 3);
this.actorPalette.Name = "actorPalette"; this.pbactorPalette.Name = "pbactorPalette";
this.actorPalette.Size = new System.Drawing.Size(180, 325); this.pbactorPalette.Size = new System.Drawing.Size(180, 325);
this.actorPalette.TabIndex = 2; this.pbactorPalette.TabIndex = 2;
// //
// tabPage3 // tabPage3
// //
this.tabPage3.Controls.Add(this.resourcePalette); this.tabPage3.Controls.Add(this.pbresourcePalette);
this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3"; this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(186, 331); this.tabPage3.Size = new System.Drawing.Size(186, 331);
@@ -117,15 +117,15 @@
this.tabPage3.Text = "Resources"; this.tabPage3.Text = "Resources";
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage3.UseVisualStyleBackColor = true;
// //
// resourcePalette // pbresourcePalette
// //
this.resourcePalette.AutoScroll = true; this.pbresourcePalette.AutoScroll = true;
this.resourcePalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.pbresourcePalette.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.resourcePalette.Dock = System.Windows.Forms.DockStyle.Fill; this.pbresourcePalette.Dock = System.Windows.Forms.DockStyle.Fill;
this.resourcePalette.Location = new System.Drawing.Point(0, 0); this.pbresourcePalette.Location = new System.Drawing.Point(0, 0);
this.resourcePalette.Name = "resourcePalette"; this.pbresourcePalette.Name = "pbresourcePalette";
this.resourcePalette.Size = new System.Drawing.Size(186, 331); this.pbresourcePalette.Size = new System.Drawing.Size(186, 331);
this.resourcePalette.TabIndex = 3; this.pbresourcePalette.TabIndex = 3;
// //
// PaletteBox // PaletteBox
// //
@@ -134,13 +134,14 @@
this.ClientSize = new System.Drawing.Size(194, 378); this.ClientSize = new System.Drawing.Size(194, 378);
this.Controls.Add(this.tabControl1); this.Controls.Add(this.tabControl1);
this.Controls.Add(this.LayerBox); this.Controls.Add(this.LayerBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "PaletteBox"; this.Name = "PaletteBox";
this.ShowIcon = false; this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Palette Box"; this.Text = "Palette Box";
this.TopMost = true;
this.tabControl1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false); this.tabPage2.ResumeLayout(false);
@@ -151,13 +152,14 @@
#endregion #endregion
private System.Windows.Forms.ComboBox LayerBox; public System.Windows.Forms.ComboBox LayerBox;
private System.Windows.Forms.TabControl tabControl1; public System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1; public System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.FlowLayoutPanel tilePalette; public System.Windows.Forms.FlowLayoutPanel pbtilePalette;
private System.Windows.Forms.TabPage tabPage2; public System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.FlowLayoutPanel actorPalette; public System.Windows.Forms.FlowLayoutPanel pbactorPalette;
private System.Windows.Forms.TabPage tabPage3; public System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.FlowLayoutPanel resourcePalette; public System.Windows.Forms.FlowLayoutPanel pbresourcePalette;
} }
} }