public override void OnMouseOver()
{
base.OnMouseOver();
if (HighLogic.LoadedSceneIsEditor)
{
EditorLogic editor = EditorLogic.fetch;
if (Input.GetKey(topRadKey) && editor.editorScreen != EditorLogic.EditorScreen.Actions)
{
float initialValue = topFactor;
topFactor += (Input.GetAxis("Mouse X") + Input.GetAxis("Mouse Y")) * 0.01f * (Input.GetKey(KeyCode.LeftShift) ? 10f : 1f);
topFactor = Mathf.Max(topFactor, 0.01f);
topFactor = Mathf.Min(topFactor, maxRFactor);
if (initialValue != radialFactor)
{
triggerUpdate = true;
rescaled = true;
}
}
if (Input.GetKeyDown(shapeKey) && editor.editorScreen != EditorLogic.EditorScreen.Actions)
{
var shapes = new List<Vector4>();
foreach (var sl in GameDatabase.Instance.GetConfigNodes("STRETCHYTANKCONESHAPES"))
for (int i = 0; i < sl.values.Count; ++i)
if (sl.values[i].name == "shape")
shapes.Add(ConfigNode.ParseVector4(sl.values[i].value));
if (shapes.Count == 0) shapes.Add(coneShape);
int idx = 0;
for (; idx < shapes.Count; ++idx) if (shapes[idx] == coneShape) break;
if (++idx >= shapes.Count) idx = 0;
coneShape = shapes[idx];
triggerUpdate = true;
}
}
}