Skip to content

Commit

Permalink
1.2r for UniScript 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dotPawel committed Aug 4, 2023
1 parent 9fc271e commit 4ecb36e
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 19 deletions.
16 changes: 12 additions & 4 deletions UniDKIT/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 59 additions & 15 deletions UniDKIT/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace UniDKIT
{
public partial class Main : Form
{
public static string Version = "1.1r";
public static string Version = "1.2r";
private DiscordRpcClient client;

// whar
Expand All @@ -33,7 +33,7 @@ public partial class Main : Form

public static string OldFileContents;

public static string UnscVersion = "6.0r";
public static string UnscVersion = "7.0r";
public static int counter2;

public string[] Autocomplete54 =
Expand Down Expand Up @@ -82,7 +82,7 @@ public partial class Main : Form
"/inst", "/foinfo", "/finfo", "/dpkg", "/uinst", "/list",

// networx
"net", "ping",
"net", "ping",

// process
"proc", "run", "end",
Expand All @@ -99,7 +99,39 @@ public partial class Main : Form
"clr", "about", "echo", "sleep", "exit", "ptm-cmd", "help",

// other slash commands
"/p", "/all", "/ptm", "/name", "/frc"
"/p", "/all", "/ptm", "/name", "/frc", "/args"
};
public string[] Autocomplete70 =
{
// filesys
"file", "dir", "sd",

"make", "del", "rd", "wrt", "cln", "rnm", "zip", "unzip",

// uniscript/pkg
"uniscript", "unipkg",

"/inst", "/foinfo", "/finfo", "/dpkg", "/uinst", "/list",

// networx
"net", "ping", "dload", "fc",

// process
"proc", "run", "end",

// customization and ironpython
"irpy", "stxt", "ptxt", "tmdl", "cfg",

"wrt-template", "open", "example", "parse",

// acl backbridge
"acl_bb", "start",

// misc.
"clr", "about", "echo", "sleep", "exit", "ptm-cmd", "help",

// other slash commands
"/p", "/all", "/ptm", "/name", "/frc", "/args"
};

public Main()
Expand All @@ -108,7 +140,7 @@ public Main()
}
private void Main_Load(object sender, EventArgs e)
{
AutocompleteMenu.Items = Autocomplete60;
AutocompleteMenu.Items = Autocomplete70;
this.Text = "UniDKIT // " + Version;

VersionText.Text = "Version // " + Version;
Expand Down Expand Up @@ -250,7 +282,7 @@ private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
myStream.Close();
File.Create(NewDialog.FileName).Close();

if (Textbox.Text.Length > 1 && FilePath == null)
{
DialogResult dialogResult = MessageBox.Show("Save current editor contents to created file?", "Editor contents detected", MessageBoxButtons.YesNo);
Expand Down Expand Up @@ -473,6 +505,11 @@ private void versionToolStripMenuItem_DropDownItemClicked(object sender, ToolStr
UnscVersionText.Text = "6.0r";
AutocompleteMenu.Items = Autocomplete60;
}
if (e.ClickedItem.Text == "7.0r")
{
UnscVersionText.Text = "7.0r";
AutocompleteMenu.Items = Autocomplete70;
}
Textbox.OnTextChanged();
}

Expand Down Expand Up @@ -543,7 +580,11 @@ private void pictureBox1_Click(object sender, EventArgs e)
}
private void Textbox_TextChanged(object sender, FastColoredTextBoxNS.TextChangedEventArgs e)
{
// this is slightly less fucked
// This is still so fucked
// Christ how did it even get this bad

// I'm not fixing this until I cannot add more to it

e.ChangedRange.ClearStyle(BlueStyle, AzureStyle, YellowStyle, PurpleStyle, BlueVioletStyle, DarkOliveStyle, TealStyle, ChartStyle, GreenStyle, CoralStyle);
// filesys
e.ChangedRange.SetStyle(BlueStyle, @"\b(file|dir|sd)", RegexOptions.IgnoreCase);
Expand All @@ -562,6 +603,10 @@ private void Textbox_TextChanged(object sender, FastColoredTextBoxNS.TextChanged
// networx
e.ChangedRange.SetStyle(TealStyle, @"net", RegexOptions.IgnoreCase);
e.ChangedRange.SetStyle(CoralStyle, @"ping", RegexOptions.IgnoreCase);
if (UnscVersion == "7.0r")
{
e.ChangedRange.SetStyle(CoralStyle, @"\b(dload|fc)", RegexOptions.IgnoreCase);
}

// process
e.ChangedRange.SetStyle(AzureStyle, @"proc", RegexOptions.IgnoreCase);
Expand All @@ -574,13 +619,7 @@ private void Textbox_TextChanged(object sender, FastColoredTextBoxNS.TextChanged
e.ChangedRange.SetStyle(BlueVioletStyle, @"\b(stxt|ptxt|tmdl)", RegexOptions.IgnoreCase);
e.ChangedRange.SetStyle(DarkOliveStyle, @"cfg", RegexOptions.IgnoreCase);

// 6.0r changes

//e.ChangedRange.SetStyle(CoralStyle, @"create", RegexOptions.Multiline); switched out for make
e.ChangedRange.SetStyle(CoralStyle, @"wrt-template", RegexOptions.IgnoreCase);
//e.ChangedRange.SetStyle(CoralStyle, @"rewrite", RegexOptions.Multiline); switched out for wrt
//e.ChangedRange.SetStyle(CoralStyle, @"write", RegexOptions.Multiline); switched out for wrt
//e.ChangedRange.SetStyle(CoralStyle, @"print", RegexOptions.Multiline); switched out for rd or removed entirely
}
else
{
Expand All @@ -604,8 +643,13 @@ private void Textbox_TextChanged(object sender, FastColoredTextBoxNS.TextChanged
e.ChangedRange.SetStyle(GreenStyle, @"/p", RegexOptions.IgnoreCase);
e.ChangedRange.SetStyle(GreenStyle, @"/all", RegexOptions.IgnoreCase);
e.ChangedRange.SetStyle(GreenStyle, @"/ptm", RegexOptions.IgnoreCase);
e.ChangedRange.SetStyle(GreenStyle, @"/frc", RegexOptions.IgnoreCase);
e.ChangedRange.SetStyle(GreenStyle, @"/name", RegexOptions.IgnoreCase);

if (UnscVersion == "6.0r" || UnscVersion == "7.0r")
{
e.ChangedRange.SetStyle(GreenStyle, @"/frc", RegexOptions.IgnoreCase);
e.ChangedRange.SetStyle(GreenStyle, @"/name", RegexOptions.IgnoreCase);
e.ChangedRange.SetStyle(GreenStyle, @"/args", RegexOptions.IgnoreCase);
}
}
}
}

0 comments on commit 4ecb36e

Please sign in to comment.