Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Nova - Development » New Cargo/Fuel meter
New Cargo/Fuel meter Thu, 23 June 2011 17:04 Go to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
I've done a first cut of a new meter for fuel and cargo. This is designed for the cargo transfer dialogs and is clickable (and slideable).

I've put it on the Planet/Fleet details for now (where obviously it's not clickable!) but it uses a gradient for fuel/single cargos so I hope Mono paints this ok!

Will put this on the interfleet cargo box first, then retro-fit to planet/fleet cargo dialog and add some numeric counters for accuracy or typing values.

Report message to a moderator

Re: New Cargo/Fuel meter Thu, 23 June 2011 17:21 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
Moved my post here instead of a new thread Razz

The new cargo/fuel meter breaks the build on Mono.

This is 99% not your fault Morsen (Musmuris? which do you prefer?) as we've had this happen before with Mono. There seems to be an issue with 64 bit binary serialization(?) or assembly lookup and .resx files.

This is the error on FleetDetail.resx

/home/aeglos/Code/stars-nova/Nova/WinForms/Gui/Controls/Flee tDetail.resx: Error: Error: Invalid ResX input.
Position: Line 127, Column 5.
Inner exception: Couldn't find assembly 'Nova.Common, Version=0.4.4191.36784, Culture=neutral, PublicKeyToken=null'
 (Nova)


evil usually fixed this bugs by making a Converter class (See Common/Converters) but we're not really sure why this happens or what is the proper fix for it.

Report message to a moderator

Re: New Cargo/Fuel meter Thu, 23 June 2011 17:44 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
ACK! Sorry dude,
Simplest thing to do here is remove it! (which i've done). Might look in more detail but currently we don't need it and it can be added later if needed.
PlanetDetail may have the same issue - again just delete the file

Report message to a moderator

Re: New Cargo/Fuel meter Thu, 23 June 2011 17:48 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
I would rather have a look at it now rather than later though, find solutions sooner rather than later.

I'll try whipping out a TypeConverter for the cargometer and see if it works.

Report message to a moderator

Re: New Cargo/Fuel meter Thu, 23 June 2011 17:51 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
OK Smile Just wanted to get you back running ok quick - supposed to be watching TV with the wife now Wink

oh - and "Mus" is fine for short Smile (Not sure why I didn't get the Musmuris login on SourceForge)

Report message to a moderator

Re: New Cargo/Fuel meter Thu, 23 June 2011 19:31 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
Oh wow, I keep posting in the wrong places. Moved it here:

Well that got me nowhere, lol. I tried a TypeConverter but there were some issues with dependencies; CargoMeter is on Nova.Winforms.Gui.Controls and the Converters are on Nova.Common, but Nova cant reference Common, and Common can't reference ControlLibrary so I couldn't move the CargoMeter there... in the end I placed the converter in Nova.Winforms.Gui.Converters but it made no difference, problem remained.

Tried making Nova.Winforms.Gui.Controls available to FleetDetail (PlanetDetail also complains btw) but also didn't work, problem persists.

To clarify, since you removed FleetDetail.resx, PlanetDetail.resx still complains. If I remove it from the compilation (I can't seem to delete it on MonoDevelip) then the NovaGUI won't start anymore.

Report message to a moderator

Re: New Cargo/Fuel meter Thu, 23 June 2011 23:51 Go to previous messageGo to next message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
Well, i've reverted to r624 to continue working, as I could not fix it.

To my understanding the problem is that the forms must serialize their data so that the underlying code can read it, and this is what the TypeConverters are for, since .Net can't know how to serialize custom controls.

I tried making a TypeConverter for the new control but failed, so I clearly did not make it right. I read somewhere that there is an alternative attribute, DesignerVisibility or such, that allows the data to be serialized to code instead of to resource files, but didn't delve too much into it. The fact that I'm on Mono for the next couple of days does not help the matter either.

I tried deleting the .resx file as you did, but still got errors as the resource manager on PlanetDetails could not find it's associated resources, whichever they are.

Report message to a moderator

Re: New Cargo/Fuel meter Fri, 24 June 2011 04:05 Go to previous messageGo to next message
Musmuris

 
Master Chief Petty Officer
Stars! Nova developer
Stars! Nova developer

Messages: 96
Registered: June 2011
deleting it via visual studio must do some other magic - it's gone so so you can get latest.

The .resx files are meant to be used for localizing so would contain different data depending on if you were in Germany, or France or wherever. You might have different strings (obviously) but also positions may change or orderings and other display. A different one can be chosen at runtime then.

Typeconverters in WinForms are mainly a way to convert from Text to Object for the studio designer. e.g. most controls have a Margins property that in the designer properties windows appears like "3,3,3,3". The type convertor takes that string and makes a new Margins(3,3,3,3). In this case it may have wanted one for the Cargo type - e.g. a String like "100,50,20,10" where the numbers would be ironium, boronium, germanium and colonists.

But we don't the .resx and they can be added in the future if we do.

Sorry - I'll try to bear this in mind next time.

Report message to a moderator

Re: New Cargo/Fuel meter Fri, 24 June 2011 04:27 Go to previous message
Aeglos is currently offline Aeglos

 
Chief Warrant Officer 1
Stars! Nova developer
Stars! Nova developer

Messages: 142
Registered: May 2011
Location: Chile
No biggies, the magic of SVN helped me there.

That explanation makes it clearer, thanks. I suspect it's probably something on the Mono resource compiler then, as I said, it's not the first time it's happened.

Report message to a moderator

Previous Topic: Check out the Stars! Nova developers
Next Topic: XML Serialization
Goto Forum:
  


Current Time: Fri Mar 29 09:52:59 EDT 2024