diff --git a/Editor/AGS.Editor/GUI/GUIController.cs b/Editor/AGS.Editor/GUI/GUIController.cs
index d7a1121fbbe..08bfe0cb245 100644
--- a/Editor/AGS.Editor/GUI/GUIController.cs
+++ b/Editor/AGS.Editor/GUI/GUIController.cs
@@ -23,7 +23,6 @@ public class GUIController : IGUIController
public const string FILE_MENU_ID = "fileToolStripMenuItem";
public const string HELP_MENU_ID = "HelpMenu";
private const string CONTROL_ID_SPLIT = "^!^";
- private const string TEMPLATE_INTRO_FILE = "template.txt";
private const string ROOM_TEMPLATE_ID_FILE = "rtemplate.dat";
private const int ROOM_TEMPLATE_ID_FILE_SIGNATURE = 0x74673812;
private const string WINDOW_CONFIG_FILENAME = "WindowConfig.json";
@@ -1153,14 +1152,6 @@ private bool CreateNewGame(string newGamePath, string newFileName, string newGam
Factory.AGSEditor.Settings.MessageBoxOnCompile = oldMessageBoxSetting;
}
- if (File.Exists(TEMPLATE_INTRO_FILE))
- {
- StreamReader sr = new StreamReader(TEMPLATE_INTRO_FILE);
- string introText = sr.ReadToEnd();
- sr.Close();
-
- Factory.GUIController.ShowMessage(introText, MessageBoxIcon.Information);
- }
createdSuccessfully = true;
}
}
diff --git a/Editor/AGS.Editor/GUI/StartNewGameWizardPage.Designer.cs b/Editor/AGS.Editor/GUI/StartNewGameWizardPage.Designer.cs
index a4553b2c364..a94d92be98d 100644
--- a/Editor/AGS.Editor/GUI/StartNewGameWizardPage.Designer.cs
+++ b/Editor/AGS.Editor/GUI/StartNewGameWizardPage.Designer.cs
@@ -29,41 +29,82 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.tbDescription = new System.Windows.Forms.TextBox();
this.lstTemplates = new System.Windows.Forms.ListView();
this.label1 = new System.Windows.Forms.Label();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox1.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
- this.groupBox1.Controls.Add(this.lstTemplates);
+ this.groupBox1.Controls.Add(this.tableLayoutPanel1);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(9, 7);
+ this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
this.groupBox1.Size = new System.Drawing.Size(520, 219);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Select Template";
//
+ // tbDescription
+ //
+ this.tbDescription.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.tbDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tbDescription.Location = new System.Drawing.Point(4, 157);
+ this.tbDescription.Margin = new System.Windows.Forms.Padding(4);
+ this.tbDescription.Multiline = true;
+ this.tbDescription.Name = "tbDescription";
+ this.tbDescription.ReadOnly = true;
+ this.tbDescription.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
+ this.tbDescription.Size = new System.Drawing.Size(764, 145);
+ this.tbDescription.TabIndex = 2;
+ //
// lstTemplates
//
+ this.lstTemplates.Dock = System.Windows.Forms.DockStyle.Fill;
this.lstTemplates.HideSelection = false;
this.lstTemplates.Location = new System.Drawing.Point(14, 41);
+ this.lstTemplates.Margin = new System.Windows.Forms.Padding(4);
this.lstTemplates.MultiSelect = false;
this.lstTemplates.Name = "lstTemplates";
this.lstTemplates.Size = new System.Drawing.Size(491, 167);
this.lstTemplates.TabIndex = 1;
this.lstTemplates.UseCompatibleStateImageBehavior = false;
+ this.lstTemplates.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.lstTemplates_ItemSelectionChanged);
//
// label1
//
this.label1.AutoSize = true;
+ this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.Location = new System.Drawing.Point(13, 19);
+ this.label1.Margin = new System.Windows.Forms.Padding(8);
this.label1.Name = "label1";
+ this.label1.Padding = new System.Windows.Forms.Padding(8);
this.label1.Size = new System.Drawing.Size(425, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Your new game is created based on a template. Please select the one you\'d like to" +
- " use:";
+ " use:";
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.AutoSize = true;
+ this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.tableLayoutPanel1.ColumnCount = 1;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Controls.Add(this.lstTemplates, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.tbDescription, 0, 1);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 61);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 2;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(772, 306);
+ this.tableLayoutPanel1.TabIndex = 1;
//
// StartNewGameWizardPage
//
@@ -71,10 +112,14 @@ private void InitializeComponent()
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.groupBox1);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Margin = new System.Windows.Forms.Padding(4);
+ this.MinimumSize = new System.Drawing.Size(491, 167);
this.Name = "StartNewGameWizardPage";
this.Size = new System.Drawing.Size(1017, 632);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
}
@@ -84,5 +129,7 @@ private void InitializeComponent()
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ListView lstTemplates;
private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox tbDescription;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}
diff --git a/Editor/AGS.Editor/GUI/StartNewGameWizardPage.cs b/Editor/AGS.Editor/GUI/StartNewGameWizardPage.cs
index 6f33431abab..811bf3ad936 100644
--- a/Editor/AGS.Editor/GUI/StartNewGameWizardPage.cs
+++ b/Editor/AGS.Editor/GUI/StartNewGameWizardPage.cs
@@ -63,5 +63,14 @@ public override void PageShown()
{
lstTemplates.Focus();
}
+
+ private void lstTemplates_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
+ {
+ if (e.IsSelected && e.ItemIndex >= 0)
+ tbDescription.Text = string.IsNullOrWhiteSpace(_templates[e.ItemIndex].Description)
+ ? "No description available." : _templates[e.ItemIndex].Description;
+ else
+ tbDescription.Text = "";
+ }
}
}
diff --git a/Editor/AGS.Editor/GUI/StartNewGameWizardPage.resx b/Editor/AGS.Editor/GUI/StartNewGameWizardPage.resx
index ff31a6db56e..c7e0d4bdf13 100644
--- a/Editor/AGS.Editor/GUI/StartNewGameWizardPage.resx
+++ b/Editor/AGS.Editor/GUI/StartNewGameWizardPage.resx
@@ -112,9 +112,9 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
\ No newline at end of file
diff --git a/Editor/AGS.Editor/GUI/WizardDialog.Designer.cs b/Editor/AGS.Editor/GUI/WizardDialog.Designer.cs
index 2078b0ce0f0..fa1738c84b0 100644
--- a/Editor/AGS.Editor/GUI/WizardDialog.Designer.cs
+++ b/Editor/AGS.Editor/GUI/WizardDialog.Designer.cs
@@ -41,25 +41,33 @@ private void InitializeComponent()
this.lblIntroText = new System.Windows.Forms.Label();
this.lblTitle = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.panel1.SuspendLayout();
this.pnlMainPages.SuspendLayout();
this.pnlHeader.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
- this.groupBox1.Location = new System.Drawing.Point(12, 295);
+ this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox1.Location = new System.Drawing.Point(18, 442);
+ this.groupBox1.Margin = new System.Windows.Forms.Padding(6);
this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(516, 10);
+ this.groupBox1.Padding = new System.Windows.Forms.Padding(6);
+ this.groupBox1.Size = new System.Drawing.Size(774, 15);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// btnNext
//
- this.btnNext.Location = new System.Drawing.Point(353, 311);
+ this.btnNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnNext.Location = new System.Drawing.Point(540, 6);
+ this.btnNext.Margin = new System.Windows.Forms.Padding(6);
this.btnNext.Name = "btnNext";
- this.btnNext.Size = new System.Drawing.Size(83, 27);
+ this.btnNext.Size = new System.Drawing.Size(122, 40);
this.btnNext.TabIndex = 1;
this.btnNext.Text = "&Next >";
this.btnNext.UseVisualStyleBackColor = true;
@@ -67,19 +75,23 @@ private void InitializeComponent()
//
// btnCancel
//
+ this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.btnCancel.Location = new System.Drawing.Point(445, 311);
+ this.btnCancel.Location = new System.Drawing.Point(674, 6);
+ this.btnCancel.Margin = new System.Windows.Forms.Padding(6);
this.btnCancel.Name = "btnCancel";
- this.btnCancel.Size = new System.Drawing.Size(83, 27);
+ this.btnCancel.Size = new System.Drawing.Size(122, 40);
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "&Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// btnBack
//
- this.btnBack.Location = new System.Drawing.Point(264, 311);
+ this.btnBack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnBack.Location = new System.Drawing.Point(406, 6);
+ this.btnBack.Margin = new System.Windows.Forms.Padding(6);
this.btnBack.Name = "btnBack";
- this.btnBack.Size = new System.Drawing.Size(83, 27);
+ this.btnBack.Size = new System.Drawing.Size(122, 40);
this.btnBack.TabIndex = 3;
this.btnBack.Text = "< &Back";
this.btnBack.UseVisualStyleBackColor = true;
@@ -87,25 +99,31 @@ private void InitializeComponent()
//
// panel1
//
+ this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackColor = System.Drawing.Color.White;
this.panel1.Controls.Add(this.pnlMainPages);
this.panel1.Controls.Add(this.lblIntroText);
this.panel1.Controls.Add(this.lblTitle);
this.panel1.Controls.Add(this.pictureBox1);
- this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Margin = new System.Windows.Forms.Padding(6);
this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(540, 300);
+ this.panel1.Size = new System.Drawing.Size(810, 450);
this.panel1.TabIndex = 5;
//
// pnlMainPages
//
+ this.pnlMainPages.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.pnlMainPages.BackColor = System.Drawing.SystemColors.Control;
this.pnlMainPages.Controls.Add(this.pnlHeader);
- this.pnlMainPages.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlMainPages.Location = new System.Drawing.Point(0, 0);
+ this.pnlMainPages.Margin = new System.Windows.Forms.Padding(6);
this.pnlMainPages.Name = "pnlMainPages";
- this.pnlMainPages.Size = new System.Drawing.Size(540, 300);
+ this.pnlMainPages.Size = new System.Drawing.Size(810, 450);
this.pnlMainPages.TabIndex = 8;
//
// pnlHeader
@@ -115,16 +133,18 @@ private void InitializeComponent()
this.pnlHeader.Controls.Add(this.lblHeader1);
this.pnlHeader.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlHeader.Location = new System.Drawing.Point(0, 0);
+ this.pnlHeader.Margin = new System.Windows.Forms.Padding(6);
this.pnlHeader.Name = "pnlHeader";
- this.pnlHeader.Size = new System.Drawing.Size(540, 59);
+ this.pnlHeader.Size = new System.Drawing.Size(810, 88);
this.pnlHeader.TabIndex = 0;
//
// lblHeader2
//
this.lblHeader2.AutoSize = true;
- this.lblHeader2.Location = new System.Drawing.Point(23, 26);
+ this.lblHeader2.Location = new System.Drawing.Point(23, 43);
+ this.lblHeader2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.lblHeader2.Name = "lblHeader2";
- this.lblHeader2.Size = new System.Drawing.Size(35, 13);
+ this.lblHeader2.Size = new System.Drawing.Size(54, 21);
this.lblHeader2.TabIndex = 1;
this.lblHeader2.Text = "label1";
//
@@ -132,29 +152,32 @@ private void InitializeComponent()
//
this.lblHeader1.AutoSize = true;
this.lblHeader1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lblHeader1.Location = new System.Drawing.Point(20, 8);
+ this.lblHeader1.Location = new System.Drawing.Point(20, 13);
+ this.lblHeader1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.lblHeader1.Name = "lblHeader1";
- this.lblHeader1.Size = new System.Drawing.Size(79, 13);
+ this.lblHeader1.Size = new System.Drawing.Size(119, 21);
this.lblHeader1.TabIndex = 0;
this.lblHeader1.Text = "wizard name";
//
// lblIntroText
//
- this.lblIntroText.Location = new System.Drawing.Point(227, 93);
+ this.lblIntroText.Location = new System.Drawing.Point(340, 140);
+ this.lblIntroText.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.lblIntroText.Name = "lblIntroText";
- this.lblIntroText.Size = new System.Drawing.Size(291, 199);
+ this.lblIntroText.Size = new System.Drawing.Size(700, 250);
this.lblIntroText.TabIndex = 7;
- this.lblIntroText.Text = "This wizard will guide you through doing something or other, and if youér lucky s" +
- "omething else.";
+ this.lblIntroText.Text = "This wizard will guide you through doing something or other, and if you\'r lucky s" +
+ "omething else.";
//
// lblTitle
//
this.lblTitle.AutoSize = true;
this.lblTitle.Font = new System.Drawing.Font("Tahoma", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lblTitle.Location = new System.Drawing.Point(227, 13);
- this.lblTitle.MaximumSize = new System.Drawing.Size(320, 0);
+ this.lblTitle.Location = new System.Drawing.Point(339, 21);
+ this.lblTitle.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+ this.lblTitle.MaximumSize = new System.Drawing.Size(550, 0);
this.lblTitle.Name = "lblTitle";
- this.lblTitle.Size = new System.Drawing.Size(231, 66);
+ this.lblTitle.Size = new System.Drawing.Size(527, 98);
this.lblTitle.TabIndex = 6;
this.lblTitle.Text = "Welcome to the Something Wizard";
//
@@ -162,26 +185,48 @@ private void InitializeComponent()
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
+ this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
this.pictureBox1.Name = "pictureBox1";
- this.pictureBox1.Size = new System.Drawing.Size(210, 300);
+ this.pictureBox1.Size = new System.Drawing.Size(315, 450);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 5;
this.pictureBox1.TabStop = false;
//
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.AutoSize = true;
+ this.tableLayoutPanel1.ColumnCount = 5;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 134F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 134F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 134F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 8F));
+ this.tableLayoutPanel1.Controls.Add(this.btnBack, 1, 0);
+ this.tableLayoutPanel1.Controls.Add(this.btnCancel, 3, 0);
+ this.tableLayoutPanel1.Controls.Add(this.btnNext, 2, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.tableLayoutPanel1.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 462);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 1;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(810, 52);
+ this.tableLayoutPanel1.TabIndex = 6;
+ //
// WizardDialog
//
this.AcceptButton = this.btnNext;
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+ this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+ this.AutoSize = true;
this.CancelButton = this.btnCancel;
- this.ClientSize = new System.Drawing.Size(540, 343);
+ this.ClientSize = new System.Drawing.Size(810, 514);
+ this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.panel1);
- this.Controls.Add(this.btnBack);
- this.Controls.Add(this.btnCancel);
- this.Controls.Add(this.btnNext);
this.Controls.Add(this.groupBox1);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.Margin = new System.Windows.Forms.Padding(6);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "WizardDialog";
@@ -193,7 +238,9 @@ private void InitializeComponent()
this.pnlHeader.ResumeLayout(false);
this.pnlHeader.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
+ this.PerformLayout();
}
@@ -211,5 +258,6 @@ private void InitializeComponent()
private System.Windows.Forms.Panel pnlHeader;
private System.Windows.Forms.Label lblHeader2;
private System.Windows.Forms.Label lblHeader1;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
}
}
\ No newline at end of file
diff --git a/Editor/AGS.Editor/GUI/WizardDialog.cs b/Editor/AGS.Editor/GUI/WizardDialog.cs
index 5f3a1016657..57b4318b7f7 100644
--- a/Editor/AGS.Editor/GUI/WizardDialog.cs
+++ b/Editor/AGS.Editor/GUI/WizardDialog.cs
@@ -28,6 +28,13 @@ public WizardDialog(string wizardName, string introText, List pages)
this.btnBack.Enabled = false;
_pageNumber = 0;
_pages = pages;
+ foreach (var page in pages)
+ {
+ if (page.MinimumSize.Width > pnlMainPages.Width)
+ pnlMainPages.Width = page.MinimumSize.Width;
+ if (page.MinimumSize.Height > pnlMainPages.Height - pnlHeader.Height)
+ pnlMainPages.Height = page.MinimumSize.Height + pnlHeader.Height;
+ }
Utilities.CheckLabelWidthsOnForm(this);
}
diff --git a/Editor/AGS.Editor/GUI/WizardDialog.resx b/Editor/AGS.Editor/GUI/WizardDialog.resx
index d460ca7d78b..82674c607e6 100644
--- a/Editor/AGS.Editor/GUI/WizardDialog.resx
+++ b/Editor/AGS.Editor/GUI/WizardDialog.resx
@@ -112,12 +112,12 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
Qk3W5AIAAAAAADYAAAAoAAAA0gAAACwBAAABABgAAAAAAAAAAACIEQAAiBEAAAAAAAAAAAAAHx4eDw8P
diff --git a/Editor/AGS.Native/NativeMethods.cpp b/Editor/AGS.Native/NativeMethods.cpp
index 1be70228d45..ae791a1bcdf 100644
--- a/Editor/AGS.Native/NativeMethods.cpp
+++ b/Editor/AGS.Native/NativeMethods.cpp
@@ -80,7 +80,8 @@ extern int GetPaletteAsHPalette();
extern bool DoesSpriteExist(int slot);
extern int GetMaxSprites();
extern int GetCurrentlyLoadedRoomNumber();
-extern int load_template_file(const AGSString &fileName, char **iconDataBuffer, size_t *iconDataSize, bool isRoomTemplate);
+extern bool load_template_file(const AGSString &fileName, AGSString &description,
+ std::vector &iconDataBuffer, bool isRoomTemplate);
extern HAGSError extract_template_files(const AGSString &templateFileName);
extern HAGSError extract_room_template_files(const AGSString &templateFileName, int newRoomNumber);
extern void change_sprite_number(int oldNumber, int newNumber);
@@ -670,18 +671,17 @@ namespace AGS
BaseTemplate^ NativeMethods::LoadTemplateFile(String ^fileName, bool isRoomTemplate)
{
AGSString fileNameAnsi = TextHelper::ConvertUTF8(fileName);
- char *iconDataBuffer = NULL;
- size_t iconDataSize = 0u;
+ AGSString description;
+ std::vector iconDataBuffer;
- int success = load_template_file(fileNameAnsi, &iconDataBuffer, &iconDataSize, isRoomTemplate);
+ int success = load_template_file(fileNameAnsi, description, iconDataBuffer, isRoomTemplate);
if (success)
{
Icon ^icon = nullptr;
- if (iconDataBuffer != NULL)
+ if (!iconDataBuffer.empty())
{
- cli::array^ managedArray = gcnew cli::array(iconDataSize);
- Marshal::Copy(IntPtr(iconDataBuffer), managedArray, 0, iconDataSize);
- ::free(iconDataBuffer);
+ cli::array^ managedArray = gcnew cli::array(iconDataBuffer.size());
+ Marshal::Copy(IntPtr(&iconDataBuffer.front()), managedArray, 0, iconDataBuffer.size());
System::IO::MemoryStream^ ms = gcnew System::IO::MemoryStream(managedArray);
try
{
@@ -699,7 +699,11 @@ namespace AGS
}
else
{
- return gcnew GameTemplate(fileName, icon);
+ // Bring linebreaks in description to the uniform "\r\n" format.
+ String ^uniDescription = TextHelper::ConvertUTF8(description);
+ uniDescription = System::Text::RegularExpressions::Regex
+ ::Replace(uniDescription, "(? &data, const size_t data_limit = SIZE_MAX)
{
- // make sure we get the icon from the file
- templateMgr->SetSearchPriority(Common::kAssetPriorityLib);
- auto inpu = templateMgr->OpenAsset (iconName);
- const size_t sizey = inpu->GetLength();
- if ((inpu != NULL) && (sizey > 0))
- {
- char *iconbuffer = (char*)malloc(sizey);
- inpu->Read (iconbuffer, sizey);
- *iconDataBuffer = iconbuffer;
- *bufferSize = sizey;
- }
- else
- {
- *iconDataBuffer = NULL;
- *bufferSize = 0u;
- }
+ std::unique_ptr in(mgr->OpenAsset(asset_name));
+ if (!in)
+ return false;
+ const size_t data_sz = std::min(static_cast(in->GetLength()), data_limit);
+ if (data_sz >= 0)
+ {
+ data.resize(data_sz);
+ in->Read(&data.front(), data_sz);
+ }
+ return true;
}
-int load_template_file(const AGSString &fileName, char **iconDataBuffer, size_t *iconDataSize, bool isRoomTemplate)
+bool load_template_file(const AGSString &fileName, AGSString &description,
+ std::vector &iconDataBuffer, bool isRoomTemplate)
{
const AssetLibInfo *lib = nullptr;
std::unique_ptr templateMgr(new AssetManager());
+ templateMgr->SetSearchPriority(Common::kAssetPriorityLib);
if (templateMgr->AddLibrary(fileName, &lib) == Common::kAssetNoError)
{
if (isRoomTemplate)
{
if (templateMgr->DoesAssetExist(ROOM_TEMPLATE_ID_FILE))
{
- auto inpu = templateMgr->OpenAsset(ROOM_TEMPLATE_ID_FILE);
- if (inpu->ReadInt32() != ROOM_TEMPLATE_ID_FILE_SIGNATURE)
- {
- return 0;
- }
- int roomNumber = inpu->ReadInt32();
+ std::unique_ptr in(templateMgr->OpenAsset(ROOM_TEMPLATE_ID_FILE));
+ if (!in)
+ return false;
+ if (in->ReadInt32() != ROOM_TEMPLATE_ID_FILE_SIGNATURE)
+ return false;
+ int roomNumber = in->ReadInt32();
+ in.reset();
+
char iconName[MAX_PATH];
sprintf(iconName, "room%d.ico", roomNumber);
if (templateMgr->DoesAssetExist(iconName))
{
- extract_icon_from_template(templateMgr.get(), iconName, iconDataBuffer, iconDataSize);
+ load_asset_data(templateMgr.get(), iconName, iconDataBuffer);
}
- return 1;
+ return true;
}
- return 0;
+ return false;
}
else if ((templateMgr->DoesAssetExist(old_editor_data_file)) || (templateMgr->DoesAssetExist(new_editor_data_file)))
{
@@ -495,35 +496,43 @@ int load_template_file(const AGSString &fileName, char **iconDataBuffer, size_t
(oriname.FindString(".ags") != -1))
{
// wasn't originally meant as a template
- return 0;
+ return false;
}
- auto inpu = templateMgr->OpenAsset(old_editor_main_game_file);
- if (inpu != NULL)
+ std::unique_ptr in(templateMgr->OpenAsset(old_editor_main_game_file));
+ if (in)
{
- inpu->Seek(30);
- int gameVersion = inpu->ReadInt32();
+ in->Seek(30);
+ int gameVersion = in->ReadInt32();
+
// TODO: check this out, in theory we still support pre-2.72 game import
- if (gameVersion != 32)
+ if (gameVersion != 32) // CHECKME: why we use `!=` and not `>=` ? also what's 32?
{
// older than 2.72 template
- return 0;
+ return false;
}
+ in.reset();
}
+ if (templateMgr->DoesAssetExist(TEMPLATE_DESC_FILE))
+ {
+ std::vector desc_data;
+ load_asset_data(templateMgr.get(), TEMPLATE_DESC_FILE, desc_data);
+ description.SetString(&desc_data.front(), desc_data.size());
+ }
+
int useIcon = 0;
- char *iconName = "template.ico";
+ const char *iconName = TEMPLATE_ICON_FILE;
if (!templateMgr->DoesAssetExist(iconName))
- iconName = "user.ico";
- // the file is a CLIB file, so let's extract the icon to display
+ iconName = GAME_ICON_FILE;
if (templateMgr->DoesAssetExist(iconName))
{
- extract_icon_from_template(templateMgr.get(), iconName, iconDataBuffer, iconDataSize);
+ load_asset_data(templateMgr.get(), iconName, iconDataBuffer);
}
- return 1;
+ return true;
}
}
- return 0;
+ return false;
}
void drawBlockDoubleAt (HDC hdc, Common::Bitmap *todraw ,int x, int y) {
diff --git a/Editor/AGS.Types/EditorFeatures/BaseTemplate.cs b/Editor/AGS.Types/EditorFeatures/BaseTemplate.cs
index 4345dc3840e..b789cb16bbc 100644
--- a/Editor/AGS.Types/EditorFeatures/BaseTemplate.cs
+++ b/Editor/AGS.Types/EditorFeatures/BaseTemplate.cs
@@ -10,12 +10,14 @@ public class BaseTemplate
{
protected string _fileName;
protected string _friendlyName;
- protected Icon _icon;
+ protected string _description;
+ protected Icon _icon;
- public BaseTemplate(string fileName, Icon icon)
+ public BaseTemplate(string fileName, string description, Icon icon)
{
_fileName = fileName;
- _icon = icon;
+ _description = description;
+ _icon = icon;
if (_fileName != null)
{
_friendlyName = Path.GetFileNameWithoutExtension(_fileName);
@@ -32,6 +34,11 @@ public string FriendlyName
get { return _friendlyName; }
}
+ public string Description
+ {
+ get { return _description; }
+ }
+
public Icon Icon
{
get { return _icon; }
diff --git a/Editor/AGS.Types/EditorFeatures/GameTemplate.cs b/Editor/AGS.Types/EditorFeatures/GameTemplate.cs
index fdf651e0a27..2cc5da1c17f 100644
--- a/Editor/AGS.Types/EditorFeatures/GameTemplate.cs
+++ b/Editor/AGS.Types/EditorFeatures/GameTemplate.cs
@@ -8,7 +8,8 @@ namespace AGS.Types
{
public class GameTemplate : BaseTemplate
{
- public GameTemplate(string fileName, Icon icon) : base(fileName, icon)
+ public GameTemplate(string fileName, string description, Icon icon)
+ : base(fileName, description, icon)
{
}
}
diff --git a/Editor/AGS.Types/EditorFeatures/RoomTemplate.cs b/Editor/AGS.Types/EditorFeatures/RoomTemplate.cs
index 705760da81e..93a907589bc 100644
--- a/Editor/AGS.Types/EditorFeatures/RoomTemplate.cs
+++ b/Editor/AGS.Types/EditorFeatures/RoomTemplate.cs
@@ -9,12 +9,12 @@ namespace AGS.Types
public class RoomTemplate : BaseTemplate
{
public RoomTemplate(string fileName, Icon icon)
- : base(fileName, icon)
+ : base(fileName, null, icon)
{
}
public RoomTemplate(string fileName, Icon icon, string friendlyName)
- : base(fileName, icon)
+ : base(fileName, null, icon)
{
_friendlyName = friendlyName;
}