1
0
mirror of synced 2024-11-12 02:00:50 +01:00

More bug fixes

Load drawables on constructor for viewport for scene to be loaded properly.
Detect XML formatting for text documents loaded from an archive.
This commit is contained in:
KillzXGaming 2019-03-24 14:23:11 -04:00
parent c0328e3b82
commit f9d33324ce
11 changed files with 17 additions and 4 deletions

Binary file not shown.

View File

@ -55,8 +55,11 @@ namespace FirstPlugin.Forms
viewport = new Viewport(); viewport = new Viewport();
viewport.Dock = DockStyle.Fill; viewport.Dock = DockStyle.Fill;
} }
stPanel5.Controls.Add(viewport); stPanel5.Controls.Add(viewport);
OnLoadedTab();
if (HasModels) if (HasModels)
stTabControl1.SelectedIndex = 1; stTabControl1.SelectedIndex = 1;
} }

View File

@ -145,6 +145,13 @@ namespace Switch_Toolbox.Library.Forms
const int padding = 4; const int padding = 4;
scintilla1.Margins[0].Width = scintilla1.TextWidth(Style.LineNumber, new string('9', maxLineNumberCharLength + 1)) + padding; scintilla1.Margins[0].Width = scintilla1.TextWidth(Style.LineNumber, new string('9', maxLineNumberCharLength + 1)) + padding;
this.maxLineNumberCharLength = maxLineNumberCharLength; this.maxLineNumberCharLength = maxLineNumberCharLength;
if (scintilla1.Lines.Count > 0)
{
if (scintilla1.Lines[0].Text.Contains("<?xml")) {
IsXML = true;
}
}
} }
private void scintilla1_Insert(object sender, ModificationEventArgs e) private void scintilla1_Insert(object sender, ModificationEventArgs e)

View File

@ -24,7 +24,7 @@ namespace Switch_Toolbox.Library
Runtime.ViewportEditor editor; Runtime.ViewportEditor editor;
public Viewport() public Viewport(bool LoadDrawables = true)
{ {
this.DoubleBuffered = true; this.DoubleBuffered = true;
@ -44,6 +44,9 @@ namespace Switch_Toolbox.Library
} }
shadingToolStripMenuItem.Text = $"Shading: [{Runtime.viewportShading.ToString()}]"; shadingToolStripMenuItem.Text = $"Shading: [{Runtime.viewportShading.ToString()}]";
if (LoadDrawables)
LoadBaseDrawables();
} }
private void shadingToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) private void shadingToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
@ -126,9 +129,8 @@ namespace Switch_Toolbox.Library
else else
scene.staticObjects.Remove(Drawabale); scene.staticObjects.Remove(Drawabale);
} }
protected override void OnLoad(EventArgs e) private void LoadBaseDrawables()
{ {
base.OnLoad(e);
var floor = new DrawableFloor(); var floor = new DrawableFloor();
scene.staticObjects.Add(floor); scene.staticObjects.Add(floor);
var xyzLnes = new DrawableXyzLines(); var xyzLnes = new DrawableXyzLines();

View File

@ -51,7 +51,8 @@ namespace Toolbox
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
{ {
var viewport = new Viewport(); //Create an instance of this to help load open gl data easier and quicker after boot
var viewport = new Viewport(false);
VersionCheck version = new VersionCheck(); VersionCheck version = new VersionCheck();
Runtime.ProgramVersion = version.ProgramVersion; Runtime.ProgramVersion = version.ProgramVersion;