Skip to content

Commit

Permalink
🚧 Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Nov 20, 2023
1 parent 0eff585 commit c318489
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 46 deletions.
2 changes: 1 addition & 1 deletion ref/DirectoryPackages
2 changes: 1 addition & 1 deletion ref/SteamClient
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public CarouselBanner()
CarouselControl[!Carousel.ItemsSourceProperty] = this[!ItemsSourceProperty];
CarouselControl[!Carousel.ItemTemplateProperty] = this[!ItemTemplateProperty];

this.GetObservable(ItemsSourceProperty)
CarouselControl.GetObservable(Carousel.ItemCountProperty)
.Subscribe(_ => SwipersLoad());

CarouselControl.GetObservable(Carousel.SelectedIndexProperty)
Expand Down Expand Up @@ -122,6 +122,40 @@ public CarouselBanner()
});
}

//protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
//{
// if (change.Property == ItemsSourceProperty)
// {
// SwipersLoad();
// }
// else if (change.Property == AutoScrollProperty)
// {
// if (change.NewValue is bool x)
// {
// if (x && _timer == null)
// {
// _timer = new Timer(_ =>
// {
// if (!this.IsPointerOver)
// {
// Dispatcher.UIThread.Post(SwiperNext, DispatcherPriority.Background);
// }
// }, nameof(AutoScroll), AutoScrollInterval, AutoScrollInterval);
// }
// else
// {
// if (_timer != null)
// {
// _timer.Dispose();
// _timer = null;
// }
// }
// }
// }

// base.OnPropertyChanged(change);
//}

private void CarouselBannerIndexButton_Click(object? sender, RoutedEventArgs e)
{
if (sender is Button button && button.Tag is int index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public partial class ProxyChartView : UserControl
YToolTipLabelFormatter = (e) => $"{IOPath.GetDisplayFileSizeString(e.Coordinate.PrimaryValue)}/s",
Mapping = (rate, point) =>
{
point.Coordinate = new(rate.Timestamp, rate.Rate);
return new(rate.Timestamp, rate.Rate);
//point.PrimaryValue = rate.Rate;
//point.SecondaryValue = rate.Timestamp;
}
Expand All @@ -43,7 +43,7 @@ public partial class ProxyChartView : UserControl
YToolTipLabelFormatter = (e) => $"{IOPath.GetDisplayFileSizeString(e.Coordinate.PrimaryValue)}/s",
Mapping = (rate, point) =>
{
point.Coordinate = new(rate.Timestamp, rate.Rate);
return new(rate.Timestamp, rate.Rate);
//point.PrimaryValue = rate.Rate;
//point.SecondaryValue = rate.Timestamp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static void ManageCloudArchive_Click(SteamApp app)
{
if (!ISteamService.Instance.IsRunningSteamProcess)
{
Toast.Show(ToastIcon.Warning, Strings.GameList_SteamNotRuning);
Toast.Show(ToastIcon.Warning, Strings.SteamNotRuning);
return;
}

Expand All @@ -221,7 +221,7 @@ public static async void UnlockAchievement_Click(SteamApp app)
{
if (!ISteamService.Instance.IsRunningSteamProcess)
{
Toast.Show(ToastIcon.Warning, Strings.GameList_SteamNotRuning);
Toast.Show(ToastIcon.Warning, Strings.SteamNotRuning);
return;
}
switch (app.Type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public async void RunOrStopAllButton_Click()
}
else
{
await MessageBox.ShowAsync(Strings.GameList_SteamNotRuning, button: MessageBox.Button.OK);
await MessageBox.ShowAsync(Strings.SteamNotRuning, button: MessageBox.Button.OK);
}
}

Expand All @@ -202,7 +202,7 @@ public async void RunStopBtn_Click(SteamApp app)
}
else
{
await MessageBox.ShowAsync(Strings.GameList_SteamNotRuning, button: MessageBox.Button.OK);
await MessageBox.ShowAsync(Strings.SteamNotRuning, button: MessageBox.Button.OK);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async void IdleRunStartOrStop_Click()
{
if (!SteamTool.IsRunningSteamProcess)
{
await MessageBox.ShowAsync(Strings.Idle_SteamNotRuning, button: MessageBox.Button.OK);
await MessageBox.ShowAsync(Strings.SteamNotRuning, button: MessageBox.Button.OK);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="using:Avalonia.Xaml.Interactivity"
xmlns:ia="using:Avalonia.Xaml.Interactions.Core"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:s="https://steampp.net/services"
xmlns:spp="https://steampp.net/ui"
Expand Down Expand Up @@ -219,24 +221,49 @@
Expands="True"
IsExpanded="True">
<spp:OptionsDisplayItem.Header>
<TextBlock Foreground="Green">
<!--<Ellipse
Width="6"
Height="6"
Margin="0,0,5,0">
<i:Interaction.Behaviors>
<ia:DataTriggerBehavior
Binding="{Binding RunState}"
ComparisonCondition="Equal"
Value="True">
<ia:ChangePropertyAction
PropertyName="Fill"
TargetObject="ChangePropertyRectangle"
Value="#47A42B" />
</ia:DataTriggerBehavior>
<ia:DataTriggerBehavior
Binding="{Binding RunState}"
ComparisonCondition="NotEqual"
Value="True">
<ia:ChangePropertyAction
PropertyName="Fill"
TargetObject="ChangePropertyRectangle"
Value="#FF4F58" />
</ia:DataTriggerBehavior>
</i:Interaction.Behaviors>
</Ellipse>-->
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter="{StaticResource VisibleStringConverter}">
<CompiledBinding Mode="OneWay" Path="RunState" />
<CompiledBinding
Mode="OneWay"
Path="Res.SteamRuning"
Path="Res.SteamIdle_IdleRuning"
Source="{x:Static s:ResourceService.Current}" />
<CompiledBinding
Mode="OneWay"
Path="Res.SteamNoRuning"
Path="Res.SteamIdle_IdleNotRuning"
Source="{x:Static s:ResourceService.Current}" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</spp:OptionsDisplayItem.Header>
<spp:OptionsDisplayItem.Description>
<TextBlock Foreground="Green">
<TextBlock Foreground="{DynamicResource SystemFillColorSuccessBrush}">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource VisibleStringConverter}">
<CompiledBinding
Expand All @@ -249,20 +276,59 @@
Source="{x:Static s:ResourceService.Current}" />
<CompiledBinding
Mode="OneWay"
Path="Res.SteamNoRuning"
Path="Res.SteamNotRuning"
Source="{x:Static s:ResourceService.Current}" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</spp:OptionsDisplayItem.Description>
<spp:OptionsDisplayItem.Icon>
<ui:SymbolIcon Symbol="Page" />
<!--<ui:SymbolIcon Symbol="Page" />-->
<Ellipse
Width="6"
Height="6"
Margin="5,0,5,0">
<i:Interaction.Behaviors>
<ia:DataTriggerBehavior
Binding="{Binding RunState}"
ComparisonCondition="Equal"
Value="True">
<ia:ChangePropertyAction
PropertyName="Fill"
TargetObject="ChangePropertyRectangle"
Value="#47A42B" />
</ia:DataTriggerBehavior>
<ia:DataTriggerBehavior
Binding="{Binding RunState}"
ComparisonCondition="NotEqual"
Value="True">
<ia:ChangePropertyAction
PropertyName="Fill"
TargetObject="ChangePropertyRectangle"
Value="#FF4F58" />
</ia:DataTriggerBehavior>
</i:Interaction.Behaviors>
</Ellipse>
</spp:OptionsDisplayItem.Icon>
<spp:OptionsDisplayItem.ActionButton>
<Button
VerticalAlignment="Center"
Command="{Binding IdleRunStartOrStop}"
Content="启动" />
Content="启动">
<Button.Content>
<MultiBinding Converter="{StaticResource VisibleStringConverter}">
<CompiledBinding Mode="OneWay" Path="RunState" />
<CompiledBinding
Mode="OneWay"
Path="Res.SteamIdle_IdleRuning"
Source="{x:Static s:ResourceService.Current}" />
<CompiledBinding
Mode="OneWay"
Path="Res.SteamIdle_IdleNotRuning"
Source="{x:Static s:ResourceService.Current}" />
</MultiBinding>
</Button.Content>
</Button>
</spp:OptionsDisplayItem.ActionButton>
<spp:OptionsDisplayItem.Content>
<StackPanel
Expand Down
42 changes: 21 additions & 21 deletions src/BD.WTTS.Client/Resources/Strings.Designer.cs

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

16 changes: 8 additions & 8 deletions src/BD.WTTS.Client/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<value>没有启用任何加速项!!</value>
</data>
<data name="CommunityFix_AutoRunProxy" xml:space="preserve">
<value>启动时自动启动加速</value>
<value>启动时自动开启加速</value>
</data>
<data name="CommunityFix_DeleteCertificate" xml:space="preserve">
<value>移除证书</value>
Expand Down Expand Up @@ -499,9 +499,6 @@
</data>
<data name="GameList_SetCustomImage" xml:space="preserve">
<value>设置自定义封面</value>
</data>
<data name="GameList_SteamNotRuning" xml:space="preserve">
<value>Steam 未启动</value>
</data>
<data name="GameList_StopBtn" xml:space="preserve">
<value>全部暂停</value>
Expand Down Expand Up @@ -2719,9 +2716,6 @@
</data>
<data name="Idle_RuningCount" xml:space="preserve">
<value>正在运行 {0}/{1}</value>
</data>
<data name="Idle_SteamNotRuning" xml:space="preserve">
<value>Steam 未启动</value>
</data>
<data name="Idle_StopAutoNext" xml:space="preserve">
<value>关闭自动切换游戏</value>
Expand Down Expand Up @@ -2853,7 +2847,13 @@
<data name="SteamRuning" xml:space="preserve">
<value>Steam 已启动</value>
</data>
<data name="SteamNoRuning" xml:space="preserve">
<data name="SteamNotRuning" xml:space="preserve">
<value>Steam 未启动</value>
</data>
<data name="SteamIdle_IdleRuning" xml:space="preserve">
<value>正在挂卡</value>
</data>
<data name="SteamIdle_IdleNotRuning" xml:space="preserve">
<value>未启动挂卡</value>
</data>
</root>

0 comments on commit c318489

Please sign in to comment.