Merge pull request #1669 from ninjaprawn/master

Display the correct mod tooltips in mod selection
This commit is contained in:
Dan Balasescu 2017-12-30 17:06:00 +09:00 committed by GitHub
commit d8e6ff79f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 5 deletions

@ -1 +1 @@
Subproject commit 2438afea86d0ce1f91b1b2f01bca1cf8afdd4659
Subproject commit 0c48da1d49f470d56aeab9b15651ce0a4f5ac261

View File

@ -204,13 +204,13 @@ private void createIcons()
{
iconsContainer.AddRange(new[]
{
backgroundIcon = new ModIcon(Mods[1])
backgroundIcon = new PassThroughTooltipModIcon(Mods[1])
{
Origin = Anchor.BottomRight,
Anchor = Anchor.BottomRight,
Position = new Vector2(1.5f),
},
foregroundIcon = new ModIcon(Mods[0])
foregroundIcon = new PassThroughTooltipModIcon(Mods[0])
{
Origin = Anchor.BottomRight,
Anchor = Anchor.BottomRight,
@ -220,7 +220,7 @@ private void createIcons()
}
else
{
iconsContainer.Add(foregroundIcon = new ModIcon(Mod)
iconsContainer.Add(foregroundIcon = new PassThroughTooltipModIcon(Mod)
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
@ -259,5 +259,14 @@ public ModButton(Mod mod)
Mod = mod;
}
private class PassThroughTooltipModIcon : ModIcon
{
public override string TooltipText => null;
public PassThroughTooltipModIcon(Mod mod) : base(mod)
{
}
}
}
}

View File

@ -28,7 +28,7 @@ public FontAwesome Icon
private readonly ModType type;
public string TooltipText { get; }
public virtual string TooltipText { get; }
public ModIcon(Mod mod)
{