public void Start()
		{
			try {
				comp = RasterPropMonitorComputer.Instantiate(internalProp);
				textObjTransform = internalProp.FindModelTransform(labelTransform);
				textObj = InternalComponents.Instance.CreateText(fontName, fontSize, textObjTransform, string.Empty);
				activeLabel = 0;

				SmarterButton.CreateButton(internalProp, switchTransform, Click);

				ConfigNode moduleConfig = null;
				foreach (ConfigNode node in GameDatabase.Instance.GetConfigNodes("PROP")) {
					if (node.GetValue("name") == internalProp.propName) {

						moduleConfig = node.GetNodes("MODULE")[moduleID];
						ConfigNode[] variableNodes = moduleConfig.GetNodes("VARIABLESET");

						for (int i = 0; i < variableNodes.Length; i++) {
							try {
								labelsEx.Add(new VariableLabelSet(variableNodes[i]));
							} catch (ArgumentException e) {
								JUtil.LogMessage(this, "Error in building prop number {1} - {0}", e.Message, internalProp.propID);
							}
						}
						break;
					}
				}

				// Fallback: If there are no VARIABLESET blocks, we treat the module configuration itself as a variableset block.
				if (labelsEx.Count < 1 && moduleConfig != null) {
					try {
						labelsEx.Add(new VariableLabelSet(moduleConfig));
					} catch (ArgumentException e) {
						JUtil.LogMessage(this, "Error in building prop number {1} - {0}", e.Message, internalProp.propID);
					}
				}

				if (labelsEx.Count == 0) {
					JUtil.LogMessage(this, "No labels defined.");
					throw new ArgumentException("No labels defined");
				}

				colorShiftRenderer = internalProp.FindModelComponent<Renderer>(coloredObject);
				if (labelsEx[activeLabel].hasColor) {
					colorShiftRenderer.material.SetColor(colorName, labelsEx[activeLabel].color);
				}
				if (labelsEx[activeLabel].hasText) {
					textObj.text.Text = StringProcessor.ProcessString(labelsEx[activeLabel].labelText, comp);
				}

				audioOutput = JUtil.SetupIVASound(internalProp, switchSound, switchSoundVolume, false);
				JUtil.LogMessage(this, "Configuration complete in prop {1}, supporting {0} variable indicators.", labelsEx.Count, internalProp.propID);
			} catch {
				JUtil.AnnoyUser(this);
				enabled = false;
				throw;
			}
		}
		public void Start()
		{
			comp = RasterPropMonitorComputer.Instantiate(internalProp);
			textObjTransform = internalProp.FindModelTransform(transformName);
			textObj = InternalComponents.Instance.CreateText(fontName, fontSize, textObjTransform, string.Empty);
			// Force oneshot if there's no variables:
			oneshot |= !labelText.Contains("$&$");
			sourceString = labelText.UnMangleConfigText();
		}
 public void Start()
 {
     textObjTransform = internalProp.FindModelTransform(transformName);
     textObj = InternalComponents.Instance.CreateText(fontName, fontSize, textObjTransform, string.Empty);
     // Force oneshot if there's no variables:
     oneshot |= !labelText.Contains("$&$");
     sourceString = labelText.UnMangleConfigText();
     if (!oneshot)
     {
         RPMVesselComputer comp = RPMVesselComputer.Instance(vessel);
         comp.UpdateDataRefreshRate(refreshRate);
     }
 }
 public void OnDestroy()
 {
     if (del != null)
     {
         try
         {
             rpmComp.UnregisterVariableCallback(variableName, del);
         }
         catch
         {
             //JUtil.LogMessage(this, "Trapped exception unregistering JSIVariableLabel (you can ignore this)");
         }
     }
     //JUtil.LogMessage(this, "OnDestroy()");
     Destroy(textObj);
     textObj = null;
 }
        public void Start()
        {
            try
            {
                rpmComp = RasterPropMonitorComputer.Instantiate(internalProp, true);

                Transform textObjTransform = internalProp.FindModelTransform(transformName);
                textObj = InternalComponents.Instance.CreateText("Arial", fontSize * 15.5f, textObjTransform, string.Empty);
                // Force oneshot if there's no variables:
                oneshot |= !labelText.Contains("$&$");
                string sourceString = labelText.UnMangleConfigText();

                if (!string.IsNullOrEmpty(sourceString) && sourceString.Length > 1)
                {
                    // Alow a " character to escape leading whitespace
                    if (sourceString[0] == '"')
                    {
                        sourceString = sourceString.Substring(1);
                    }
                }
                spf = new StringProcessorFormatter(sourceString, rpmComp);

                if (!oneshot)
                {
                    rpmComp.UpdateDataRefreshRate(refreshRate);
                }

                if (!(string.IsNullOrEmpty(variableName) || string.IsNullOrEmpty(positiveColor) || string.IsNullOrEmpty(negativeColor) || string.IsNullOrEmpty(zeroColor)))
                {
                    positiveColorValue = JUtil.ParseColor32(positiveColor, part, ref rpmComp);
                    negativeColorValue = JUtil.ParseColor32(negativeColor, part, ref rpmComp);
                    zeroColorValue = JUtil.ParseColor32(zeroColor, part, ref rpmComp);
                    del = (Action<float>)Delegate.CreateDelegate(typeof(Action<float>), this, "OnCallback");
                    rpmComp.RegisterVariableCallback(variableName, del);
                    registeredVessel = vessel.id;

                    // Initialize the text color. Actually, callback registration took care of that
                }
            }
            catch(Exception e)
            {
                JUtil.LogErrorMessage(this, "Start failed with exception {0}", e);
                spf = new StringProcessorFormatter("x", rpmComp);
            }
        }