mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 03:27:21 +09:00
Share ruleset and type displaying, fix tag team icon.
This commit is contained in:
parent
35951ffc40
commit
fe875957a7
@ -52,10 +52,32 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
public override string Name => "Tag Team";
|
public override string Name => "Tag Team";
|
||||||
public override Drawable GetIcon(OsuColour colours, float size)
|
public override Drawable GetIcon(OsuColour colours, float size)
|
||||||
{
|
{
|
||||||
return new VersusRow(colours.Blue, colours.Blue, size * 0.6f)
|
return new FillFlowContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
Spacing = new Vector2(2f),
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new TextAwesome
|
||||||
|
{
|
||||||
|
Icon = FontAwesome.fa_refresh,
|
||||||
|
TextSize = size * 0.75f,
|
||||||
|
Colour = colours.Blue,
|
||||||
|
Shadow = false,
|
||||||
|
UseFullGlyphHeight = false,
|
||||||
|
},
|
||||||
|
new TextAwesome
|
||||||
|
{
|
||||||
|
Icon = FontAwesome.fa_refresh,
|
||||||
|
TextSize = size * 0.75f,
|
||||||
|
Colour = colours.Pink,
|
||||||
|
Shadow = false,
|
||||||
|
UseFullGlyphHeight = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,12 +27,12 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
private const float height = 100;
|
private const float height = 100;
|
||||||
private const float side_strip_width = 5;
|
private const float side_strip_width = 5;
|
||||||
private const float cover_width = 145;
|
private const float cover_width = 145;
|
||||||
private const float ruleset_height = 30;
|
|
||||||
|
|
||||||
private readonly Box sideStrip;
|
private readonly Box sideStrip;
|
||||||
private readonly Container coverContainer, rulesetContainer, gameTypeContainer;
|
private readonly Container coverContainer;
|
||||||
private readonly OsuSpriteText name;
|
private readonly OsuSpriteText name;
|
||||||
private readonly ParticipantInfo participantInfo;
|
private readonly ParticipantInfo participantInfo;
|
||||||
|
private readonly ModeTypeInfo modeTypeInfo;
|
||||||
private readonly OsuSpriteText status;
|
private readonly OsuSpriteText status;
|
||||||
private readonly FillFlowContainer<OsuSpriteText> beatmapInfoFlow;
|
private readonly FillFlowContainer<OsuSpriteText> beatmapInfoFlow;
|
||||||
private readonly OsuSpriteText beatmapTitle;
|
private readonly OsuSpriteText beatmapTitle;
|
||||||
@ -159,29 +159,10 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
modeTypeInfo = new ModeTypeInfo
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Height = ruleset_height,
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
LayoutDuration = transition_duration,
|
|
||||||
Spacing = new Vector2(5f, 0f),
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
rulesetContainer = new Container
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
},
|
|
||||||
gameTypeContainer = new Container
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -239,17 +220,13 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
|
|
||||||
private void displayGameType(GameType value)
|
private void displayGameType(GameType value)
|
||||||
{
|
{
|
||||||
gameTypeContainer.Children = new[]
|
modeTypeInfo.Type = value;
|
||||||
{
|
|
||||||
new DrawableGameType(value)
|
|
||||||
{
|
|
||||||
Size = new Vector2(ruleset_height),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayBeatmap(BeatmapInfo value)
|
private void displayBeatmap(BeatmapInfo value)
|
||||||
{
|
{
|
||||||
|
modeTypeInfo.Beatmap = value;
|
||||||
|
|
||||||
if (value != null)
|
if (value != null)
|
||||||
{
|
{
|
||||||
coverContainer.FadeIn(transition_duration);
|
coverContainer.FadeIn(transition_duration);
|
||||||
@ -264,15 +241,6 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
}) { RelativeSizeAxes = Axes.Both }
|
}) { RelativeSizeAxes = Axes.Both }
|
||||||
};
|
};
|
||||||
|
|
||||||
rulesetContainer.FadeIn(transition_duration);
|
|
||||||
rulesetContainer.Children = new[]
|
|
||||||
{
|
|
||||||
new DifficultyIcon(value)
|
|
||||||
{
|
|
||||||
Size = new Vector2(ruleset_height),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
|
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
|
||||||
beatmapDash.Text = @" - ";
|
beatmapDash.Text = @" - ";
|
||||||
beatmapArtist.Current = localisation.GetUnicodePreference(value.Metadata.ArtistUnicode, value.Metadata.Artist);
|
beatmapArtist.Current = localisation.GetUnicodePreference(value.Metadata.ArtistUnicode, value.Metadata.Artist);
|
||||||
@ -280,7 +248,6 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
coverContainer.FadeOut(transition_duration);
|
coverContainer.FadeOut(transition_duration);
|
||||||
rulesetContainer.FadeOut(transition_duration);
|
|
||||||
|
|
||||||
beatmapTitle.Current = null;
|
beatmapTitle.Current = null;
|
||||||
beatmapArtist.Current = null;
|
beatmapArtist.Current = null;
|
||||||
|
82
osu.Game/Screens/Multiplayer/ModeTypeInfo.cs
Normal file
82
osu.Game/Screens/Multiplayer/ModeTypeInfo.cs
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
using OpenTK;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Beatmaps.Drawables;
|
||||||
|
using osu.Game.Database;
|
||||||
|
using osu.Game.Online.Multiplayer;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Multiplayer
|
||||||
|
{
|
||||||
|
public class ModeTypeInfo : Container
|
||||||
|
{
|
||||||
|
private const float height = 30;
|
||||||
|
private const float transition_duration = 100;
|
||||||
|
|
||||||
|
private readonly Container rulesetContainer, gameTypeContainer;
|
||||||
|
|
||||||
|
public BeatmapInfo Beatmap
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
rulesetContainer.FadeIn(transition_duration);
|
||||||
|
rulesetContainer.Children = new[]
|
||||||
|
{
|
||||||
|
new DifficultyIcon(value)
|
||||||
|
{
|
||||||
|
Size = new Vector2(height),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rulesetContainer.FadeOut(transition_duration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameType Type
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
gameTypeContainer.Children = new[]
|
||||||
|
{
|
||||||
|
new DrawableGameType(value)
|
||||||
|
{
|
||||||
|
Size = new Vector2(height),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ModeTypeInfo()
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomRight,
|
||||||
|
Origin = Anchor.BottomRight,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
LayoutDuration = transition_duration,
|
||||||
|
Spacing = new Vector2(5f, 0f),
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
rulesetContainer = new Container
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
gameTypeContainer = new Container
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -27,11 +27,11 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
{
|
{
|
||||||
private readonly MarginPadding contentPadding = new MarginPadding { Horizontal = 20, Vertical = 10 };
|
private readonly MarginPadding contentPadding = new MarginPadding { Horizontal = 20, Vertical = 10 };
|
||||||
private const float transition_duration = 100;
|
private const float transition_duration = 100;
|
||||||
private const float ruleset_height = 30;
|
|
||||||
|
|
||||||
private readonly Box statusStrip;
|
private readonly Box statusStrip;
|
||||||
private readonly Container coverContainer, rulesetContainer, gameTypeContainer;
|
private readonly Container coverContainer, rulesetContainer, gameTypeContainer;
|
||||||
private readonly FillFlowContainer topFlow, participantsFlow;
|
private readonly FillFlowContainer topFlow, participantsFlow;
|
||||||
|
private readonly ModeTypeInfo modeTypeInfo;
|
||||||
private readonly OsuSpriteText participants, participantsSlash, maxParticipants, name, status, beatmapTitle, beatmapDash, beatmapArtist, beatmapAuthor;
|
private readonly OsuSpriteText participants, participantsSlash, maxParticipants, name, status, beatmapTitle, beatmapDash, beatmapArtist, beatmapAuthor;
|
||||||
private readonly ParticipantInfo participantInfo;
|
private readonly ParticipantInfo participantInfo;
|
||||||
private readonly ScrollContainer participantsScroll;
|
private readonly ScrollContainer participantsScroll;
|
||||||
@ -191,20 +191,13 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.X,
|
AutoSizeAxes = Axes.X,
|
||||||
Height = ruleset_height,
|
Height = 30,
|
||||||
Direction = FillDirection.Horizontal,
|
Direction = FillDirection.Horizontal,
|
||||||
LayoutDuration = transition_duration,
|
LayoutDuration = transition_duration,
|
||||||
Spacing = new Vector2(5f, 0f),
|
Spacing = new Vector2(5f, 0f),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
rulesetContainer = new Container
|
modeTypeInfo = new ModeTypeInfo(),
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
},
|
|
||||||
gameTypeContainer = new Container
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
},
|
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.X,
|
AutoSizeAxes = Axes.X,
|
||||||
@ -329,17 +322,13 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
|
|
||||||
private void displayGameType(GameType value)
|
private void displayGameType(GameType value)
|
||||||
{
|
{
|
||||||
gameTypeContainer.Children = new[]
|
modeTypeInfo.Type = value;
|
||||||
{
|
|
||||||
new DrawableGameType(value)
|
|
||||||
{
|
|
||||||
Size = new Vector2(ruleset_height),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayBeatmap(BeatmapInfo value)
|
private void displayBeatmap(BeatmapInfo value)
|
||||||
{
|
{
|
||||||
|
modeTypeInfo.Beatmap = value;
|
||||||
|
|
||||||
if (value != null)
|
if (value != null)
|
||||||
{
|
{
|
||||||
coverContainer.FadeIn(transition_duration);
|
coverContainer.FadeIn(transition_duration);
|
||||||
@ -354,15 +343,6 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
}) { RelativeSizeAxes = Axes.Both }
|
}) { RelativeSizeAxes = Axes.Both }
|
||||||
};
|
};
|
||||||
|
|
||||||
rulesetContainer.FadeIn(transition_duration);
|
|
||||||
rulesetContainer.Children = new[]
|
|
||||||
{
|
|
||||||
new DifficultyIcon(value)
|
|
||||||
{
|
|
||||||
Size = new Vector2(ruleset_height),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
|
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
|
||||||
beatmapDash.Text = @" - ";
|
beatmapDash.Text = @" - ";
|
||||||
beatmapArtist.Current = localisation.GetUnicodePreference(value.Metadata.ArtistUnicode, value.Metadata.Artist);
|
beatmapArtist.Current = localisation.GetUnicodePreference(value.Metadata.ArtistUnicode, value.Metadata.Artist);
|
||||||
@ -371,7 +351,6 @@ namespace osu.Game.Screens.Multiplayer
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
coverContainer.FadeOut(transition_duration);
|
coverContainer.FadeOut(transition_duration);
|
||||||
rulesetContainer.FadeOut(transition_duration);
|
|
||||||
|
|
||||||
beatmapTitle.Current = null;
|
beatmapTitle.Current = null;
|
||||||
beatmapArtist.Current = null;
|
beatmapArtist.Current = null;
|
||||||
|
@ -491,6 +491,7 @@
|
|||||||
<Compile Include="Online\Multiplayer\GameType.cs" />
|
<Compile Include="Online\Multiplayer\GameType.cs" />
|
||||||
<Compile Include="Screens\Multiplayer\DrawableGameType.cs" />
|
<Compile Include="Screens\Multiplayer\DrawableGameType.cs" />
|
||||||
<Compile Include="Screens\Multiplayer\ParticipantInfo.cs" />
|
<Compile Include="Screens\Multiplayer\ParticipantInfo.cs" />
|
||||||
|
<Compile Include="Screens\Multiplayer\ModeTypeInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">
|
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user