I guess this works...

This commit is contained in:
Jorolf
2017-04-21 13:59:04 +02:00
parent 02249dcd67
commit e53c4be356
6 changed files with 42 additions and 44 deletions

View File

@ -10,8 +10,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using System;
using System.Globalization;
namespace osu.Game.Graphics.UserInterface
{
@ -25,20 +23,16 @@ namespace osu.Game.Graphics.UserInterface
private readonly Box leftBox;
private readonly Box rightBox;
public Func<T, string> TooltipTextFunc { get; set; }
public string TooltipText
public virtual string TooltipText
{
get
{
if (TooltipTextFunc != null) return TooltipTextFunc(Current);
var bindableDouble = CurrentNumber as BindableNumber<double>;
if (bindableDouble != null)
{
if (bindableDouble.MaxValue == 1 && (bindableDouble.MinValue == 0 || bindableDouble.MinValue == -1))
return bindableDouble.Value.ToString(@"P0");
return bindableDouble.Value.ToString(@"n1", CultureInfo.InvariantCulture);
return bindableDouble.Value.ToString(@"n1");
}
var bindableInt = CurrentNumber as BindableNumber<int>;