From 6ea1ed8d04addf7e04044fa6de531f773dd455bf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 17 Feb 2019 19:48:54 +0900 Subject: [PATCH] Fix unnecessary texture atlas generation --- .../Components/TournamentBeatmapPanel.cs | 2 +- .../Screens/Gameplay/Components/MatchHeader.cs | 3 +-- .../Screens/Gameplay/GameplayScreen.cs | 3 +-- .../Ladder/Components/DrawableMatchPairing.cs | 13 +++++++++++-- .../Screens/Showcase/ShowcaseScreen.cs | 3 +-- .../Screens/TeamIntro/TeamIntroScreen.cs | 3 +-- .../Screens/TeamWin/TeamWinScreen.cs | 3 +-- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index ae2e2b5160..748f9fbdce 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -140,7 +140,7 @@ private void load(LadderInfo ladder, Storage storage) if (!string.IsNullOrEmpty(mods)) AddInternal(new Sprite { - Texture = new TextureStore(new TextureLoaderStore(new StorageBackedResourceStore(storage))).Get($"mods/{mods}"), + Texture = new LargeTextureStore(new TextureLoaderStore(new StorageBackedResourceStore(storage))).Get($"mods/{mods}"), Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Margin = new MarginPadding(20), diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs index 210b42a4c8..25f7be1739 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchHeader.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Textures; using osu.Framework.Input.Events; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -22,7 +21,7 @@ namespace osu.Game.Tournament.Screens.Gameplay.Components public class MatchHeader : Container { [BackgroundDependencyLoader] - private void load(LadderInfo ladder, TextureStore textures) + private void load(LadderInfo ladder) { RelativeSizeAxes = Axes.X; Height = 95; diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 277d2aad6d..ad0ef0f521 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Graphics.Textures; using osu.Framework.Threading; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; @@ -37,7 +36,7 @@ public class GameplayScreen : BeatmapInfoScreen private TournamentSceneManager sceneManager { get; set; } [BackgroundDependencyLoader] - private void load(LadderInfo ladder, TextureStore textures, MatchIPCInfo ipc, MatchChatDisplay chat) + private void load(LadderInfo ladder, MatchIPCInfo ipc, MatchChatDisplay chat) { this.chat = chat; this.ipc = ipc; diff --git a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs index db942c6e4c..58eab5bc0a 100644 --- a/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs +++ b/osu.Game.Tournament/Screens/Ladder/Components/DrawableMatchPairing.cs @@ -18,6 +18,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components public class DrawableMatchPairing : CompositeDrawable { public readonly MatchPairing Pairing; + private readonly bool editor; protected readonly FillFlowContainer Flow; private readonly Drawable selectionBox; private readonly Drawable currentMatchSelectionBox; @@ -26,9 +27,14 @@ public class DrawableMatchPairing : CompositeDrawable [Resolved(CanBeNull = true)] private LadderEditorInfo editorInfo { get; set; } - public DrawableMatchPairing(MatchPairing pairing) + [Resolved(CanBeNull = true)] + private LadderInfo ladderInfo { get; set; } + + + public DrawableMatchPairing(MatchPairing pairing, bool editor = false) { Pairing = pairing; + this.editor = editor; AutoSizeAxes = Axes.Both; @@ -109,7 +115,10 @@ public bool Selected if (selected) { selectionBox.Show(); - editorInfo.Selected.Value = Pairing; + if (editor) + editorInfo.Selected.Value = Pairing; + else + ladderInfo.CurrentMatch.Value = Pairing; } else selectionBox.Hide(); diff --git a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs index 7690ff4b97..65369fa6da 100644 --- a/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs +++ b/osu.Game.Tournament/Screens/Showcase/ShowcaseScreen.cs @@ -2,14 +2,13 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Graphics.Textures; namespace osu.Game.Tournament.Screens.Showcase { public class ShowcaseScreen : BeatmapInfoScreen { [BackgroundDependencyLoader] - private void load(TextureStore textures) + private void load() { AddInternal(new TournamentLogo()); } diff --git a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs index 55af305045..dc79d4aab0 100644 --- a/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs +++ b/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs @@ -5,7 +5,6 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Video; using osu.Framework.Platform; using osu.Game.Graphics; @@ -25,7 +24,7 @@ public class TeamIntroScreen : TournamentScreen, IProvideVideo private readonly Bindable currentMatch = new Bindable(); [BackgroundDependencyLoader] - private void load(TextureStore textures, LadderInfo ladder, Storage storage) + private void load(LadderInfo ladder, Storage storage) { RelativeSizeAxes = Axes.Both; diff --git a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs index fbb622e16f..2e2c8e5020 100644 --- a/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs +++ b/osu.Game.Tournament/Screens/TeamWin/TeamWinScreen.cs @@ -5,7 +5,6 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Video; using osu.Framework.Platform; using osu.Game.Graphics; @@ -29,7 +28,7 @@ public class TeamWinScreen : TournamentScreen, IProvideVideo private VideoSprite redWinVideo; [BackgroundDependencyLoader] - private void load(TextureStore textures, LadderInfo ladder, Storage storage) + private void load(LadderInfo ladder, Storage storage) { RelativeSizeAxes = Axes.Both;