Skip to content

Commit

Permalink
Fix failed downloads not being counted
Browse files Browse the repository at this point in the history
Add chinese (traditional)
Fix chinese (simplified)
Fix scoreboard background not showing properly
  • Loading branch information
floh22 committed Jul 21, 2021
1 parent 6031566 commit 8630b9f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions LeagueBroadcast/Common/Data/Provider/DataDragon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
4 changes: 2 additions & 2 deletions LeagueBroadcast/LeagueBroadcast.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<RepositoryUrl>https://github.com/floh22/LeagueBroadcast</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageIcon>BE_icon.png</PackageIcon>
<AssemblyVersion>1.4.53.0</AssemblyVersion>
<FileVersion>1.4.53.21201</FileVersion>
<AssemblyVersion>1.4.56.0</AssemblyVersion>
<FileVersion>1.4.56.21202</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion LeagueBroadcast/MVVM/View/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
<ComboBoxItem Tag="ru_RU" Content="Русский"/>
<ComboBoxItem Tag="ro_RO" Content="Română"/>
<ComboBoxItem Tag="cs_CZ" Content="Čeština"/>
<ComboBoxItem Tag="zh_CN" Content="中国人"/>
<ComboBoxItem Tag="zh_CN" Content="简体字"/>
<ComboBoxItem Tag="zh-TW" Content="繁体字"/>
<ComboBoxItem Tag="ko_KR" Content="한국말"/>
</ComboBox>
</StackPanel>
Expand Down
3 changes: 2 additions & 1 deletion LeagueBroadcast/MVVM/View/SettingsView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
2 changes: 2 additions & 0 deletions Overlays/ingame/src/visual/InfoPageVisual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 15 additions & 11 deletions Overlays/ingame/src/visual/ScoreboardVisual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand All @@ -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);
Expand Down Expand Up @@ -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;
}
});

Expand All @@ -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;
}
});

Expand Down

0 comments on commit 8630b9f

Please sign in to comment.