Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For archived contracts, show accepted/finished dates. #36

Merged
merged 3 commits into from
May 14, 2022

Conversation

NathanKell
Copy link
Contributor

Small QoL feature: right now KSP shows accepted/offered/deadline/etc dates for offered and active contracts, but shows no date at all for archived contracts. This patch makes it so that archived contracts show the date they were accepted and the date they completed/failed/etc.

Defaults to false, which I think is correct? I mean, I would always play with it turned on, but I'm not 100% comfortable making that call be the default.

@NathanKell
Copy link
Contributor Author

NathanKell commented May 9, 2022

And once again a transpiler might be nice but it didn't feel worth it. Truly minor amount of allocs and it's in UI code anyway.

@gotmachine
Copy link
Contributor

And once again a transpiler might be nice but it didn't feel worth it. Truly minor amount of allocs and it's in UI code anyway.

Yeah, given that the whole thing uses string concatenation all over the place instead of StringBuilders this isn't gonna make any significant difference in terms of GC allocs.

Defaults to false, which I think is correct? I mean, I would always play with it turned on, but I'm not 100% comfortable making that call be the default.

Feels like worst case scenario would be the patch doing nothing, so probably fine to enable it by default ?
Did you test this in conjunction with ContractConfigurator ? It has a MissionControlTextRich() override, but looking at it, should be fine :
https://github.com/jrossignol/ContractConfigurator/blob/7015264e285f00d4d2772888d8b9e1d992b34fc1/source/ContractConfigurator/ConfiguredContract.cs#L618-L630

@NathanKell
Copy link
Contributor Author

Worst case scenario is the text looks wrong in other languages, but if it does then the stock date text for offered contracts probably does too. Other than that, yeah, worst is it does nothing.

Hilariously I didn't realize CC did that, so...I've only tested it with CC.

@NathanKell
Copy link
Contributor Author

(By looks wrong I mean translated word + ":" + date is what this outputs, but so does stock code.)

@gotmachine gotmachine merged commit 2b7ff3a into KSPModdingLibs:dev May 14, 2022
@NathanKell NathanKell deleted the ShowContractFinishDates branch May 16, 2022 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants