Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
English (US) release notes, mirroring CHANGELOG.md (Brazilian Portuguese). Before publishing a version, add a `## [VERSION]` section to **both** files: the workflow publishes the section matching the tag from each one and fails if either is missing.

## [Unreleased]
### Changes
- Home: clicking a launcher (or pressing A on it) only picks what will open; **Play now** is what starts. Before, the click went straight into console mode, so picking looked like opening. With a controller or the keyboard, the focus moves down to **Play now** after the pick, so a second A plays. (#193)

## [1.7.0-beta.2]
### Fixes
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Notas em português do Brasil; a versão em inglês (Estados Unidos) fica em `CHANGELOG.en-US.md`. Antes de publicar uma versão, adicione uma seção `## [VERSÃO]` com o changelog daquela versão **nos dois arquivos**. O workflow publica as duas seções correspondentes à tag na mesma release e falha se faltar alguma.

## [Unreleased]
### Mudanças
- Início: clicar num iniciador (ou apertar A nele) só escolhe o que vai abrir; quem começa é **Jogar agora**. Antes o clique já entrava no modo console, e escolher parecia abrir sozinho. No controle e no teclado, o foco desce para **Jogar agora** depois da escolha, então um segundo A joga. (#193)

## [1.7.0-beta.2]
### Correções
Expand Down
8 changes: 5 additions & 3 deletions src/ConsoleMode/ViewModels/MainViewModel.LaunchTiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
public string Glyph { get; init; } = "";
public Brush Background { get; init; } = null!;
/// <summary>The launcher's own logo (Steam's, Playnite's, the Xbox app's, the custom app's); until then, or without it, the glyph.</summary>
[ObservableProperty, NotifyPropertyChangedFor(nameof(HasLogo), nameof(ShowGlyph))] private ImageSource? _logo;

Check warning on line 23 in src/ConsoleMode/ViewModels/MainViewModel.LaunchTiles.cs

View workflow job for this annotation

GitHub Actions / Build and test

The field ConsoleMode.ViewModels.LaunchTile._logo using
public bool HasLogo => Logo is not null;
/// <summary>The app whose logo this tile is waiting for (exe path or Store app id).</summary>
public string? LogoKey { get; set; }
public bool ShowGlyph => Logo is null;
[ObservableProperty, NotifyPropertyChangedFor(nameof(Opacity))] private bool _isSelected;

Check warning on line 28 in src/ConsoleMode/ViewModels/MainViewModel.LaunchTiles.cs

View workflow job for this annotation

GitHub Actions / Build and test

The field ConsoleMode.ViewModels.LaunchTile._isSelected using
/// <summary>The other launchers fade back, so the one that opens stands out.</summary>
public double Opacity => IsSelected ? 1 : 0.6;
}
Expand Down Expand Up @@ -174,13 +174,15 @@
if (tile is not null && !tile.IsAdd && !ReferenceEquals(SelectedLaunch, tile.Option)) SelectedLaunch = tile.Option;
}

/// <summary>A (or a click) on a tile: that launcher, and play it if the setup allows; on "+", add a custom app.</summary>
/// <summary>
/// A (or a click) on a tile picks that launcher and nothing opens yet: Play now does that, so picking one never
/// looks like it starts on its own. On "+", add a custom app.
/// </summary>
[RelayCommand]
private async Task PlayLaunchTile(LaunchTile? tile)
private async Task ChooseLaunchTile(LaunchTile? tile)
{
if (tile?.IsAdd == true) { await AddCustomAppAsync(); return; }
SelectLaunchTile(tile);
if (CanStart) await StartAsync();
}

private void UpdateHomeMeta()
Expand Down
5 changes: 3 additions & 2 deletions src/ConsoleMode/Views/ConsoleHomeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="vm:LaunchTile">
<!-- The focus picks the launcher (ConsoleHomeView.ScaleTile); A plays it. -->
<!-- The focus picks the launcher (ConsoleHomeView.ScaleTile); A or a click picks it too and Play now opens it. -->
<StackPanel Spacing="18" Opacity="{x:Bind Opacity, Mode=OneWay}">
<StackPanel.OpacityTransition><ScalarTransition Duration="0:0:0.14"/></StackPanel.OpacityTransition>
<Button Style="{StaticResource LaunchTileButton}" Background="{x:Bind Background}"
Command="{Binding ViewModel.PlayLaunchTileCommand, ElementName=Page}" CommandParameter="{x:Bind}"
Command="{Binding ViewModel.ChooseLaunchTileCommand, ElementName=Page}" CommandParameter="{x:Bind}"
Click="OnLaunchTileClick"
AutomationProperties.Name="{x:Bind Text}">
<Grid>
<FontIcon Glyph="{x:Bind Glyph}" FontSize="48" Margin="0,0,0,20" Visibility="{x:Bind ShowGlyph, Mode=OneWay}"/>
Expand Down
21 changes: 21 additions & 0 deletions src/ConsoleMode/Views/ConsoleHomeView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public sealed partial class ConsoleHomeView : UserControl
private readonly ScrollEdges _rowsEdges;
/// <summary>When a category was last pressed with the mouse / touch: that click picks it, A goes into its options.</summary>
private long _railPointerPressedAt = long.MinValue / 2;
/// <summary>
/// A mouse / touch press on a launcher is under way: from the press to the release, which is when the tile's
/// Click fires. That click picks it and leaves the focus where it is; A or Enter at any other moment is not one.
/// </summary>
private bool _launchPointerDown;
private int _shownTab;
private static readonly Windows.UI.ViewManagement.UISettings Ui = new();

Expand Down Expand Up @@ -57,6 +62,11 @@ public ConsoleHomeView()
_rowsEdges = new ScrollEdges(SettingsRows, RowsFadeTop, RowsFadeBottom, RowsScrollTrack, RowsScrollThumb);
CategoryRail.GettingFocus += OnRailGettingFocus;
CategoryRail.AddHandler(UIElement.PointerPressedEvent, new PointerEventHandler((_, _) => _railPointerPressedAt = Environment.TickCount64), true);
// The release reaches the row after the tile has handled it (and raised Click), so the flag covers that click only.
LaunchRow.AddHandler(UIElement.PointerPressedEvent, new PointerEventHandler((_, _) => _launchPointerDown = true), true);
LaunchRow.AddHandler(UIElement.PointerReleasedEvent, new PointerEventHandler((_, _) => _launchPointerDown = false), true);
LaunchRow.AddHandler(UIElement.PointerCaptureLostEvent, new PointerEventHandler((_, _) => _launchPointerDown = false), true);
LaunchRow.AddHandler(UIElement.PointerCanceledEvent, new PointerEventHandler((_, _) => _launchPointerDown = false), true);
// The sounds are the pad's (GamepadNavigator, LB / RB): mouse clicks stay silent.
ViewModel.PropertyChanged += OnViewModelChanged;
if (ViewModel.IsIntroShowing) ShowIntro();
Expand Down Expand Up @@ -941,6 +951,17 @@ private void PickFocusedLauncher(object source)
if (source is Button { DataContext: LaunchTile tile }) ViewModel.SelectLaunchTileCommand.Execute(tile);
}

/// <summary>
/// A on a launcher (pad or keyboard) picks it and takes the focus down to Play now, so a second A plays.
/// A mouse click only picks it: the pointer is already where it can click Play now.
/// </summary>
private void OnLaunchTileClick(object sender, RoutedEventArgs e)
{
// How this press came in, not how the tile got its focus: it may hold the pad's focus and still be clicked.
if (sender is not Button { DataContext: LaunchTile { IsAdd: false } } || _launchPointerDown) return;
if (ViewModel.CanStart) PlayButton.Focus(FocusState.Keyboard);
}

/// <summary>Cards (not settings rows) grow when focused and shrink back when it leaves; the launchers grow more.</summary>
private static void ScaleTile(object source, float scale)
{
Expand Down
Loading