From 8630b9f31a83936e7261025ea6392425bdcff039 Mon Sep 17 00:00:00 2001 From: eble_lars Date: Wed, 21 Jul 2021 14:58:46 +0200 Subject: [PATCH] Fix failed downloads not being counted Add chinese (traditional) Fix chinese (simplified) Fix scoreboard background not showing properly --- .../Common/Data/Provider/DataDragon.cs | 1 + LeagueBroadcast/LeagueBroadcast.csproj | 4 +-- LeagueBroadcast/MVVM/View/SettingsView.xaml | 3 ++- .../MVVM/View/SettingsView.xaml.cs | 3 ++- Overlays/ingame/src/visual/InfoPageVisual.ts | 2 ++ .../ingame/src/visual/ScoreboardVisual.ts | 26 +++++++++++-------- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/LeagueBroadcast/Common/Data/Provider/DataDragon.cs b/LeagueBroadcast/Common/Data/Provider/DataDragon.cs index bb64b29..b384194 100644 --- a/LeagueBroadcast/Common/Data/Provider/DataDragon.cs +++ b/LeagueBroadcast/Common/Data/Provider/DataDragon.cs @@ -463,6 +463,7 @@ public static void DownloadFile(string uri, string path) } catch(Exception e) { Log.Warn($"Could not download {uri}\n{eventArgs.Error.Message}"); + FileDownloadComplete.Invoke(null, EventArgs.Empty); } diff --git a/LeagueBroadcast/LeagueBroadcast.csproj b/LeagueBroadcast/LeagueBroadcast.csproj index 6a3d730..1f70ff6 100644 --- a/LeagueBroadcast/LeagueBroadcast.csproj +++ b/LeagueBroadcast/LeagueBroadcast.csproj @@ -15,8 +15,8 @@ https://github.com/floh22/LeagueBroadcast Git BE_icon.png - 1.4.53.0 - 1.4.53.21201 + 1.4.56.0 + 1.4.56.21202 diff --git a/LeagueBroadcast/MVVM/View/SettingsView.xaml b/LeagueBroadcast/MVVM/View/SettingsView.xaml index 17d4071..bd0d928 100644 --- a/LeagueBroadcast/MVVM/View/SettingsView.xaml +++ b/LeagueBroadcast/MVVM/View/SettingsView.xaml @@ -64,7 +64,8 @@ - + + diff --git a/LeagueBroadcast/MVVM/View/SettingsView.xaml.cs b/LeagueBroadcast/MVVM/View/SettingsView.xaml.cs index 2f5b06e..c13aae9 100644 --- a/LeagueBroadcast/MVVM/View/SettingsView.xaml.cs +++ b/LeagueBroadcast/MVVM/View/SettingsView.xaml.cs @@ -38,7 +38,8 @@ public partial class SettingsView : UserControl { 11, "ro_RO"}, { 12, "cs_CZ"}, { 13, "zh_CN"}, - { 14, "ko_KR"} + { 14, "zh_TW"}, + { 15, "ko_KR"} }; public SettingsView() { diff --git a/Overlays/ingame/src/visual/InfoPageVisual.ts b/Overlays/ingame/src/visual/InfoPageVisual.ts index a251d33..0b02fa6 100644 --- a/Overlays/ingame/src/visual/InfoPageVisual.ts +++ b/Overlays/ingame/src/visual/InfoPageVisual.ts @@ -221,6 +221,8 @@ export default class InfoPageVisual extends VisualElement { if (this.PlayerTabs.length !== 0) { this.PlayerTabs.forEach(tab => { tab.UpdateConfig(newConfig) }); } + + this.scene.load.start(); } Load(): void { //Load in constructor diff --git a/Overlays/ingame/src/visual/ScoreboardVisual.ts b/Overlays/ingame/src/visual/ScoreboardVisual.ts index 713dae7..5682f51 100644 --- a/Overlays/ingame/src/visual/ScoreboardVisual.ts +++ b/Overlays/ingame/src/visual/ScoreboardVisual.ts @@ -417,13 +417,15 @@ export default class ScoreboardVisual extends VisualElement { if (this.BackgroundVideo !== undefined && this.BackgroundVideo !== null) { this.RemoveVisualComponent(this.BackgroundVideo); this.BackgroundVideo.destroy(); + this.BackgroundVideo = null; + this.scene.cache.video.remove('scoreBgVideo'); } if (this.BackgroundRect !== undefined && this.BackgroundRect !== null) { this.RemoveVisualComponent(this.BackgroundRect); this.BackgroundRect.destroy(); this.BackgroundRect = null; } - //Reset old Texture + //Load Texture only if it does not already exist if (this.BackgroundImage === null || this.BackgroundImage === undefined) { this.scene.load.image('scoreBg', 'frontend/backgrounds/Score.png'); } @@ -439,26 +441,26 @@ export default class ScoreboardVisual extends VisualElement { this.RemoveVisualComponent(this.BackgroundImage); this.BackgroundImage.destroy(); this.BackgroundImage = null; + this.scene.textures.remove('scoreBg'); } - //Reset old Video - if(this.scene.cache.video.has('scoreBgVideo')) { - this.RemoveVisualComponent(this.BackgroundVideo); - this.BackgroundVideo?.destroy(), - this.BackgroundVideo = null; - this.scene.cache.video.remove('scoreBgVideo'); + //Load Video only if it does not already exist + if(this.BackgroundVideo === null || this.BackgroundVideo === undefined) { + this.scene.load.video('scoreBgVideo', 'frontend/backgrounds/Score.mp4'); } - this.scene.load.video('scoreBgVideo', 'frontend/backgrounds/Score.mp4'); } //Background Color else { if (this.BackgroundImage !== undefined && this.BackgroundImage !== null) { this.RemoveVisualComponent(this.BackgroundImage); this.BackgroundImage.destroy(); + this.BackgroundImage = null; + this.scene.textures.remove('scoreBg'); } if (this.BackgroundVideo !== undefined && this.BackgroundVideo !== null) { this.RemoveVisualComponent(this.BackgroundVideo); this.BackgroundVideo.destroy(); this.BackgroundVideo = null; + this.scene.cache.video.remove('scoreBgVideo'); } if (this.BackgroundRect === null || this.BackgroundRect === undefined) { this.BackgroundRect = this.scene.add.rectangle(newConfig.Position.X, newConfig.Position.Y + (newConfig.Size.Y / 2), newConfig.Size.X, newConfig.Size.Y, Phaser.Display.Color.RGBStringToColor(newConfig.Background.FallbackColor).color, 1); @@ -749,12 +751,13 @@ export default class ScoreboardVisual extends VisualElement { //Background Image support this.scene.load.on(`filecomplete-image-scoreBg`, () => { this.BackgroundImage = this.scene.make.sprite({ x: ScoreboardVisual.GetConfig()!.Position.X, y: ScoreboardVisual.GetConfig()!.Position.Y, key: 'scoreBg', add: true }); - this.BackgroundImage.setOrigin(0.5, 1); + this.BackgroundImage.setOrigin(0.5, 0); this.BackgroundImage.setDepth(-1); this.BackgroundImage.setMask(ScoreboardVisual.GetConfig()?.Background.UseAlpha ? this.ImgMask : this.GeoMask); this.AddVisualComponent(this.BackgroundImage); if (!this.isActive && !this.isShowing) { this.BackgroundImage.alpha = 0; + this.BackgroundImage.y -= this.BackgroundImage.displayHeight; } }); @@ -766,14 +769,15 @@ export default class ScoreboardVisual extends VisualElement { } // @ts-ignore this.BackgroundVideo = this.scene.add.video(ScoreboardVisual.GetConfig()!.Position.X, ScoreboardVisual.GetConfig()!.Position.Y, 'scoreBgVideo', false, true); - this.BackgroundVideo.setOrigin(0.5, 1); + this.BackgroundVideo.setOrigin(0.5, 0); this.BackgroundVideo.setMask(ScoreboardVisual.GetConfig()?.Background.UseAlpha ? this.ImgMask : this.GeoMask); this.BackgroundVideo.setLoop(true); this.BackgroundVideo.setDepth(-1); this.BackgroundVideo.play(); this.AddVisualComponent(this.BackgroundVideo); - if (!this.isActive || this.isHiding) { + if (!this.isActive && !this.isShowing) { this.BackgroundVideo.alpha = 0; + this.BackgroundVideo.y -= this.BackgroundVideo.displayHeight; } });