diff --git a/IDE/dist/BeefConfig_install.toml b/IDE/dist/BeefConfig_install.toml index f57d0ec7..852ecba7 100644 --- a/IDE/dist/BeefConfig_install.toml +++ b/IDE/dist/BeefConfig_install.toml @@ -1,7 +1,15 @@ -[Registry.minlib] -Version = "1.0.0" -Location = { Path = "../mintest/minlib" } - [Registry.corlib] Version = "1.0.0" -Location = { Path = "../corlib" } \ No newline at end of file +Location = { Path = "../BeefLibs/corlib" } + +[Registry.SDL2] +Version = "1.0.0" +Location = { Path = "../BeefLibs/SDL2" } + +[Registry.MiniZ] +Version = "1.0.0" +Location = { Path = "../BeefLibs/MiniZ" } + +[Registry.Beefy2D] +Version = "1.0.0" +Location = { Path = "../BeefLibs/Beefy2D" } \ No newline at end of file diff --git a/IDE/src/ui/ProjectPanel.bf b/IDE/src/ui/ProjectPanel.bf index a2b8ae0d..e036b0b0 100644 --- a/IDE/src/ui/ProjectPanel.bf +++ b/IDE/src/ui/ProjectPanel.bf @@ -1694,6 +1694,22 @@ namespace IDE.ui return null; } + if (!gApp.mWorkspace.IsInitialized) + { + String projPath = scope .(); + Path.GetDirectoryPath(filePath, projPath); + projPath.Concat(Path.DirectorySeparatorChar, "BeefSpace.toml"); + gApp.OpenWorkspace(projPath); + + for (let project in gApp.mWorkspace.mProjects) + { + if (Path.Equals(project.mProjectPath, filePath)) + return project; + } + + return null; + } + bool failed = false; String projName = scope String(); Path.GetFileNameWithoutExtension(filePath, projName); @@ -1729,8 +1745,15 @@ namespace IDE.ui fileDialog.Title = "Import Project"; fileDialog.Multiselect = false; - var initialDir = scope String(IDEApp.sApp.mWorkspace.mDir); - //initialDir.Replace('/', '\\'); + var initialDir = scope String(); + if (gApp.mWorkspace.mDir != null) + initialDir.Append(gApp.mWorkspace.mDir); + else + { + if (gApp.mInstallDir.Length > 0) + Path.GetDirectoryPath(.(gApp.mInstallDir, 0, gApp.mInstallDir.Length - 1), initialDir); + initialDir.Concat(Path.DirectorySeparatorChar, "Samples"); + } fileDialog.InitialDirectory = initialDir; fileDialog.ValidateNames = true; diff --git a/IDE/src/ui/StatusBar.bf b/IDE/src/ui/StatusBar.bf index 0eb9fc9a..6e02f062 100644 --- a/IDE/src/ui/StatusBar.bf +++ b/IDE/src/ui/StatusBar.bf @@ -93,8 +93,9 @@ namespace IDE.ui void ResizeComponents() { - mConfigComboBox.Resize(mWidth - GS!(440), 0, GS!(120), mHeight + 2); - mPlatformComboBox.Resize(mWidth - GS!(440 + 120), 0, GS!(120), mHeight + 2); + int btnLeft = gApp.mSettings.mEnableDevMode ? GS!(380) : GS!(300); + mConfigComboBox.Resize(mWidth - btnLeft, 0, GS!(120), mHeight + 2); + mPlatformComboBox.Resize(mWidth - btnLeft - GS!(120), 0, GS!(120), mHeight + 2); if (mCancelSymSrvButton != null) mCancelSymSrvButton.Resize(GS!(546), 0, GS!(20), GS!(20)); @@ -239,20 +240,22 @@ namespace IDE.ui int32 column; sourceViewPanel.GetCursorPosition(out line, out column); - /*if (true) + /*var ewc = sourceViewPanel.mEditWidget.Content; + int cursorPos = ewc.CursorTextPos; + if (cursorPos < ewc.mData.mTextLength) { - var ewc = sourceViewPanel.mEditWidget.Content; - int cursorPos = ewc.CursorTextPos; - if (cursorPos < ewc.mData.mTextLength) - { - ewc.mData.mTextIdData.Prepare(); - g.DrawString(StackStringFormat!("Id {0}", ewc.mData.mTextIdData.GetIdAtIndex(cursorPos)), mWidth - GS!(320), 0); - } + ewc.mData.mTextIdData.Prepare(); + g.DrawString(StackStringFormat!("Id {0}", ewc.mData.mTextIdData.GetIdAtIndex(cursorPos)), mWidth - GS!(310), 0); }*/ - g.DrawString(StackStringFormat!("Idx {0}", sourceViewPanel.mEditWidget.Content.CursorTextPos), mWidth - GS!(240), 0); - g.DrawString(StackStringFormat!("Ln {0}", line + 1), mWidth - GS!(160), 0); - g.DrawString(StackStringFormat!("Col {0}", column + 1), mWidth - GS!(80), 0); + + /*line = 8'888'888; + column = 8'888'888;*/ + + if (gApp.mSettings.mEnableDevMode) + g.DrawString(StackStringFormat!("Idx {0}", sourceViewPanel.mEditWidget.Content.CursorTextPos), mWidth - GS!(240), 0); + g.DrawString(StackStringFormat!("Ln {0}", line + 1), mWidth - GS!(150), 0); + g.DrawString(StackStringFormat!("Col {0}", column + 1), mWidth - GS!(78), 0); } using (g.PushColor(0xFF101010)) diff --git a/IDE/src/util/ResourceGen.bf b/IDE/src/util/ResourceGen.bf index e90f5144..7bb34732 100644 --- a/IDE/src/util/ResourceGen.bf +++ b/IDE/src/util/ResourceGen.bf @@ -2,6 +2,7 @@ using System; using System.IO; using System.Collections.Generic; using System.Text; +using System.Diagnostics; namespace IDE.util { class ResourceGen @@ -77,7 +78,6 @@ namespace IDE.util } let iconDir = Try!(stream.Read()); - if ((iconDir.mReserved != 0) || (iconDir.mType != 1) || (iconDir.mCount > 0x100)) { gApp.OutputErrorLine("Invalid file format: {0}", iconFile); @@ -97,6 +97,12 @@ namespace IDE.util Try!(stream.Seek(iconEntry.mImageOffset)); + if (iconEntry.mBytesInRes > 1024*1024) + { + gApp.OutputErrorLine("Invalid icon entry in: {0}", iconFile); + return .Err; + } + uint8* data = new:ScopedAlloc! uint8[iconEntry.mBytesInRes]*; Try!(stream.TryRead(.(data, iconEntry.mBytesInRes))); diff --git a/IDEHelper/WinDebugger.cpp b/IDEHelper/WinDebugger.cpp index 6b5c86dd..8362b581 100644 --- a/IDEHelper/WinDebugger.cpp +++ b/IDEHelper/WinDebugger.cpp @@ -12502,5 +12502,5 @@ void WdAllocTest() } #endif + #endif //!defined BF32 || !defined BF_DBG_64 -//ab \ No newline at end of file