Skip to content

Commit

Permalink
perf: better gacha overview
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraZiling committed Jul 27, 2024
1 parent a91efb6 commit ef3267f
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Hollow/Helpers/GachaAnalyser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private static AnalyzedCommonGachaRecord FromGachaItems(List<GachaItem> gachaIte
var timeRange = "Unknown";
if (total > 0)
{
timeRange = $"{analyzedCommonGachaRecordItems.Last().Time} - {analyzedCommonGachaRecordItems.First().Time}";
timeRange = $"{analyzedCommonGachaRecordItems.Last().Time.Split(' ')[0]} - {analyzedCommonGachaRecordItems.First().Time.Split(' ')[0]}";
}

return new AnalyzedCommonGachaRecord
Expand Down
10 changes: 5 additions & 5 deletions Hollow/Languages/Lang.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Hollow/Languages/Lang.resx
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@
<value>Export</value>
</data>
<data name="SignalSearch_StandardChannel" xml:space="preserve">
<value>Standard Channel</value>
<value>Standard</value>
</data>
<data name="SignalSearch_ExclusiveChannel" xml:space="preserve">
<value>Exclusive Channel</value>
<value>Exclusive</value>
</data>
<data name="SignalSearch_WEngineChannel" xml:space="preserve">
<value>W-Engine Channel</value>
<value>W-Engine</value>
</data>
<data name="SignalSearch_BangbooChannel" xml:space="preserve">
<value>Bangboo Channel</value>
<value>Bangboo</value>
</data>
<data name="SignalSearch_Overview" xml:space="preserve">
<value>Overview</value>
Expand Down Expand Up @@ -151,7 +151,7 @@
<value>Fetching {0} records from page {1}</value>
</data>
<data name="SignalSearch_OverviewCard_Total" xml:space="preserve">
<value>Total Records</value>
<value>Records</value>
</data>
<data name="SignalSearch_OverviewCard_SSignals" xml:space="preserve">
<value>S Signals</value>
Expand Down
2 changes: 1 addition & 1 deletion Hollow/Languages/Lang.zh-cn.resx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
<value>从第{1}页获取{0}个记录</value>
</data>
<data name="SignalSearch_OverviewCard_Total" xml:space="preserve">
<value>记录数</value>
<value>条记录</value>
</data>
<data name="SignalSearch_OverviewCard_SSignals" xml:space="preserve">
<value>S 级记录数</value>
Expand Down
50 changes: 37 additions & 13 deletions Hollow/Views/Controls/SignalSearch/SignalSearchOverviewCard.axaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:languages="clr-namespace:Hollow.Languages"
xmlns:signalSearch="clr-namespace:Hollow.Views.Controls.SignalSearch"
xmlns:signalSearchModels="clr-namespace:Hollow.Models.Pages.SignalSearch"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:signalSearch="clr-namespace:Hollow.Views.Controls.SignalSearch">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme TargetType="signalSearch:SignalSearchOverviewCard" x:Key="SignalSearchOverviewCardTheme">
<Setter Property="Template">
<ControlTemplate>
Expand All @@ -13,20 +13,30 @@
CornerRadius="10"
Margin="0,0,5,0"
Padding="10">
<Grid RowDefinitions="50, 120, *">
<Grid RowDefinitions="35, 120, *">
<Border
Background="{StaticResource CoverageBackground}"
CornerRadius="10"
Grid.Row="0"
Margin="-10,-10,-10,5"
Padding="7,7,0,0">
<StackPanel VerticalAlignment="Top">
Padding="9">
<Panel VerticalAlignment="Top">
<TextBlock
FontSize="16"
FontWeight="Medium"
FontSize="18"
HorizontalAlignment="Left"
Text="{TemplateBinding Header}" />
<TextBlock FontSize="12" Text="{TemplateBinding TimeRange}" />
</StackPanel>
<StackPanel
HorizontalAlignment="Right"
Orientation="Horizontal"
Spacing="3">
<TextBlock FontSize="18" Text="{TemplateBinding Total}" />
<TextBlock
FontSize="14"
Margin="0,0,0,-1"
Text="{I18N {x:Static languages:LangKeys.SignalSearch_OverviewCard_Total}}"
VerticalAlignment="Bottom" />
</StackPanel>
</Panel>
</Border>
<StackPanel
Grid.Row="1"
Expand All @@ -37,10 +47,6 @@
<Setter Property="FontSize" Value="14" />
</Style>
</StackPanel.Styles>
<Panel>
<TextBlock HorizontalAlignment="Left" Text="{I18N {x:Static languages:LangKeys.SignalSearch_OverviewCard_Total}}" />
<TextBlock HorizontalAlignment="Right" Text="{TemplateBinding Total}" />
</Panel>
<Panel>
<TextBlock
Foreground="{StaticResource SignalSearchSColor}"
Expand Down Expand Up @@ -87,7 +93,25 @@
<TextBlock Foreground="{StaticResource SignalSearchBColor}" Text="%)" />
</StackPanel>
</Panel>
<Grid ColumnDefinitions="*, 3.5*, *">
<Panel
Background="White"
Grid.Column="0"
Height="0.5"
Opacity="0.5" />
<TextBlock
FontSize="12"
Grid.Column="1"
HorizontalAlignment="Center"
Text="{TemplateBinding TimeRange}" />
<Panel
Background="White"
Grid.Column="2"
Height="0.5"
Opacity="0.5" />
</Grid>
</StackPanel>

<ItemsControl Grid.Row="2" ItemsSource="{TemplateBinding ProgressBars}">
<ItemsControl.Styles>
<Style Selector="TextBlock">
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WIP
- [x] 公告
- [x] 调频记录
- [x] 多账号支持 *不稳定,需要测试*
- [ ] UIGF 导入
- [x] UIGF 导入 *不稳定,需要测试*
- [x] UIGF 导出
- [x] 简单分析
- [ ] 各类型详细分析
Expand Down

0 comments on commit ef3267f

Please sign in to comment.