[?][BUG][ED] "Could not read editor options" error

Started by roltemurto, April 01, 2026, 07:22:13 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

roltemurto

Quote from: WillLem on April 01, 2026, 01:38:24 AMGlad to hear it worked, thanks for reporting back quickly! I'll get a hotfix release out soon :)

Great news. Since you're still polishing it, I like to report another thing you may wanna look at;

I get the "Warning: Could not read editor options from SLXEditorSettings.ini. Editor uses the default settings."

This happens even though the folders and files are NOT read-only and the exe runs as administrator. I am not sure if it's related to my locale again, but I keep having to customize my settings each time.
This is what my updated ini file looks like;
# SLXEditor settings
 EditorMode          Auto
 DefaultAuthorName      E
 DefaultTemplate       
 ValidateWhenSaving     True
 Autosave               2
 AutosaveLimit          5
 PieceBrowserMode       ShowData
 AutoPinOGStyles        True
 PreferObjectName       False
 InfiniteScrolling      False
 ShowRandomButton       False
 UseAutostart           True
 GridSize               1
 GridColor              MidnightBlue
 TriggerAreaColor       Pink
 CustomMove             64
 Button_Tooltip         3

 Form_Maximized         True
 Form_Width             872
 Form_Height            469

 ShowAboutAtStartup     True
 ShowControlHints       True
 AllTabsExpanded        False
 HighlightGroups        False
 HighlightErasers       False

 LevelArrangerOpen      False
 LevelArrangerMaximized False
 LevelArrangerLocation  301,71
 LevelArrangerSize      2126,1089

 PieceBrowserOpen       False
 PieceBrowserMaximized  False
 PieceBrowserLocation   643,381
 PieceBrowserSize       1425,148

 Display                Triggers
 Display                Rulers
 Display                ScreenStart
 Display                Background

WillLem

Quote from: roltemurto on April 01, 2026, 07:22:13 PMI get the "Warning: Could not read editor options from SLXEditorSettings.ini. Editor uses the default settings."

There should be an "ErrorLog.txt" in the root folder where SLXEditor lives.

Can you make the error happen, then post the resulting ErrorLog.txt here so I can figure out what's going wrong. Or, let me know if the file isn't being generated.

Thanks.

roltemurto

I took a while for me to realize that you moved this under a separate topic, I thought I hallucinated reporting it  :) . Sorry about that.

My ErrorLog.txt file is above 10MBs ... Repeating multiple same errors "multiple" times. So I used Notepad++'s "remove duplicate lines feature. Here are the original unique lines from that file;

System.ArgumentException: Parametre geçerli değil.
   konum: System.Drawing.Bitmap..ctor(String filename)
   konum: SLXEditor.Utility.CreateBitmapFromFile(String filePath)
   konum: SLXEditor.LoadStylesFromFile.Image(String imageKey)
System.Exception: 'System.Exception' türünde özel durum oluşturuldu.
   konum: SLXEditor.LoadStylesFromFile.CreateNewTerrainInfo(String filePath)
   konum: SLXEditor.LoadStylesFromFile.ImageInfo(String imageName)
   konum: SLXEditor.ImageLibrary.AddNewImage(String imageKey)
System.NullReferenceException: Nesne başvurusu bir nesnenin örneğine ayarlanmadı.
   konum: SLXEditor.SLXEditForm.ReadLevelInfoFromForm(Boolean allowWriteBack)
   konum: SLXEditor.SLXEditForm.textbox_Leave(Object sender, EventArgs e)
   konum: SLXEditor.SLXEditForm.chk_Lvl_AutoStart_Leave(Object sender, EventArgs e)
   konum: System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e)
   konum: System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
   konum: System.Windows.Forms.CheckBox.set_Checked(Boolean value)
   konum: SLXEditor.Settings.ReadSettingsFromFile()
   konum: SLXEditor.LoadStylesFromFile.CreateCompositeImage(String filePath, List`1 anims, LoadStyleAnimData primaryAnim, Int32& marginLeft, Int32& marginTop, Int32& marginRight, Int32& marginBottom, Boolean forceOriginalSize)
   konum: SLXEditor.LoadStylesFromFile.CreateNewObjectInfo(String filePath)
   konum: SLXEditor.SLXEditForm.CommitLevelChanges()
   konum: System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
   konum: System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
System.DivideByZeroException: Sıfırla bölme girişiminde bulunuldu.

And here's the translated version;

System.ArgumentException: Parameter is not valid.
   at System.Drawing.Bitmap..ctor(String filename)
   at SLXEditor.Utility.CreateBitmapFromFile(String filePath)
   at SLXEditor.LoadStylesFromFile.Image(String imageKey)
System.Exception: Exception of type 'System.Exception' was thrown.
   at SLXEditor.LoadStylesFromFile.CreateNewTerrainInfo(String filePath)
   at SLXEditor.LoadStylesFromFile.ImageInfo(String imageName)
   at SLXEditor.ImageLibrary.AddNewImage(String imageKey)
System.NullReferenceException: Object reference not set to an instance of an object.
   at SLXEditor.SLXEditForm.ReadLevelInfoFromForm(Boolean allowWriteBack)
   at SLXEditor.SLXEditForm.textbox_Leave(Object sender, EventArgs e)
   at SLXEditor.SLXEditForm.chk_Lvl_AutoStart_Leave(Object sender, EventArgs e)
   at System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e)
   at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
   at System.Windows.Forms.CheckBox.set_Checked(Boolean value)
   at SLXEditor.Settings.ReadSettingsFromFile()
   at SLXEditor.LoadStylesFromFile.CreateCompositeImage(String filePath, List`1 anims, LoadStyleAnimData primaryAnim, Int32& marginLeft, Int32& marginTop, Int32& marginRight, Int32& marginBottom, Boolean forceOriginalSize)
   at SLXEditor.LoadStylesFromFile.CreateNewObjectInfo(String filePath)
   at SLXEditor.SLXEditForm.CommitLevelChanges()
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
System.DivideByZeroException: Attempted to divide by zero.

I'm not sure why is it throwing too many errors and produced 184146 lines of errors between 20260330140005 - 20260402061859 but I'm deleting the file now to see what new errors it'll fill up with.


WillLem

Quote from: roltemurto on Today at 03:49:02 AMI took a while for me to realize that you moved this under a separate topic, I thought I hallucinated reporting it  :) . Sorry about that.

Haha! Apologies, it's just easier to keep track of these things when they have separate topics.

Quote from: roltemurto on Today at 03:49:02 AMI'm deleting the file now to see what new errors it'll fill up with.

Thanks for posting the full Error logs, some of those will no doubt be from before the previous "ToUpperInvariant" fix.

It would be helpful if you could clear the logs, then generate the settings error, and post just what comes up from that error.

From what you posted above, it seems to be a null reference exception when attempting to read settings. However, this doesn't tell us why the error occurred. Your settings file is clearly there, and the Editor is now locale-aware (although, there may be more that needs to be done in this regard).

So, let's see what comes up in the log from only the settings error. And, something to check in the meantime: is your settings file being saved to the "settings" folder in your SLX directory when it gets regenerated?

If nothing useful comes up in the log, I'll expand the error reporting to try and pinpoint exactly what's causing the null reference. But, let's completely exhaust the existing system first.