Fix saved profile parsing and selection#7
Open
Sean-Kenneth-Doherty wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
(x, y),(x, y, z), andRGBA(...)strings.Why
Custom profile export writes Unity
ToString()values for several color and vector settings. Those strings include wrappers such asRGBA(...)and parentheses, but the parser was attempting to parse the wrapped text directly. That can make saved/custom profiles reload with broken color grading or vignette values.The active-scene profile selector also updated the scene mapping without replacing the camera profile if one was already assigned, so selecting a different profile for the current scene could appear to do nothing.
This is a focused subset related to the custom preset/profile loading reports in #2 and the older profile-switching fixes proposed in #1.
Validation
KS3P.dllwithmcs -define:UNITY_5_6_OR_NEWERagainst local KSP 1.12.5 managed assemblies. Result: compilation succeeded with the existingUnityEngine.WWWobsolete warnings inShaderLoader.cs.(0.25, 0.75),(1.10, 0.20, -0.30),RGBA(0.25, 0.50, 0.75, 1.00), andRGBA(128, 64, 255, 255). Result: parsed values matched expectations.GameData/KS3Passets from SpaceDock installed, includingConfiguration.cfg,DefaultConfig.cfg,Plugin/KS3P.dll, andShaders/postprocessingshaders-linux.unity3d.origin/masterDLL loaded the released Linux shader bundle but parsed the wrapper values incorrectly:center=0.000000,0.000000vignetteColor=0.000000,0.001961,0.000000,1.000000mixerRed=0.000000,0.200000,0.000000gain=0.000000,0.250980,0.000000,1.000000RESULT centerOk=False colorOk=False mixerOk=False byteColorOk=False pass=Falsecenter=0.250000,0.750000vignetteColor=0.250000,0.500000,0.750000,1.000000mixerRed=1.100000,0.200000,-0.300000gain=0.501961,0.250980,1.000000,1.000000RESULT centerOk=True colorOk=True mixerOk=True byteColorOk=True pass=Truegit -c core.whitespace=blank-at-eol,blank-at-eof,space-before-tab,cr-at-eol diff --check. Result: passed.Caveat
The runtime proof is headless at Main Menu with the released mod assets loaded; I did not capture an interactive visual post-processing screenshot in flight.