Jump to content

[1.12.x] IndicatorLights v1.8.3: Small, convenient, informative.


Snark

Recommended Posts

Hi all,

I'm proud to announce the release of IndicatorLights v1.1, a.k.a. "The Community Edition" (in honor of the many users who have contributed helpful suggestions, bug diagnoses, etc.)

Thanks to @Fwiffo, @Sharpy, @Beetlecat, @Kerbas_ad_astra, and @Jiraiyah for the many helpful suggestions that went into this revision!

New in this release:

  • Changed to CC-BY-NC-SA license (was previously MIT).  (I don't expect this to impact users. The most substantive change is that "you can't make money from it" and "if you include it in anything, you need to have a compatible license.")
  • KSP 1.2 compatibility.  :)
  • Repackaged with ModuleManager v2.7.1 (for KSP 1.2).
  • Add /il console debugging command. Try /il help for details!
  • ModuleToggleLED parts (e.g. BL-01 light, docking ports) are in Light action group by default, without requiring DefaultActionGroups.
  • ModuleControllableEmissive implementation reworked for stability & performance.
  • Fix a bug in which multiple parts would change indicator color when one part changes status.
  • Add new ModuleScienceContainerIndicator.
  • Add indicators to the new KSP 1.2 "science box" part.
  • Add new IScalar interface; many existing modules now implement.
  • Add new ModuleScalarIndicator.
  • Add new ModuleBooleanIndicator (replaces old ModuleIndirectToggleIndicator)
  • Add new "examples" folder in github.
  • Add an example showing how to have one indicator that tracks multiple resources. (Thanks to Fwiffo for suggesting.)
  • Fix indicator positioning on mini ISRU. (Thanks to Fwiffo for pointing out!)
  • ModuleScienceDataIndicator on multi-experiment parts can now specify which one. (Thanks to Fwiffo for suggesting.)
  • Modify the dim() syntax to allow brightening. (Thanks to Fwiffo for suggesting).
  • Fix incompatibility with Texture Replacer. (Thanks to Fwiffo for tracking this down.)
  • Add compatibility with TweakScale. (Thanks to Sharpy for requesting, and explaining how.)
  • Add random() color source type, along with an example. (Thanks to Beetlecat for suggesting.)
  • Not included here, but: A shout-out to Kerbas_ad_astra and Jiraiyah for supplying mod-compatibility patches, which were spun out to their own mod, IndicatorLights Community Extensions.

Thanks also to Kerbas_ad_astra for a helpful discussion about software licenses.  I've been moving all my mods from their original MIT license to a more restrictive CC-BY-NC-ND.  Discussion with Kerbas, plus talking with an enterprising user who wants to incorporate IndicatorLights functionality in the new mod he's working on, convinced me to pick a more permissive license for IndicatorLights.  I settled on CC-BY-NC-SA.

Note that I haven't yet updated the modder's documentation for the new features in 1.1; that will be coming soon™, please be patient.

Anyway, enjoy!  :)

Link to comment
Share on other sites

  On 10/13/2016 at 12:22 AM, DStaal said:

On the licensing thing: Creative Commons recommends you not use their licenses for software.  They aren't designed for it - they are designed for more traditional literary works.

Expand  

Yup, @Kerbas_ad_astra pointed that out, too.  I may reconsider in the future, if appropriate.  For now I'm fine with CC and preferred not to go with GPL for various reasons.  Licenses are an important topic, but I really don't feel like debating about them right now.  I do appreciate the concern, though, thanks for pointing out.

Link to comment
Share on other sites

  On 10/10/2016 at 10:21 PM, Snark said:

A lot of the antennas don't exactly have a lot of open, "flat" places where it would be easy to slap on an indicator.  Where the dickens do you put an indicator on a Communotron-16, anyway? There's practically nothing there; heck, I have trouble just targeting the darn thing with my mouse.

Expand  

How about some kind of ring around part of the base? For the umbrella (88-88) you could put it in the center so you can see it when it's open. For the new ones maybe a light on the end of the antenna/dish focus for the ones that don't move and on the base for those that do. 

Random blinking like you say might be a cool way to indicate active transmission, then you can use color for signal status.

Also, the science container could use a simple does/does not contain data light... if you think it's worth the effort.

Edited by Starbuckminsterfullerton
Link to comment
Share on other sites

  On 10/13/2016 at 2:19 AM, Starbuckminsterfullerton said:

How about some kind of ring around part of the base?

Expand  

Well, if you read just a few messages above,

  On 10/11/2016 at 7:44 AM, hab136 said:

Could you put a light at the base of the antenna, centered at the middle of the antenna, but thick enough that it extends out?  The effect would wind up being that most of the light is hidden by the mast of the antenna, but a "donut" surrounds the base.

Expand  

 

  On 10/11/2016 at 8:30 PM, Snark said:

Yah, that's pretty much what I was thinking.

Expand  

 

And,

  On 10/13/2016 at 2:19 AM, Starbuckminsterfullerton said:

Also, the science container could use a simple does/does not contain data light... if you think it's worth the effort.

Expand  

Actually, I did, which is why:

  On 10/12/2016 at 11:16 PM, Snark said:
  • Add indicators to the new KSP 1.2 "science box" part.
Expand  

:wink:

...The implementation on the science container is pretty similar to the science instruments:  green for high-value science, yellow for medium, dim red for low, off for none.  If it contains multiple science results, it will show a color based on the highest-value result.

Enabling this functionality on the science container involved implementing a new ModuleScienceContainerIndicator.  Right now the only part that actually uses it is the science container, but (for example) if someone wanted to have such indicators on other science-container parts (e.g. a crew capsule, or one of the larger probe cores), it would be possible to add them with some ModuleManager config.

 

Link to comment
Share on other sites

Hi all,

I've released v1.2 of IndicatorLights, a.k.a. "The Antenna Edition".  Three guesses what's in this one.  :)

antennas.png

All antennas now have an indicator that lights up while science data is being transmitted.  The light has a random "flicker", like old-style modem lights.  The speed of the flicker is tied to the transmission speed of the particular antenna:  faster antenna = faster flicker.  (Thanks to @Beetlecat for suggesting the feature.)

Note that the screenshot above is for illustrative purposes only, and isn't typical of what you'd see in-game.  Normally you'd never see that many antennas lit up at once, unless you happen to have scads of science data and everything's actually transmitting simultaneously.  Here's what it looks like in action:

data%20transmission.gif

Besides the antennas, other changes in this version include:

  • Fixed a bug that caused IndicatorLights-enabled meshes to break the thermal overlay display.  (The Science Jr. was especially bad, since it affected the whole part.  Most parts, it's just the actual indicator meshes themselves.)
  • Added some new "scalar" parsing syntax for more flexible configurability of color sources.  (This is of interest mainly to modders; the idea is to enable certain modules to declare "scalar fields" that can be referenced in ColorSource syntax.  It's how I get the antenna lights' flicker speed to be automatically tied to the antenna's data rate.  I've fallen way behind on updating the "modder's guide" documentation... this feature will make a lot more sense once I've had a chance to update the docs.  Thank you for your patience.)

Enjoy!

Link to comment
Share on other sites

Hey @Snark I'm updating some of my parts to your latest IndicatorLights.  I noticed you have an MM patch for the Mk 1 Lander Can which makes use of excludedRenderer.  Where did you learn of this magical directive and what does the "(Clone)" syntax mean?

For a part that has several different emissives meshes can I do something like:

excludedRenderer = IndicatorLights/Meshes/squareLamp(Clone)
excludedRenderer = IndicatorLights/Parts/indicatorLightSmall/model(Clone)
excludedRenderer = IndicatorLights/Meshes/nubbinLamp(Clone)
excludedRenderer = IndicatorLights/Meshes/squareLamp2(Clone)

Also really interested whether the treasure chest you found it in has something that might give me a better way to deal with #3 and #4 here (e.g. a way to more fully-qualify animationName when multiple meshes on a part have animations with the same name, and tie them to specific ModuleScienceExperiment's).

ps. I noticed (with some help from GitHub's searchbox)  ;-).

Edited by Fwiffo
Link to comment
Share on other sites

  On 10/12/2016 at 11:16 PM, Snark said:

Modify the dim() syntax to allow brightening

Expand  

Did you end up implementing a complementary brighten() verb?

I see there is indeed.  Any reason you went with "brightness" instead of "brighten"?  Not a big deal, just wondering :-).

Edited by Fwiffo
Link to comment
Share on other sites

  On 10/12/2016 at 11:16 PM, Snark said:

ModuleScienceDataIndicator on multi-experiment parts can now specify which one.

Expand  

Why doesn't ModuleScienceAvailabilityIndicator also have an experimentId field?

How does it currently pick which experiment to indicate?  (Or does it activate whenever any science is available?)

Edited by Fwiffo
Link to comment
Share on other sites

  On 10/22/2016 at 9:02 AM, Fwiffo said:

 I noticed you have an MM patch for the Mk 1 Lander Can which makes use of excludedRenderer.  Where did you learn of this magical directive

Expand  

From chatting privately with one of the devs.  In KSP 1.2, ModuleColorChanger was added to the "old-school" crewed parts (like the Mk1 command pod), which gave us cabin lights... but happened to completely break IndicatorLights on those parts.  Was asking a dev about it.  It turns out that there's a feature includedRenderer and excludedRenderer on that module that gives the part to specify specific meshes not to be controlled by ModuleColorChanger.  So I added excludedRenderer for my meshes, to prevent my module from arm-wrestling with Squad's.

 

  On 10/22/2016 at 9:02 AM, Fwiffo said:

what does the "(Clone)" syntax mean?

Expand  

It's a ModuleManager wart.  Whenever you add a mesh to a part via ModuleManager (like this), it turns out that ModuleManager actually appends the word "(Clone)" to the end of the name of the mesh in the part.  I have no idea why it does this, it just does.

In most of the IndicatorLights config, you never see this, because I've specifically added IndicatorLights code to deal with the "(Clone)" thing.  By doing this, I can hide that detail from the user, so you can just say things like this without having to insert a silly "(Clone)" all over the place.

However, in the config line that you noticed, I can't hide the "(Clone)", because I'm giving a directive to a stock Squad module and I need to tell it the actual, literal name of the mesh on the part.

  On 10/22/2016 at 9:02 AM, Fwiffo said:

Also really interested whether the treasure chest you found it in has something that might give me a better way to deal with #3 and #4 here (e.g. a way to more fully-qualify animationName when multiple meshes on a part have animations with the same name, and tie them to specific ModuleScienceExperiment's)

Expand  

Alas, no.  It's only a specific thing to ModuleScienceExperiment. I wouldn't have a clue about the ModuleAnimateGeneric issues you're running into.

  On 10/22/2016 at 11:36 AM, Fwiffo said:

Any reason you went with "brightness" instead of "brighten"?

Expand  

Mainly that "brighten" felt weird to me when it could be actually dimming.  "brightness" struck me as more neutral.

  On 10/22/2016 at 12:52 PM, Fwiffo said:

Why doesn't ModuleScienceAvailabilityIndicator also have an experimentId field?

Expand  

Because it didn't occur to me and nobody mentioned it until now.  See, not all answers have to be complicated.  :)  (Yeah, I should add that.)

  On 10/22/2016 at 12:52 PM, Fwiffo said:

How does it currently pick which experiment to indicate?

Expand  

It just iterates modules on the part and picks the first ModuleScienceExperiment it comes across-- the same way that ModuleScienceDataIndicator used to do, before I added the feature to allow specifying experimentId.  I just need to add that feature to ModuleScienceAvailabilityIndicator too.

 

Link to comment
Share on other sites

  On 10/22/2016 at 3:46 PM, Snark said:
  On 10/22/2016 at 12:52 PM, Fwiffo said:

Why doesn't ModuleScienceAvailabilityIndicator also have an experimentId field?

Expand  

Because it didn't occur to me and nobody mentioned it until now.  See, not all answers have to be complicated.

Expand  

I'd be happy to beta test it.  My multi-science-module part has experimentId lines ready and waiting to be uncommented ;-)

Link to comment
Share on other sites

I'm having trouble getting the new experimentId stuff to work properly.  I have a craft that includes two ModuleScienceExperiment's with different experimentId's (mysteryGoo and temperatureScan), but both are behaving as if they're hooked up to the mysteryGoo.

Here's my part:

  Reveal hidden contents

Did I do something wrong, or is this a bug?

Link to comment
Share on other sites

  On 10/24/2016 at 3:43 AM, Fwiffo said:

Did I do something wrong, or is this a bug?

Expand  

I'm not at a KSP computer right now, but just eyeballing your config, it generally looks pretty good.  However, I note that where you set up the ModuleScienceDataIndicator modules, you're trying to set a field named "experimentId".

However, the field is actually named experimentID, not experimentId.  "ID", not "Id".  I don't know exactly how ModuleManager maps text values from .cfg files to actual member fields on C# classes, but I'm guessing it's case-sensitive.  If that's the case, then what you're doing is setting a nonexistent field "experimentId" (which I assume MM just ignores), and leaving experimentID at its default null value, which causes the module to follow its default behavior of "just pick the first one you see."

Link to comment
Share on other sites

Possible bug: Reaction wheels blink when your craft is first launched from the VAB, even when they aren't deprived.  Toggling SAS on/off fixes it.

Edit: More details in spoiler

  Reveal hidden contents

Suggestion: ModuleScienceAvailabilityIndicator needs an "unavailableColor" and/or "lowValueColor" field so you can chain other controllers onto it.  e.g. I want to make my lander cans blink when crewReport science is available, and the rest of the time show the profession color of the kerbal inside.  Don't think I can do that with the existing building blocks.

Edit: I didn't want to wait, so went ahead and implemented those, along with the ability requested further up to constrain ModuleScienceAvailabilityIndicator to a particular experimentID.  I'm going to send you a pull request with my fixes / enhancements.  I'm still pretty new to GitHub so go easy on me.

Edited by Fwiffo
Link to comment
Share on other sites

Is there a simple way to wire all my emissives or controllers (which have different color sources) to be toggled by a single master ModuleToggleLED button?  I want an "off" switch to let me turn off all the IndicatorLights under some circumstances.

Also would like a field that can disable the ModuleCustomBlink GUI button during Flight (one less button on my list).

Edit: My approach to this is going to be defining several ModuleBooleanIndicators (one for each emissive) and gating them all by the master toggle.  I suggest you add a "ternary" ColorSource function that takes a toggle and two color sources as its inputs; it would make it possible to do this sort of thing with a lot less verbosity and less modules.

Edit: I went ahead and implemented a toggle() parameterized ColorSource, which I think might be convenient in some cases.  Tried to add it to my open PR or make a new one, but GitHub is foobared at the moment ("Oops something went wrong" responses).  Might try again later, in the meantime the changes are in ColorSource.cs in my Fwiffo2 branch.

In retrospect, it doesn't quite completely solve what I wanted to achieve.  I think what I'm really after is a master "lightswitch" part that turns off all the indicator lights on your whole ship (not just in the one part).  I love Indicator Lights, but it would be handy for those times you want to take a screenshot without the "Christmas Tree" effect (did I mention I appreciate the restraint you've exercised in that regard?).

Edited by Fwiffo
Another new feature
Link to comment
Share on other sites

  On 10/24/2016 at 6:21 AM, Fwiffo said:

Possible bug: Reaction wheels blink when your craft is first launched from the VAB, even when they aren't deprived.  Toggling SAS on/off fixes it.

Expand  

I have observed this happening as well during my parts testing. It is most peculiar but as stated a quick toggle of SAS and everything is normal

Link to comment
Share on other sites

  On 10/25/2016 at 6:03 AM, steedcrugeon said:

I have observed this happening as well during my parts testing. It is most peculiar but as stated a quick toggle of SAS and everything is normal

Expand  

Thanks for confirming.  I fixed this in my personal version and sent a copy of the source code to @Snark in a pull request.  Here's a copy of my bootleged DLL if you want to test (link removed at the very understandable and kindly-made request of Snark), and here's its unofficial changelog.

It did entail removing the flashing "starvation" indicator when SAS is disabled.  But I argue the warning should be disabled in any case when SAS is disabled.  My reasoning is, if SAS is disabled, then presumably the reaction wheels are dormant (correct me if I'm wrong) so they aren't really "staved".  (And in most cases where this is likely to occur you have other indicators that will be going off anyway, e.g. batteries).  When SAS is enabled the starvation warning works just like it does today.

Snark might feel differently and rework / exclude that fix.

Edited by Fwiffo
Remove DLL link
Link to comment
Share on other sites

  On 10/24/2016 at 6:21 AM, Fwiffo said:

Possible bug: Reaction wheels blink when your craft is first launched from the VAB, even when they aren't deprived.  Toggling SAS on/off fixes it.

Expand  

Yup, I've recently noticed that myself.  Coulda sworn it didn't do that in the past-- perhaps something changed in the way resource flow is handled in 1.2?  Anyway, I've spent some time digging into this, and have reluctantly come to the conclusion that what I want ("flash if you don't have the resources needed to do your job") isn't physically possible.  Resource consumers have a "deprived" flag that gets set when they ask for resources and don't get it, and which gets turned off when they ask for resources and do get it.  There's no way to clear that flag without actually demanding a resource.  (It's the moral equivalent of having a queue where the only way to tell if it's empty is to try to pop something out of it-- there's no non-destructive way to check.)  Perhaps, if I really really wanted to, I could come up with some hacky byzantine workaround that involves extensive reverse engineering of Squad's internal algorithm in order to try to accomplish this... but I don't know if that's actually possible, and even if it were, I seriously don't want to go there.

So I'll be walking this feature back, and making it so that it only flashes in the case "autopilot = on" and "operational = false".  That's a pity, because I would have liked to have it when autopilot is off, too-- that's a useful feature.  (Player:  "Hey, I'm trying to rotate my ship and nothing's happening!  What's going on?  <flash flash flash>  Oh, okay, my reaction wheels are out of power."  Nope, can't have that.  Oh well.)

  On 10/24/2016 at 6:21 AM, Fwiffo said:

Suggestion: ModuleScienceAvailabilityIndicator needs an "unavailableColor" and/or "lowValueColor" field so you can chain other controllers onto it.  e.g. I want to make my lander cans blink when crewReport science is available, and the rest of the time show the profession color of the kerbal inside.  Don't think I can do that with the existing building blocks.

Expand  

Agreed, good point.  Going back and looking at the code, in retrospect I have no idea why I didn't do it that way in the first place, instead of hard-coding it to "off" as I did.  (IndicatorLights has grown enough now that it can be hard for me to remember the rationale for specific design decisions, sometimes... maybe I was just tired or distracted on that day.)  :wink:

  On 10/24/2016 at 6:21 AM, Fwiffo said:

I'm going to send you a pull request with my fixes / enhancements.  I'm still pretty new to GitHub so go easy on me.

Expand  

Thanks, and that's very thoughtful of you. :)  Actually, however, all I need is a feature request and/or specific description of the problem, and I'll take care of the coding end myself.  I don't actually take pull requests; I prefer all lines of code to come directly from me.

It's not that I don't trust you... it's just that my mental ability to keep track of what's happening everywhere is largely predicated on the fact that it's all me, and I'm relentlessly consistent about what I do (usually), and so if I see something odd happen, I know huge swaths of possibility space that I don't have to investigate because I know what I didn't do.

For me, taking a pull request-- from anyone who isn't me-- would be kind of like if some competent, organized, and well-meaning family member of mine were to come in and "tidy up" my office for me when I'm not there.  It might be a great job, and it might "organize" things nicely... but I would be hopelessly lost the moment I stepped into my office, because nothing would be placed where I put it, even if the new placement is somehow objectively "better" than what I did.

  On 10/25/2016 at 5:57 AM, Fwiffo said:

Is there a simple way to wire all my emissives or controllers (which have different color sources) to be toggled by a single master ModuleToggleLED button?  I want an "off" switch to let me turn off all the IndicatorLights under some circumstances.

Expand  

Possibly, but it depends what you mean by,

  1. "all"
  2. "simple"

:wink:

First, regarding "all":  If you mean "everything all over the ship":  No, there really isn't.  IndicatorLights modules generally work only in the context of the part that they're on.  You can toggle the state of one controller on a part by using the output of another controller on that same part, but not from somewhere else on the ship.

To make it happen all over the ship, basically what you'd need to do is to set up the "wiring diagram" of every light's controller so that it feeds to something with an action-group toggle, and then assign them all to the same action group.  (If you were to use ModuleToggleLED for this, it's automatically in the Light action group, so you wouldn't have to manually tinker with the action group assignments for every individual part.)

As for "simple":  what you'd need to do is to wire the functionality into each individual emissive's controller diagram, by setting up an appropriate toggle controller for each one.  There's currently no "master switch."

Do you only want this for debugging/screenshot purposes (you mention "screenshots")?  Or is it something needed for actual gameplay?  The former would be easier for me to slip in than the latter-- lower bar for usability, e.g. could be something involving the debugging console, like /il on and /il off or some such.

 

  On 10/25/2016 at 5:57 AM, Fwiffo said:

Also would like a field that can disable the ModuleCustomBlink GUI button during Flight (one less button on my list).

Expand  

Hm, not a bad idea-- actually, more as a general principle of allowing folks to decide for anything with a UI "do you want this in editor, flight, or both".  Let me muse on this.

  On 10/25/2016 at 5:57 AM, Fwiffo said:

My approach to this is going to be defining several ModuleBooleanIndicators (one for each emissive) and gating them all by the master toggle.  I suggest you add a "ternary" ColorSource function that takes a toggle and two color sources as its inputs; it would make it possible to do this sort of thing with a lot less verbosity and less modules.

Expand  

Hm, interesting idea.  You mean add a logical-combining ColorSource syntax that would allow doing in a string what is currently done via an explicit ModuleBooleanIndicator.

Again, not a bad idea-- let me think on it.

However, it's worth bearing in mind that even having that wouldn't, on its own, solve your current problem of wanting a global switch, since all ColorSource parsing is done in the context of the current part only.

Adding some sort of functionality to allow specifying "search the whole ship" instead of "search the current part" may be possible, but it's nontrivial (requires wiring in lots of event-handling, since parts can move around as ships dock, undock, stage, etc., and scanning a whole ship can get computationally expensive since ships can be very big).  I'll think about it, because I like the idea-- if architected correctly, it could open the door to all kinds of interestingly flexible design options.  It will take some time, however, and no promises-- it's not something I can just "slip in".

In any case, if a simple "global mod enable/disable" switch accessible via the debug console would solve your use case, that would be a lot easier to add.

  On 10/25/2016 at 6:44 AM, Fwiffo said:

Here's a copy of my bootlegged DLL if you want to test

Expand  

A side note:  I appreciate your desire to be helpful, but please be careful about licensing requirements.  Your current download link violates the license, and I'd appreciate it if you could either delete the link or fix it so that it legally complies.

Details in spoiler section.

  Reveal hidden contents

 

Link to comment
Share on other sites

  On 10/25/2016 at 3:41 PM, Snark said:

Player:  "Hey, I'm trying to rotate my ship and nothing's happening!  What's going on?  <flash flash flash>  Oh, okay, my reaction wheels are out of power."

Expand  

That's a good point.  So, you could narrow the focus a little from what I did and disable the deprived warning only when SAS is off and the user is not trying to turn the ship.  I did a quick test and hitting a rotation key (causing a request for electricity to be made) also clears the aberrant flashing.

  On 10/25/2016 at 3:41 PM, Snark said:

Do you only want this for debugging/screenshot purposes (you mention "screenshots")?  Or is it something needed for actual gameplay?  The former would be easier for me to slip in than the latter-- lower bar for usability, e.g. could be something involving the debugging console, like /il on and /il off or some such.

Expand  

Both equally (screenshots and gameplay).  I follow what you mean about the "wiring diagram" approach and it's basically what I did within the part.  But after implementing it (and even using the toggle() feature to somewhat reduce the amount of cfg clutter) I'm of the opinion this is a case where it might be better to introduce a feature specifically for this, rather than trying to accomplish it through the existing "nesting" methodology of the mod.

i.e. I'm thinking bake master "On/Off switch" functionality into a new part [module] intended to occur only once on your ship.  All the emissive controllers would be smart enough to check if that part [module] exists, and if so, turn off their output when the switch is turned off.  From a programming perspective, the only thing this new module would really do is provide a ship-wide boolean state variable.  It would be wired up to an existing toggle to provide the actual button (or maybe come in the form of a ModuleMasterSwitchController which would be a cut-down ModuleToggleLED or different flavour of ModuleBooleanIndicator).

I put [module] in brackets because I'm not sure if there's an efficient way to check for a module across the entire ship, and/or whether that problem becomes simpler if the mod knows it would always occur on only a specific type of part (and reading your post a little further, I see you get into that question too).  I guess there's no way to store / retrieve state information at the "ship" level?  (I know some mods stuff things into savegame files, for better or worse...)

An advantage of the approach is the user doesn't have to do a thing to their cfg's to make this work.  All they have to do is stick the new "Master Switch" part somewhere onto their ship and it just works.

I'd be curious if anyone else would appreciate having a master switch to toggle all the IndicatorLights functionality off at once.  It would feel akin to using the main breaker switch on your fusebox.

  On 10/25/2016 at 3:41 PM, Snark said:

In any case, if a simple "global mod enable/disable" switch accessible via the debug console would solve your use case, that would be a lot easier to add.

Expand  

Could there be a way for a toggle button somewhere on your ship to feed that "global mod variable"?  That would avoid breaking immersion from the need to drop into the debug console.  Yes, a side-effect would be the button would be game-wide rather than just for the active ship - personally I'm ok with that compromise.

  On 10/25/2016 at 3:41 PM, Snark said:

Hm, interesting idea.  You mean add a logical-combining ColorSource syntax that would allow doing in a string what is currently done via an explicit ModuleBooleanIndicator.

Expand  

Yes.  In my implementation I copped out on the "logical-combining" part - it's just a SPDT switch.  It was intended for simple one-liner cases where you want to avoid creating whole new ModuleBooleanIndicator.  I figured for complex cases the user can just revert to that.

I did do one small thing which turned out to be helpful when using it; that was to make the offSource optional (so it knows to just use $Off if not specified).

Incidentally (and purely for academic interest) the resulting toggle() could have been combined internally with a theoretical generic new "timer()" parameter (essentially a squarewave generator) to implement existing patterns like blink().  e.g. blink() === toggle(squarewave(200ms), onSource).  Where squarewave() is some class that inherits from a generic timer().  But I digress :-P.

  On 10/25/2016 at 3:41 PM, Snark said:

For me, taking a pull request-- from anyone who isn't me-- would be kind of like if some competent, organized, and well-meaning family member of mine were to come in and "tidy up" my office for me when I'm not there.

Expand  

Hah, great analogy!  Incidentally the only reason I went to the trouble of creating a pull request was because I thought it would be convenient for you.  Personally I find GitHub a little less intuitive to use than I feel it ought to be.

Anyway I respect your desire not to have other people dabbling in your code.  I just wanted to move on with my CFG files, and needed some of the missing functionality to proceed.  It looked (and was) very trivial to implement and I figured I was doing you a favor.  I was careful to preserve the coding patterns you used (and had hoped to learn something if you took a look at it and said "no, that over there isn't quite right, here's how it should be done").  Sorry if it offended you.

I removed the link as requested.

Edited by Fwiffo
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...