-
Notifications
You must be signed in to change notification settings - Fork 115
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
add customizeable option RDRotation #234
Conversation
if you also want the customizeable option merge this PR first, and then merge #233 |
@@ -277,6 +277,19 @@ public EnumParser<RDVisibility> hiddenRnD | |||
set { celestialBody.Set("hiddenRnD", value.value); } | |||
} | |||
|
|||
// If the body should be hidden in RnD | |||
[ParserTarget("RDRotation")] | |||
public NumericParser<bool> RDRotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to RnDRotation
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we change RDVisibility as well?
or do you want to have RDVisibility and RnDRotation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good idea, but I wouldn't change it. Instead we should add a second ParserTarget with the new name to it.
@@ -40,14 +40,14 @@ namespace Kopernicus | |||
/// </summary> | |||
public class RnDFixer : MonoBehaviour | |||
{ | |||
List<RDPlanetListItemContainer> stars = new List<RDPlanetListItemContainer>(); | |||
internal static List<RDPlanetListItemContainer> RDRotationKill = new List<RDPlanetListItemContainer>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RnDRotationKill
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the list of bodies for which we want to "kill" the rotation
it's not required that they are stars, but someone might want to kill the rotation of other bodies
I initially had named it stars because I didn't intend to allow the users to choose which bodies to select
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know. I was just suggesting a new name (with an n)
@@ -252,9 +252,10 @@ void Start() | |||
} | |||
} | |||
|
|||
if (planetItem?.planet?.GetComponent<StarComponent>() != null) | |||
// Kill Rotation | |||
if (body.Has("RDRotation") ? !body.Get<bool>("RDRotation") : planetItem?.planet?.GetComponent<StarComponent>() != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh, I would just check if the body is in KopernicusStar.Stars, but this works too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure how KopernicusStar worked
do you keep all stars in there? even those with "GivesOffLight = False" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly I would restrict the "off" feature only to those stars that have coronas, since the only downside of rotating stars is that the corona rotates together with the star >_>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats fine.
return generatedBody.Get<bool>("RDRotation"); | ||
return generatedBody?.scaledVersion?.GetComponentsInChildren<SunShaderController>(true)?.Length > 0; | ||
} | ||
set { celestialBody.Set("RnDrotation", value.value); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix this.
No description provided.