Skip to content
This repository has been archived by the owner on Jul 23, 2022. It is now read-only.

Commit

Permalink
Extra command formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MelonIs45 committed Feb 15, 2021
1 parent f2bd0da commit c40b979
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions CommandMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,37 @@ private void button2_Click(object sender, EventArgs e)
}
else
{
spo = " -cursors=" + numericUpDown1.Value + " -tag=" + numericUpDown4.Value + " -speed=" + numericUpDown2.Value + " -pitch=" + numericUpDown3.Value + extraSettings;
spo = $"{formatExtraCommands(numericUpDown1.Value, numericUpDown4.Value, numericUpDown2.Value, numericUpDown3.Value)}{extraSettings}";
}
string commandString = label11.Text + " -t=" + '"' + title + '"' + " -d=" + '"' + comboBox2.Text + '"' + spo;

string commandString = $"{label11.Text} -t=\"{title}\" -d=\"{comboBox2.Text}\"{spo}";
richTextBox1.Text = commandString;
}

private string formatExtraCommands(decimal cursors, decimal tag, decimal speed, decimal pitch)
{
string extraCommand = "";

if (cursors != 1)
{
extraCommand += $" -cursors={cursors}";
}
if (tag != 1)
{
extraCommand += $" -tag={tag}";
}
if (speed != 1)
{
extraCommand += $" -speed={speed}";
}
if (pitch != 1)
{
extraCommand += $" -pitch={pitch}";
}

return extraCommand;
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
comboBox1.Items.Clear();
Expand Down

0 comments on commit c40b979

Please sign in to comment.