-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix calculating error of play time & show game process when game is r…
…unning
- Loading branch information
Showing
21 changed files
with
309 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/Starward/Features/GameRecord/ColorToSolidColorBrushConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Media; | ||
using System; | ||
using Windows.UI; | ||
|
||
namespace Starward.Features.GameRecord; | ||
|
||
internal class ColorToSolidColorBrushConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
return new SolidColorBrush((Color)value); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/Starward/Features/GameRecord/Genshin/SpiralAbyssBattleAvatarsSelectConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Microsoft.UI.Xaml.Data; | ||
using Starward.Core.GameRecord.Genshin.SpiralAbyss; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Starward.Features.GameRecord.Genshin; | ||
|
||
public class SpiralAbyssBattleAvatarsSelectConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
if (value is SpiralAbyssLevel level) | ||
{ | ||
if (parameter is "1") | ||
{ | ||
if (level.Battles?.Count > 1) | ||
{ | ||
return level.Battles[1].Avatars; | ||
} | ||
} | ||
else | ||
{ | ||
return level.Battles?.FirstOrDefault()?.Avatars!; | ||
} | ||
} | ||
if (value is IList<SpiralAbyssBattle> battles) | ||
{ | ||
if (parameter is "1") | ||
{ | ||
if (battles.Count > 1) | ||
{ | ||
return battles[1].Avatars; | ||
} | ||
} | ||
else | ||
{ | ||
return battles.FirstOrDefault()?.Avatars!; | ||
} | ||
} | ||
return null!; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Starward/Features/GameRecord/StarRail/SimulatedUniverseBuffBgConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Microsoft.UI; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Media; | ||
using System; | ||
using Windows.UI; | ||
|
||
namespace Starward.Features.GameRecord.StarRail; | ||
|
||
internal class SimulatedUniverseBuffBgConverter : IValueConverter | ||
{ | ||
|
||
|
||
private static SolidColorBrush Rank1Brush = new SolidColorBrush(Color.FromArgb(0xFF, 0x68, 0x68, 0x70)); | ||
private static SolidColorBrush Rank2Brush = new SolidColorBrush(Color.FromArgb(0xFF, 0x53, 0x79, 0xB5)); | ||
private static SolidColorBrush Rank3Brush = new SolidColorBrush(Color.FromArgb(0xFF, 0xBC, 0x9B, 0x6E)); | ||
private static SolidColorBrush Rank0Brush = new SolidColorBrush(Colors.Transparent); | ||
|
||
public object Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
return (int)value switch | ||
{ | ||
1 => Rank1Brush, | ||
2 => Rank2Brush, | ||
3 => Rank3Brush, | ||
_ => Rank0Brush, | ||
}; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
src/Starward/Features/GameRecord/StarRail/SimulatedUniverseBuffIconConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Microsoft.UI.Xaml.Data; | ||
using System; | ||
|
||
namespace Starward.Features.GameRecord.StarRail; | ||
|
||
internal class SimulatedUniverseBuffIconConverter : IValueConverter | ||
{ | ||
|
||
private const string Icon_120 = "ms-appx:///Assets/Image/RogueInterveneKnight.png"; | ||
private const string Icon_121 = "ms-appx:///Assets/Image/RogueInterveneMemory.png"; | ||
private const string Icon_122 = "ms-appx:///Assets/Image/RogueInterveneWarlock.png"; | ||
private const string Icon_123 = "ms-appx:///Assets/Image/RogueIntervenePirest.png"; | ||
private const string Icon_124 = "ms-appx:///Assets/Image/RogueInterveneRogue.png"; | ||
private const string Icon_125 = "ms-appx:///Assets/Image/RogueInterveneWarrior.png"; | ||
private const string Icon_126 = "ms-appx:///Assets/Image/RogueInterveneJoy.png"; | ||
private const string Icon_127 = "ms-appx:///Assets/Image/RogueIntervenePropagation.png"; | ||
private const string Icon_128 = "ms-appx:///Assets/Image/RogueInterveneMage.png"; | ||
private const string TransparentBackground = "ms-appx:///Assets/Image/Transparent.png"; | ||
|
||
public object Convert(object value, Type targetType, object parameter, string language) | ||
{ | ||
return (int)value switch | ||
{ | ||
120 => Icon_120, | ||
121 => Icon_121, | ||
122 => Icon_122, | ||
123 => Icon_123, | ||
124 => Icon_124, | ||
125 => Icon_125, | ||
126 => Icon_126, | ||
127 => Icon_127, | ||
128 => Icon_128, | ||
_ => TransparentBackground, | ||
}; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, string language) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.