Add a ExtCam dedicated pageHandler to dynamically display camera's ID/Name#179
Open
nico97118 wants to merge 2 commits into
Open
Add a ExtCam dedicated pageHandler to dynamically display camera's ID/Name#179nico97118 wants to merge 2 commits into
nico97118 wants to merge 2 commits into
Conversation
Author
|
Hi @JonnyOThan I just found out the latest release of this project was made on the branch Shall I rebase this PR on |
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.
I've seen some commented code that were trying to set the camera ID in a persistent variable.
I assume this was motivated by the idea to display the camera ID in MFDs
I've tried to play a bit around this topic and I figure out there were no easy way to access camera's
IDorTransformfrom the text overlay. This brings up issue of finding the right persistent variable (or plugin getter) when several MFDs exists in the scene (almost every time, actually).Therefore, after digging a bit. I changed the strategy :
I created another module meant to be used as a pageHandler. In Addition with the existing
JSISteerableCameramodule used asbackgroudHandlerJSICameraStatusPage') to keep the flexibility provided by text overlays -> This will search and replace theCameraStatusToken(.i.e."CAMERA_STATUS"`) in the overlay with the actual camera name or ID, depending on the configuration of the module.JSICameraStatusPageis used in a page, it override thetext =attribute of this page.I'm aware that this PR might not be as clean as I wish since I'm not really experienced in KSP modding. But I'm feeling this might be a good starting point for discussions. And see if such a feature would interest anyone.
Exemple
Here is a config extract for an MFD (ALCORMFD40x20) :
Notice that I commented the original text field (but I could left it as is, since it is override by the pageHandler.
Also, note that I copied its path to forward it to JSICameraStatusPage through
overlayTemplatePathso my display stays the same.I only added
__CAMERA_STATUS__in the overlay orignal fine at the place I wanted to display the camera's name.