Skip to main content

News

Topic: The Sphere Studio v1.2.1 (Read 204282 times) previous topic - next topic

0 Members and 5 Guests are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.6.0
Reply #285
That's weird it only closes the tab, doesn't quitting from an exception usually kill the whole process?
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.6.0
Reply #286
Usually! (I wonder if it being in a plugin has something to do with it?)

I see there is an issue with HelpLabel. It's null, and as is tradition in C# like languages, there were no checks for it being null and thus the crash.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.6.0
Reply #287
VS2012 is having issues with names. It cannot compile my code because it cannot recognize this:

Quote

new MapEditPlugin.Components.MapControl();


Which is weird since it compiled just fine before I opened the map editor in the visual designer. It's the designer doing this partly because a plugin and namespace share the same name: MapEditPlugin.

This will be a consistent issue throughout the code until I change all namespaces to not equal the same name as a class in it (or vice versa) in each solution with this issue (I think most of them do). Heh, sometimes refactoring makes code easier to read / more manageable but in this case it won't compile!
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.6.0
Reply #288
Seems like a bug because in a lot of cases I've seen the designer qualify component classes using global:: to avoid ambiguity, but here it's not doing it. I wonder if VS 2013 fixed/will fix this...

Want me to refactor it while I'm doing the other stuff? I haven't gotten started on those bugfixes yet, this might give me some more incentive.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.6.0
Reply #289
Sure! Just to let you know it's generally not a good idea to have a namespace and a class share the same name. Ideologically they should mean two separate things, the class is a specific object type (unless it's flagged ambiguous) and a namespace is a general collection that defines a common thread the components do.

Also it's not intuitive to access a class or namespace - IE it won't compile if you try to access a class's static method or access a namespace. Though I do admit, the plugins make it all too simple for this to happen.
  • Last Edit: September 09, 2013, 11:29:15 pm by Radnen
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.6.0
Reply #290
Indeed there's a distinction, however this case it seemed the most intuitive (and I believe at least one of the pilot plugins used the same convention before I started tinkering, maybe not though): the namespace contains all the stuff belonging to the plugin, which in turn happens to contain a class representing the plugin itself.  The most logical convention in such a case is for them to have the same name.  But yeah, best to refactor it now that we're aware of the issues.

I still call VS bug, though: the language has constructs in place to disambiguate such things, and the designer will indeed load the component without getting confused.  There's no reason it couldn't generate non-ambiguous code when saving it.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.6.0
Reply #291
Alright, I fixed the untitled files and naming collisions (plugins, at least stock ones, should now use SphereStudio.Plugins as a namespace by convention), but I couldn't reproduce the tileset index exception, selecting the last tile works as expected here.  What are the specific steps you did to cause that crash?
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.6.0
Reply #292
You add a tile, select it, remove the tile, and then click where it was.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Radnen's Sphere Studio v1.1.6.0
Reply #293
Hm, that's a tough nut to crack.  I tried a few things to fix it, including adding a conditional to SelectTiles() that checks if the selected tile is in range, yet somehow the if condition passed (wtf?!) and it crashed anyway.  I think I'll just fire off a pull request for my other changes and leave this one to you.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Radnen's Sphere Studio v1.1.6.0
Reply #294
I think there's a number of contributing problems with this bug. I've looked into it and not made much progress either, but what I've found:

https://github.com/Radnen/spherestudio/blob/master/MapEditPlugin/MapEditor.cs#L467

In TilesetControl_TileRemoved, it calls TilesetControl.Select to select the tile that has just been removed.

https://github.com/Radnen/spherestudio/blob/master/MapEditPlugin/Components/TilesetControl2.cs#L212

SelectTiles adds -1 to the Selected list when a tile is invalid. This is then checked for in other places, but imo this should be changed to just ignore invalid tiles so a selected value of -1 doesn't have to be handled anywhere else. e.g. instead of

Code: [Select]
if (tile < 0 || tile > Tileset.Tiles.Count - 1) tile = -1;
Selected.Add(tile);


A better solution would be

Code: [Select]
if (tile >= 0 && tile < Tileset.Tiles.Count)
{
  Selected.Add(tile)
}


The code is quite convoluted so I'm not sure on how it all fits together fully yet, so I might be wrong on this, but I don't see a reason to keep invalid selections in the Selected list.

I'm not sure, but I think TilesetControl.RemoveTiles should also remove the tiles from the Selected list, otherwise it can contain invalid tile indexes after removal.

I'm also not sure about this:

https://github.com/Radnen/spherestudio/blob/master/MapEditPlugin/MapEditor.cs#L452

Here, on the TileSelected event, it calls TilesetControl.SelectTiles again. I think this is dead code however, it's not referenced from MapEditor.cs and if it really was being run it would probably cause an infinite loop. I think the first thing to do is to clean up the map editor and tileset code.

Unfortunately when I was fiddling with all these things I still couldn't get it to work!

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.6.0
Reply #295
Hmm, I guess I'll recode the tile selection stuff. It was elegant at one point but then there were a series of changes that kinda added code here and there and got kinda got messier as time went on.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

Re: Radnen's Sphere Studio v1.1.6.0
Reply #296

Hmm, I guess I'll recode the tile selection stuff. It was elegant at one point but then there were a series of changes that kinda added code here and there and got kinda got messier as time went on.

I know that feeling!

Re: Radnen's Sphere Studio v1.1.6.0
Reply #297
No idea if you know about this, but this is what happens with Mono in Linux:

Code: [Select]
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at Sphere_Editor.SubEditors.ProjectTree.Refresh () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.OnEnabledChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.OnParentEnabledChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.OnEnabledChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.OnEnabledChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.set_Enabled (Boolean value) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:set_Enabled (bool)
  at System.Windows.Forms.Form.ShowDialog (IWin32Window owner) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.ShowDialog () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.MessageBox+MessageBoxForm.RunDialog () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.MessageBox/MessageBoxForm:RunDialog ()
  at System.Windows.Forms.MessageBox.Show (System.String text, System.String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) [0x00000] in <filename unknown>:0
  at Sphere_Editor.EditorForm.EditorForm_Shown (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.OnShown (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.SetVisibleCore (Boolean value) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.set_Visible (Boolean value) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:set_Visible (bool)
  at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000] in <filename unknown>:0
  at Sphere_Editor.Program.Main () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at Sphere_Editor.SubEditors.ProjectTree.Refresh () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.OnEnabledChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.OnParentEnabledChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.OnEnabledChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.OnEnabledChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.set_Enabled (Boolean value) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:set_Enabled (bool)
  at System.Windows.Forms.Form.ShowDialog (IWin32Window owner) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.ShowDialog () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.MessageBox+MessageBoxForm.RunDialog () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.MessageBox/MessageBoxForm:RunDialog ()
  at System.Windows.Forms.MessageBox.Show (System.String text, System.String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) [0x00000] in <filename unknown>:0
  at Sphere_Editor.EditorForm.EditorForm_Shown (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.OnShown (System.EventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.SetVisibleCore (Boolean value) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.set_Visible (Boolean value) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:set_Visible (bool)
  at System.Windows.Forms.Application.RunLoop (Boolean Modal, System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext context) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm) [0x00000] in <filename unknown>:0
  at Sphere_Editor.Program.Main () [0x00000] in <filename unknown>:0

Unhandled Exception:
System.ArgumentException: Object has been disposed.
  at System.Drawing.Font.ToHfont () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Drawing.Font:ToHfont ()
  at System.Windows.Forms.TextRenderer.MeasureTextInternal (IDeviceContext dc, System.String text, System.Drawing.Font font, Size proposedSize, TextFormatFlags flags, Boolean useMeasureString) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.TextRenderer.MeasureText (System.String text, System.Drawing.Font font) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ToolStripMenuItem.CalculatePreferredSize (Size constrainingSize) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ToolStripItem.GetPreferredSize (Size constrainingSize) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ToolStripDropDownMenu.OnLayout (System.Windows.Forms.LayoutEventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.PerformLayout (System.Windows.Forms.Control affectedControl, System.String affectedProperty) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.PerformLayout () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:PerformLayout ()
  at System.Windows.Forms.ToolStripItem.OnParentChanged (System.Windows.Forms.ToolStrip oldParent, System.Windows.Forms.ToolStrip newParent) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ToolStripItem.set_Parent (System.Windows.Forms.ToolStrip value) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.ToolStripItem:set_Parent (System.Windows.Forms.ToolStrip)
  at System.Windows.Forms.ToolStripItemCollection.Remove (System.Windows.Forms.ToolStripItem value) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ToolStripItem.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ToolStripDropDownItem.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ToolStripMenuItem.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
  at System.ComponentModel.Component.Finalize () [0x00000] in <filename unknown>:0


Then it crashes. But it does actually show up for a moment.

Re: Radnen's Sphere Studio v1.1.6.0
Reply #298
Trying to build it using Mon (xbuild):

Code: [Select]

/home/jester/Downloads/spherestudio-master/spherestudio-master/Sphere Studio.sln (default targets) ->
(Build target) ->
/home/jester/Downloads/spherestudio-master/spherestudio-master/TaskListPlugin/TaskListPlugin.csproj (default targets) ->
/usr/lib/mono/4.0/Microsoft.CSharp.targets (CoreCompile target) ->

TaskList.cs(186,62): error CS0246: The type or namespace name `BrightIdeasSoftware' could not be found. Are you missing an assembly reference?
TaskList.cs(198,63): error CS0246: The type or namespace name `BrightIdeasSoftware' could not be found. Are you missing an assembly reference?
TaskList.Designer.cs(277,17): error CS0246: The type or namespace name `BrightIdeasSoftware' could not be found. Are you missing an assembly reference?
TaskList.Designer.cs(278,17): error CS0246: The type or namespace name `BrightIdeasSoftware' could not be found. Are you missing an assembly reference?
TaskList.Designer.cs(279,17): error CS0246: The type or namespace name `BrightIdeasSoftware' could not be found. Are you missing an assembly reference?
TaskList.Designer.cs(280,17): error CS0246: The type or namespace name `BrightIdeasSoftware' could not be found. Are you missing an assembly reference?


Any ideas?

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: Radnen's Sphere Studio v1.1.6.0
Reply #299
The DLL in the TaskListPlugin/lib folder is not working? Try to reattach the dependency and perhaps it will compile. If not, then I think it may not be mono-compat. It is a plugin anyways and can totally be removed.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here