Jump to content

[Plugin - WIP] Contracts Window + [v0.4] 8/15/14


DMagic
 Share

Recommended Posts

See release thread for further updates: [thread]91034[/thread]

Download from KerbalStuff

Alternate download from MediaFire

The drag-able, expandable, moveable, Toolbar-able, persistent, collapsible window for all your contract monitoring needs.

** Toolbar is required; it will not function at all without it.

It displays all active contracts and their parameters; the parameters can be collapsed by clicking on the contract title. Notes are viewable by clicking on the [+] icon to the left of the relevant parameter. The colors change based on the contract and parameter state.

The vertical size, position and visibility (whether it's turned on/off by the Toolbar) are persistent; a settings file is located in the addon folder to store this data (technically you could edit the settings file to make it visible without Toolbar, but that's not practical).

This is very much a work-in-progress. I would like to know if anyone finds anything missing from this window that the stock contract window can do. I think most critical bugs have been worked out, but if anyone finds anything let me know. Also let me know if there are any problems with the font sizes or colors.

ChangeLog:

v0.4
- Contracts window settings stored on a per-game basis, rather than a global settings file
- Window options stored for each game scene
- Contracts can be moved back and forth between the standard display and a hidden list
- Toggle between the two lists using the 'eye' icon along the title bar
- Hide or reveal contracts using the 'eye' to the right of the contract title
-Sort based on contract type
- Any part test contracts with an altitude component will be sorted based on minimum altitude
- Tooltips for many buttons added
- Toggle tooltips with button on the footer bar
- Reset contracts display
- Use reset button on the footer bar
- A confirmation dialog box will appear
- Does not affect contract status, only updates appearance on the window
- Use in case of errors/duplicate contracts displaying
- Proper handling of sub-parameters
- Improvements to editor click-through
- VAB part tooltips should not appear or be selectable through the contracts window

v0.3.1
- Fixed debug options causing infinite fuel to be turned on

v0.3
- Various aesthetic improvements
- Replace several text buttons with icons
- Cleaner interface
- Use stock reward icons

- More compact form

- More information presented in expanded mode
- Information periodically updates

- Improvements to dragging, click-through, and resizing.

v0.2
- Folder structure changed, delete and copy new version into GameData folder

- Sort options
- Variety of sort methods
- Ascending and descending order

- Horizontally expandable
- Three modes included
- Default compact window
- Middle version shows time to expiration (doesn't update until the contracts reload)
- Wide version shows Fund reward amounts

- Removed some click-through issues

This addon uses TriggerAu's KSP Plugin Framework code

Released under the MIT License

Source is available at GitHub

Edited by DMagic
release thread
Link to comment
Share on other sites

Yaaay

Thats so usefull. Thank you.

Thanks for this, man.

Yeah, the stock window can get a little rough when you're trying to test out a dozen contracts, this makes it a little nicer.

Cool. I was going to suggest you release this separate from the science parts anyway, for those that just want the plugin. (Which is me when I'm in one of my stock-only saves.) Glad to see we're of a similar mind.

I never planned on releasing it with DMagic Orbital Science, I just showed it there because I didn't want to make a new thread.

do you know about each other

That one was posted to KerbalStuff just before me. :sticktongue: I guess I wasn't the only one who wanted to do something about the stock contract window.

Link to comment
Share on other sites

Version 0.2 has been released: Download From KerbalStuff

I added some sort options and made the window expandable horizontally. It can show the time remaining for each contract and the Funds rewards for each contract and each parameter if they have any. I also fixed a few things here and there, but it's still very utilitarian. Just ignore that it still says v0.1 on the title bar of the window, I forgot to change that. :confused:

The plan is to continue expanding on the widest mode, showing all of the available Funds, rep and science rewards and penalties.

I also want to find a simple way to update the list. Currently it only updates when the contract manager reloads, this prevents the expiration time from updating and means that completed or failed contracts will stay on the list until you change scenes or re-load. Updating it more often would allow for more accurate expiration timers, and it would allow for more options on what to do with completed/expired contracts. I'm thinking that I could add a little confirmation box next to a finished contract that could be used to clear it from the list.

After that I'll get to the aesthetics.

Link to comment
Share on other sites

I like your layout and style more than the Contract Manager option, so I hope you continue with this :) Are the contracts collapsible / do you get a visual identifier for completed steps on a contract with multiple criteria?

Link to comment
Share on other sites

Version 3 is almost ready, just need to check a few more things and probably make a few more tweaks.

It's a little bit less ugly, and contains a lot more information. The fully expanded window might be getting a bit cluttered, I need to make sure everything is readable and makes sense.

BXBIp55.jpg

hkXMkqL.jpg

Link to comment
Share on other sites

Dude, everything you do is pure gold. Maybe you should rename your account to "Midas". :P

Thanks.

Version 0.3 is up; get it at KerbalStuff.

The interface has been cleaned up and looks a little better. Icons are used rather than text wherever possible.

The full reward properties are shown for each contract and their parameters.

Various other minor improvements have also been made.

Link to comment
Share on other sites

Thanks. A very, very helpful mod.

I would dearly love to see the ability to re-order or possibly group contracts so I can easily focus attention on the contracts that apply to the active mission/SOI.

Link to comment
Share on other sites

I love the mod, thanks for pointing me to it from another post DMagic. A couple suggestions you might consider adding eventually:

1.) A way to select individual contracts to be shown in a separate window or something for the contracts you plan to be doing just for that flight. This way you don't have to mentally filter through the other contracts you don't care about for that flight. When a contract is completed, it should automatically be removed from this extra window so it's not taking up visibility space.

2.) For the main window, an indicator of some sort to show which contracts overlap for altitude and again for speed requirements. Also, a way to sort them in ascending altitude order so you can easily see which contracts will be first as you fly.

3.) Possibly change the color of font for the requirements. Example: Red for not close to objective, yellow for approaching objective, and green for objective met (just like it already does). This way you would have a way to be alerted when you are close to needing to activate the part.

Hopefully these are helpful ideas. I was going to build my own mod and try to implement these, but I found I don't have the time right now (or patience).

Link to comment
Share on other sites

Well, there is a serious bug in this add-on. That no one else seems to have found it makes me wonder if it isn't due to some conflict with another mod. (I run with around 63 mods).

With version .3 installed, all my rockets consume fuel at about 1/1000th, or less, the normal rate, while providing normal thrust. For most rockets, it looks like they are consuming no fuel at all. I had to pair small tanks with large engines to see the numbers move at all during a flight.

Neat if you want "god mode", but I don't really get how that came out of a contract window mod! :)

Here is a snapshot of my GameData Directory. I don't have time today to try to troubleshoot which mod it might be conflicting with.

C:\Program Files (x86)\Steam\SteamApps\common\Kerbal Space Program\GameData\
000_Toolbar\
B9_Aerospace\
BahaSP\
CommunityResourcePack\
CrossFeedEnabler\
CustomBiomes\
DavonTCsystemsMod\
Diazo\
DistantObject\
DMagic Orbital Science\
Engineer\
ExsurgentEngineering\
FinePrint\
Firespitter\
Goodspeed\
HGR\
KAS\
KerbalJointReinforcement\
Kerbaltek\
KineTechAnimation\
Klockheed_Martian_Special\
KSPScienceLibrary\
KSPX\
LazTek\
MagicSmokeIndustries\
MechJeb2\
ModsByTal\
MunarWheel\
NASAmission\
NearFutureConstruction\
NearFutureElectrical\
NearFuturePropulsion\
NearFutureSolar\
NohArksPnP\
nothke_DROMOMAN\
NovaPunch2\
OLDD\
OpenResourceSystem\
PartCatalog\
ProbiTronics\
ProceduralFairings\
RemoteTech2\
ResGen\
ResourceConverter\
Romfarer\
SCANsat\
ScienceAlert\
SelectRoot\
ShipManifest\
SPD\
Sphaera\
Squad\
StageRecovery\
StationScience\
Tantares\
TarsierSpaceTech\
TextureReplacer\
ThrottleControlledAvionics\
TweakScale\
UmbraSpaceIndustries\
US_Core\
US_KAS\
WaylandCorp\
WorldCup2014\
XanderTek\
ModuleManager.2.2.1.dll
toolbar-settings.dat

Link to comment
Share on other sites

Well, there is a serious bug in this add-on. That no one else seems to have found it makes me wonder if it isn't due to some conflict with another mod. (I run with around 63 mods).

Check to see if infinite fuel is turned on in the debug menu (Alt + F12). Some debug options sneaked into version 0.3, so this is probably triggering that. I'll replace v0.3 tonight, or, if nothing is broken, release v0.4.

Edit: Updated download links with a fixed version. Nothing else has changed.

Edited by DMagic
Link to comment
Share on other sites

Yes, thanks for the fix! (Now let me hide away version 0.3, just in case....) I did make a couple fun craft that wouldn't have worked otherwise, but I didn't actually complete anything with them, had a little fun then reverted. :)

Link to comment
Share on other sites

Look carefully at the order of these contracts. They are sorted based on the minimum altitude for activation. And it's a bit harder to see, but it's also handling sub-parameters properly now.

The method is, unfortunately, not remotely flexible, only specified types of parameters are able to be sorted this way and the method for doing so is very clunky.

The "Type" sorting option actually sorts several times, first by contract type with the contract title as a secondary sorting parameter. Then it checks to see if at least two contract parameters have altitude values. It records their position in the list, sorts them by altitude (and contract title), then returns them to their position in the list in order. Any contract using the stock ReachAltitudeEnvelope or ReachFlightEnvelope parameter types should work fine, even if their parent contracts are modded.

wcf5wNA.png

Link to comment
Share on other sites

Version 0.4 released: KerbalStuff

Contract window settings are now stored in the persistent file using a scenario module. There is no need for the settings file anymore, you can delete it.

Individual contracts can be hidden using the eye icon to the right of their title. This will move them to a secondary list; use the icon in the top-left to switch between the two lists.

If you run into any problems here (contracts duplicated, not disappearing, etc...) use the reset icon on the footer bar to rebuild the contracts window list, this will spawn a confirmation dialog box before doing anything. This won't affect the contracts' status, it will only reset the window. I think most of these issues have been worked out, but let me know if anyone finds some way to break it.

Part test contracts with an altitude component can be sorted based on minimum altitude using the 'type' sort option.

Changelog:


- Contracts window settings stored on a per-game basis, rather than a global settings file
- Window options stored for each game scene
- Contracts can be moved back and forth between the standard display and a hidden list
- Toggle between the two lists using the 'eye' icon along the title bar
- Hide or reveal contracts using the 'eye' to the right of the contract title
-Sort based on contract type
- Any part test contracts with an altitude component will be sorted based on minimum altitude
- Tooltips for many buttons added
- Toggle tooltips with button on the footer bar
- Reset contracts display
- Use reset button on the footer bar
- A confirmation dialog box will appear
- Does not affect contract status, only updates appearance on the window
- Use in case of errors/duplicate contracts displaying
- Proper handling of sub-parameters
- Improvements to editor click-through
- VAB part tooltips should not appear or be selectable through the contracts window

Link to comment
Share on other sites

I made an interesting discovery today.

This is actually very simple, and if I can get other contract addon authors to play along it can work with anything that asks for a specific part. And maybe it will be possible to select the part from the contract window as well. This all only works in the VAB/SPH because it uses Squad's methods for generating the window, but I think that's the only place where it's really important.

7IkvyfL.jpg

Link to comment
Share on other sites

After much hair pulling and teeth gnashing I managed to pull in part names from external addons through reflection:

ngBjsYR.jpg

So I know this will work with future updates for my mod, and it should work for Fine Print, but I haven't checked how other mods are setup. Mine required adding some specific methods to handle this, which will probably be the case in most situations.

Sorting feature request:

Sort by planet body. So lump all Kerbin missions together, Mun missions etc.

Great mod thanks!

See above, sorting by planet would require something along the lines that. Not all contract parameters have a target planet field, and the ones that do handle it differently. So what would probably happen is that a handful of contracts could be successfully sorted based on their target planet and the rest would just get lumped together at the top or bottom.

It's not quite so important that all part-specific contracts work as above, because that only works in the VAB/SPH.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...