|
@@ -89,32 +89,32 @@ namespace MainNs
|
|
private const uint DFCC_ILDB = 1111772233;
|
|
private const uint DFCC_ILDB = 1111772233;
|
|
private const uint DFCC_SPDB = 1111773267;
|
|
private const uint DFCC_SPDB = 1111773267;
|
|
|
|
|
|
- private TabPage HelpTabPage
|
|
|
|
|
|
+ private TabPage HelpTabPage
|
|
{
|
|
{
|
|
- get
|
|
|
|
- {
|
|
|
|
|
|
+ get
|
|
|
|
+ {
|
|
if (this.helpTabPage == null)
|
|
if (this.helpTabPage == null)
|
|
{
|
|
{
|
|
this.helpTabPage = new TabPage("Help");
|
|
this.helpTabPage = new TabPage("Help");
|
|
this.AnalysisTabControl.TabPages.Add(helpTabPage);
|
|
this.AnalysisTabControl.TabPages.Add(helpTabPage);
|
|
}
|
|
}
|
|
- return this.helpTabPage;
|
|
|
|
- }
|
|
|
|
|
|
+ return this.helpTabPage;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- private RichTextBox HelpControl
|
|
|
|
- {
|
|
|
|
- get
|
|
|
|
- {
|
|
|
|
- if (this.helpControl == null)
|
|
|
|
- {
|
|
|
|
- this.helpControl = new RichTextBox();
|
|
|
|
- this.HelpTabPage.Controls.Add(this.helpControl);
|
|
|
|
- this.helpControl.Dock = DockStyle.Fill;
|
|
|
|
- this.helpControl.Font = this.CodeBox.Font;
|
|
|
|
- }
|
|
|
|
- return this.helpControl;
|
|
|
|
- }
|
|
|
|
|
|
+ private RichTextBox HelpControl
|
|
|
|
+ {
|
|
|
|
+ get
|
|
|
|
+ {
|
|
|
|
+ if (this.helpControl == null)
|
|
|
|
+ {
|
|
|
|
+ this.helpControl = new RichTextBox();
|
|
|
|
+ this.HelpTabPage.Controls.Add(this.helpControl);
|
|
|
|
+ this.helpControl.Dock = DockStyle.Fill;
|
|
|
|
+ this.helpControl.Font = this.CodeBox.Font;
|
|
|
|
+ }
|
|
|
|
+ return this.helpControl;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private TabPage RenderViewTabPage
|
|
private TabPage RenderViewTabPage
|
|
@@ -2784,35 +2784,35 @@ namespace MainNs
|
|
|
|
|
|
string payloadText = GetShaderOpPayload();
|
|
string payloadText = GetShaderOpPayload();
|
|
|
|
|
|
- if (this.settingsManager.ExternalRenderEnabled)
|
|
|
|
- {
|
|
|
|
- string path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "dndxc-ext-render.xml");
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- System.IO.File.WriteAllText(path, payloadText);
|
|
|
|
- }
|
|
|
|
- catch (Exception writeErr)
|
|
|
|
- {
|
|
|
|
- HandleException(writeErr, "Unable to write render input to " + path);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- string arguments = this.settingsManager.ExternalRenderCommand;
|
|
|
|
- arguments = arguments.Replace("%in", path);
|
|
|
|
- var process = System.Diagnostics.Process.Start("cmd.exe", "/c " + arguments);
|
|
|
|
- if (process != null)
|
|
|
|
- {
|
|
|
|
- process.Dispose();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- catch (Exception runErr)
|
|
|
|
- {
|
|
|
|
- HandleException(runErr, "Unable to run external render command.");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return;
|
|
|
|
|
|
+ if (this.settingsManager.ExternalRenderEnabled)
|
|
|
|
+ {
|
|
|
|
+ string path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "dndxc-ext-render.xml");
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ System.IO.File.WriteAllText(path, payloadText);
|
|
|
|
+ }
|
|
|
|
+ catch (Exception writeErr)
|
|
|
|
+ {
|
|
|
|
+ HandleException(writeErr, "Unable to write render input to " + path);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ string arguments = this.settingsManager.ExternalRenderCommand;
|
|
|
|
+ arguments = arguments.Replace("%in", path);
|
|
|
|
+ var process = System.Diagnostics.Process.Start("cmd.exe", "/c " + arguments);
|
|
|
|
+ if (process != null)
|
|
|
|
+ {
|
|
|
|
+ process.Dispose();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ catch (Exception runErr)
|
|
|
|
+ {
|
|
|
|
+ HandleException(runErr, "Unable to run external render command.");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
try
|
|
try
|
|
@@ -3370,21 +3370,21 @@ namespace MainNs
|
|
string resultText = "";
|
|
string resultText = "";
|
|
IDxcBlob source = null;
|
|
IDxcBlob source = null;
|
|
{
|
|
{
|
|
- try
|
|
|
|
- {
|
|
|
|
- var result = compiler.Compile(this.CreateBlobForCodeText(), fileName, fileVars.Entry, fileVars.Target, args, args.Length, null, 0, library.CreateIncludeHandler());
|
|
|
|
- if (result.GetStatus() == 0)
|
|
|
|
- {
|
|
|
|
- source = result.GetResult();
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- resultText = GetStringFromBlob(result.GetErrors());
|
|
|
|
- }
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ var result = compiler.Compile(this.CreateBlobForCodeText(), fileName, fileVars.Entry, fileVars.Target, args, args.Length, null, 0, library.CreateIncludeHandler());
|
|
|
|
+ if (result.GetStatus() == 0)
|
|
|
|
+ {
|
|
|
|
+ source = result.GetResult();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ resultText = GetStringFromBlob(result.GetErrors());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- catch (System.ArgumentException e)
|
|
|
|
- {
|
|
|
|
- MessageBox.Show(this, $"{e.Message}.", "Invalid form entry");
|
|
|
|
|
|
+ catch (System.ArgumentException e)
|
|
|
|
+ {
|
|
|
|
+ MessageBox.Show(this, $"{e.Message}.", "Invalid form entry");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return new HighLevelCompileResult() { Blob = source, ResultText = resultText };
|
|
return new HighLevelCompileResult() { Blob = source, ResultText = resultText };
|
|
@@ -3440,29 +3440,29 @@ namespace MainNs
|
|
form.Sections = TextSection.EnumerateSections(new string[] { "MODULE-PRINT", "Phase:" }, opt.ResultText).ToArray();
|
|
form.Sections = TextSection.EnumerateSections(new string[] { "MODULE-PRINT", "Phase:" }, opt.ResultText).ToArray();
|
|
form.StartPosition = FormStartPosition.CenterParent;
|
|
form.StartPosition = FormStartPosition.CenterParent;
|
|
form.Show(this);
|
|
form.Show(this);
|
|
- }
|
|
|
|
-
|
|
|
|
- private void CodeBox_HelpRequested(object sender, HelpEventArgs hlpevent)
|
|
|
|
- {
|
|
|
|
- RichTextBox rtb = this.CodeBox;
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void CodeBox_HelpRequested(object sender, HelpEventArgs hlpevent)
|
|
|
|
+ {
|
|
|
|
+ RichTextBox rtb = this.CodeBox;
|
|
SelectionExpandResult expand = SelectionExpandResult.Expand(rtb);
|
|
SelectionExpandResult expand = SelectionExpandResult.Expand(rtb);
|
|
if (expand.IsEmpty)
|
|
if (expand.IsEmpty)
|
|
- return;
|
|
|
|
- string readmeText;
|
|
|
|
- using (System.IO.StreamReader reader =
|
|
|
|
- new System.IO.StreamReader(System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream("MainNs.README.md")))
|
|
|
|
- {
|
|
|
|
- readmeText = reader.ReadToEnd();
|
|
|
|
- }
|
|
|
|
- this.HelpControl.Text = readmeText;
|
|
|
|
- (this.HelpTabPage.Parent as TabControl).SelectedTab = this.HelpTabPage;
|
|
|
|
- int pos = readmeText.IndexOf(expand.Token, StringComparison.InvariantCultureIgnoreCase);
|
|
|
|
- if (pos >= 0)
|
|
|
|
- {
|
|
|
|
- this.HelpControl.Select(pos, 0);
|
|
|
|
- this.HelpControl.ScrollToCaret();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ return;
|
|
|
|
+ string readmeText;
|
|
|
|
+ using (System.IO.StreamReader reader =
|
|
|
|
+ new System.IO.StreamReader(System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream("MainNs.README.md")))
|
|
|
|
+ {
|
|
|
|
+ readmeText = reader.ReadToEnd();
|
|
|
|
+ }
|
|
|
|
+ this.HelpControl.Text = readmeText;
|
|
|
|
+ (this.HelpTabPage.Parent as TabControl).SelectedTab = this.HelpTabPage;
|
|
|
|
+ int pos = readmeText.IndexOf(expand.Token, StringComparison.InvariantCultureIgnoreCase);
|
|
|
|
+ if (pos >= 0)
|
|
|
|
+ {
|
|
|
|
+ this.HelpControl.Select(pos, 0);
|
|
|
|
+ this.HelpControl.ScrollToCaret();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public static class RichTextBoxExt
|
|
public static class RichTextBoxExt
|