Skip to content

Support contract parameter preview#63

Draft
periodically-makes-puns wants to merge 1 commit intomockingbirdnest:masterfrom
periodically-makes-puns:contract-configurator-fixes
Draft

Support contract parameter preview#63
periodically-makes-puns wants to merge 1 commit intomockingbirdnest:masterfrom
periodically-makes-puns:contract-configurator-fixes

Conversation

@periodically-makes-puns
Copy link
Contributor

Intended to resolve #52. This converts both contract parameters currently implemented over to ContractConfiguratorParameters so we can support preview. It also changes to using SetState calls to avoid the deprecated SetComplete etc. functions.

Each contract will first attempt to grab connection and station information from the Network. If they haven't been loaded yet, it will grab info from the definitions. It then generates a preview string based on the information needed to fill out the full contract parameter title, minus current status and availability. The preview string formats are generally identical to their non-preview counterparts, though point to multipoint parameters list all of their receivers directly rather than through subparameters.

To support generating the preview string, Network now supports caching station and connection definitions. It was already looping through every single definition every time to find a single station/connection definition, it just saves previous work now. This cache is not saved in any way - is this an issue?

I did not want to touch the current contract behaviour at all outside of supporting preview. This means the stations and connection still don't actually exist until the contract becomes offered for the first time.

This has minimal to zero effect on Mission Control load times on a fresh save. (Before caching the load times were really bad, but caching has dropped it to zero.)

(Why is this a draft? Because I have other fixes I'm working on, and this will clean up my Git state and mental notes a bit if I separate this out. This is kind of unimportant, and I don't know if this is the clean or intended way to handle this.)

Examples of it working:
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support contract parameter preview

1 participant