Renamed RenamePrompt form to TextPrompt

This commit is contained in:
MattNL
2023-06-10 07:51:32 -04:00
parent 230f7a88c7
commit 7246ce1ea0
9 changed files with 18 additions and 18 deletions

View File

@@ -251,7 +251,7 @@ namespace PckStudio.Features
private void addCustomPckToolStripMenuItem_Click(object sender, EventArgs e)
{
RenamePrompt prompt = new RenamePrompt(string.Empty);
TextPrompt prompt = new TextPrompt(string.Empty);
prompt.OKButton.Text = "OK";
prompt.TextLabel.Text = "Folder:";

View File

@@ -1,6 +1,6 @@
namespace PckStudio
{
partial class RenamePrompt
partial class TextPrompt
{
/// <summary>
/// Required designer variable.
@@ -28,7 +28,7 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RenamePrompt));
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TextPrompt));
this.TextLabel = new System.Windows.Forms.Label();
this.OKButton = new System.Windows.Forms.Button();
this.InputTextBox = new MetroFramework.Controls.MetroTextBox();

View File

@@ -4,17 +4,17 @@ using MetroFramework.Forms;
namespace PckStudio
{
public partial class RenamePrompt : MetroForm
public partial class TextPrompt : MetroForm
{
/// <summary>
/// Text entered <c>only access when DialogResult == DialogResult.OK</c>
/// </summary>
public string NewText => InputTextBox.Text;
public RenamePrompt(string InitialText) : this(InitialText, -1)
public TextPrompt(string InitialText) : this(InitialText, -1)
{ }
public RenamePrompt(string InitialText, int maxChar)
public TextPrompt(string InitialText, int maxChar)
{
InitializeComponent();
InputTextBox.Text = InitialText;

View File

@@ -246,7 +246,7 @@ namespace PckStudio.Forms.Editor
while (!SkinANIM.IsValidANIM(value))
{
if (!string.IsNullOrWhiteSpace(value)) MessageBox.Show($"The following value \"{value}\" is not valid. Please try again.");
RenamePrompt diag = new RenamePrompt(value);
TextPrompt diag = new TextPrompt(value);
diag.TextLabel.Text = "ANIM";
diag.OKButton.Text = "Ok";
if (diag.ShowDialog() == DialogResult.OK)

View File

@@ -205,7 +205,7 @@ namespace PckStudio.Forms.Editor
? GrfTreeView.SelectedNode.Nodes
: GrfTreeView.Nodes;
using (RenamePrompt prompt = new RenamePrompt(""))
using (TextPrompt prompt = new TextPrompt(""))
{
prompt.OKButton.Text = "Add";
if (MessageBox.Show($"Add Game Rule to {parentRule.Name}", "Attention",

View File

@@ -61,7 +61,7 @@ namespace PckStudio.Forms.Editor
private void addDisplayIDToolStripMenuItem_Click(object sender, EventArgs e)
{
if (treeViewLocKeys.SelectedNode is TreeNode)
using (RenamePrompt prompt = new RenamePrompt(""))
using (TextPrompt prompt = new TextPrompt(""))
{
prompt.OKButton.Text = "Add";
if (prompt.ShowDialog() == DialogResult.OK &&

View File

@@ -731,7 +731,7 @@ namespace PckStudio
bool sub = IsSubPCKNode(path);
using RenamePrompt diag = new RenamePrompt(node.Tag is null ? Path.GetFileName(node.FullPath) : node.FullPath);
using TextPrompt diag = new TextPrompt(node.Tag is null ? Path.GetFileName(node.FullPath) : node.FullPath);
if (diag.ShowDialog(this) == DialogResult.OK)
{
@@ -1281,7 +1281,7 @@ namespace PckStudio
private void skinPackToolStripMenuItem_Click(object sender, EventArgs e)
{
checkSaveState();
RenamePrompt namePrompt = new RenamePrompt("");
TextPrompt namePrompt = new TextPrompt("");
namePrompt.OKButton.Text = "Ok";
if (namePrompt.ShowDialog() == DialogResult.OK)
{
@@ -1632,7 +1632,7 @@ namespace PckStudio
private void folderToolStripMenuItem_Click(object sender, EventArgs e)
{
RenamePrompt folderNamePrompt = new RenamePrompt("");
TextPrompt folderNamePrompt = new TextPrompt("");
if(treeViewMain.SelectedNode is not null) folderNamePrompt.contextLabel.Text = $"New folder at the location of \"{treeViewMain.SelectedNode.FullPath}\"";
folderNamePrompt.OKButton.Text = "Add";
if (folderNamePrompt.ShowDialog() == DialogResult.OK)
@@ -1905,7 +1905,7 @@ namespace PckStudio
fileDialog.Filter = "Texture File(*.png;*.tga)|*.png;*.tga";
if (fileDialog.ShowDialog() == DialogResult.OK)
{
using RenamePrompt renamePrompt = new RenamePrompt(Path.GetFileName(fileDialog.FileName));
using TextPrompt renamePrompt = new TextPrompt(Path.GetFileName(fileDialog.FileName));
renamePrompt.TextLabel.Text = "Path";
if (renamePrompt.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(renamePrompt.NewText))
{

View File

@@ -279,11 +279,11 @@
<Compile Include="Forms\Additional-Popups\AddFilePrompt.Designer.cs">
<DependentUpon>AddFilePrompt.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Additional-Popups\RenamePrompt.cs">
<Compile Include="Forms\Additional-Popups\TextPrompt.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\Additional-Popups\RenamePrompt.Designer.cs">
<DependentUpon>RenamePrompt.cs</DependentUpon>
<Compile Include="Forms\Additional-Popups\TextPrompt.Designer.cs">
<DependentUpon>TextPrompt.cs</DependentUpon>
</Compile>
<Compile Include="Forms\Additional-Popups\MultiTextPrompt.cs">
<SubType>Form</SubType>
@@ -506,8 +506,8 @@
<DependentUpon>NumericPrompt.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Additional-Popups\RenamePrompt.resx">
<DependentUpon>RenamePrompt.cs</DependentUpon>
<EmbeddedResource Include="Forms\Additional-Popups\TextPrompt.resx">
<DependentUpon>TextPrompt.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\Additional-Popups\MultiTextPrompt.resx">