StretchyTanks.StretchyTanks.OnMouseOver C# (CSharp) Method

OnMouseOver() public method

public OnMouseOver ( ) : void
return void
        public virtual void OnMouseOver()
        {
            if (HighLogic.LoadedSceneIsEditor)
            {
                EditorLogic editor = EditorLogic.fetch;
                if (Input.GetKey(stretchKey) && editor.editorScreen != EditorLogic.EditorScreen.Actions)
                {
                    float initialValue = stretchFactor;
                    stretchFactor += Input.GetAxis("Mouse Y") * (1f / 18.75f) * (Input.GetKey(KeyCode.LeftShift) ? 10f : 1f);
                    if (stretchFactor < 0.1f)
                    {
                        stretchFactor = 0.1f;
                    }
                    /*if (stretchFactor > 25f)
                    {
                        stretchFactor = 25f;
                    }*/
                    if (initialValue != stretchFactor)
                    {
                        triggerUpdate = true;
                        rescaled = true;
                    }
                }
                if (Input.GetKey(radialKey) && editor.editorScreen != EditorLogic.EditorScreen.Actions && superStretch == true)
                {
                    float initialValue = radialFactor;
                    radialFactor += Input.GetAxis("Mouse X") * 0.01f * (Input.GetKey(KeyCode.LeftShift) ? 10f : 1f);
                    if (radialFactor < 0.01f)
                    {
                        radialFactor = 0.01f;
                    }
                    if (radialFactor > maxRFactor)
                    {
                        radialFactor = maxRFactor;
                    }
                    if (initialValue != radialFactor)
                    {
                        triggerUpdate = true;
                        rescaled = true;
                    }
                }
                // NK change thrust with this key
                if (stretchSRB && Input.GetKey(tankTypeKey) && editor.editorScreen != EditorLogic.EditorScreen.Actions)
                {
                    float initialValue = burnTime;
                    burnTime += Input.GetAxis("Mouse Y") * 1.0f * (Input.GetKey(KeyCode.LeftShift) ? 10f : 1f); ;
                    if (burnTime < 0.25f)
                    {
                        burnTime = 0.25f;
                    }
                    if (burnTime > 360f)
                    {
                        burnTime = 360f;
                    }
                    if (initialValue != burnTime)
                    {
                        triggerUpdate = true;
                    }
                }
                if (!stretchSRB && Input.GetKeyDown(tankTypeKey))
                {
                    if (part.Modules.Contains("ModuleFuelTanks"))
                    {

                    }
                    else
                    {
                        switch (tankType)
                        {
                            case TANK_MIXED:
                                tankType = TANK_LIQUID_FUEL;
                                break;
                            case TANK_LIQUID_FUEL:
                                tankType = TANK_OXIDIZER;
                                break;
                            case TANK_MONOPROP:
                                tankType = TANK_STRUCTURAL;
                                break;
                            case TANK_OXIDIZER:
                                tankType = TANK_MONOPROP;
                                break;
                            case TANK_STRUCTURAL:
                                tankType = TANK_MIXED;
                                break;

                        }
                    }
                    triggerUpdate = true;
                }
                if (Input.GetKeyDown(textureKey))
                {
                    /*if (textureType >= 0)
                        changeTextures();*/
                    List<ConfigNode> textureSets = GetTextures();
                    int idx = 0;
                    for (int i = 0; i < textureSets.Count; i++)
                        if (textureSets[i].name.Equals(textureSet))
                        {
                            idx = i;
                            break;
                        }
                    idx++;
                    if (idx >= textureSets.Count)
                        idx = 0;
                    textureSet = textureSets[idx].name;
                    changeTextures();
                    triggerUpdate = true;
                }
            }
        }