Jump to content

KSPField vs KSPEvent - externalToEVAOnly


Recommended Posts

I have a KSPField with the UI_ChooseOption user interface attached. Now I would really like to make it so, that it was only available on EVA. However, it turns out the KSPField does not have that feature, but UI_ChooseOption cannot be used with KSPEvents since it will not accept a method....

What can be done. I considered simply hiding the UI in flight unless I was on EVA. However, I am not sure how to do that.

Spoiler

I currently have this:        

[KSPField(guiActive = true, guiActiveEditor = true, isPersistant = true, guiName = "MultiMode")]
[UI_ChooseOption(affectSymCounterparts = UI_Scene.Editor, scene = UI_Scene.All, suppressEditorShipModified = false, options = new[] { "None" }, display = new[] { "None" })]
public string ChooseOption = string.Empty;

Does anybody know a nice way to have the above, or something similar to be bound to EVA.

Alternatively, can anybody advice on how to detect EVA? And which events to subscribe to to detect it.

Link to comment
Share on other sites

Put something into an Update ()  function that checks to see if you are EVA or not.  If so, enable it, otherwise disable it.

Lots of mods do this, just search for Events in a mod's code (events is capitolized).  On a phone now, otherwise I'd post an example

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

Put something into an Update ()  function that checks to see if you are EVA or not.  If so, enable it, otherwise disable it.

Lots of mods do this, just search for Events in a mod's code (events is capitolized).  On a phone now, otherwise I'd post an example

Thanks... But how do I check if I'm on EVA. The states is just landed, or space etc.

I will go through some mods, but if you know it would be a great help. Maybe I should start with eva enhancements, it must need to do this detection.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...