Example #1
0
    private ButtonMapping MapMouseButton(InputDisplayButton button, string path)
    {
        var mapping = new ButtonMapping
        {
            Button = new InputLayoutMouseButton {
                Path = path
            },
            DisplayButton = button
        };

        AssignUnboundColor(mapping.DisplayButton);
        return(mapping);
    }
Example #2
0
    private void AssignUnboundColor(InputDisplayButton button, bool bindable = true)
    {
        button.Outline.gameObject.SetActive(false);
        var outlineColor = DefaultColor;

        outlineColor.a *= InactiveMultiplier;
        var fillColor = DefaultColor * FillBrightness;

        fillColor *= FillBrightness;
        if (!bindable)
        {
            fillColor *= InactiveMultiplier;
        }
        fillColor.a       = FillAlpha;
        button.Fill.color = fillColor;
        if (button is InputDisplayKey key)
        {
            key.MainLabel.color = key.AltLabel.color = Color.Lerp(outlineColor, fillColor, .5f);
        }
    }