This file contains hidden or 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
| if (_doom == null || Gamepad.Gamepads.Count == 0) | |
| return; | |
| var gamepad = Gamepad.Gamepads[0]; // Use first gamepad | |
| var reading = gamepad.GetCurrentReading(); | |
| ProcessButtons(reading); | |
| ProcessMovementStick(reading.LeftThumbstickX, reading.LeftThumbstickY); | |
| ProcessLookStick(reading.RightThumbstickX, reading.RightThumbstickY); | |
| ProcessTriggers(reading.LeftTrigger, reading.RightTrigger); |
This file contains hidden or 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
| if (_movementPointerId.HasValue) | |
| { | |
| var dx = _movementCurrent.X - _movementCenter.X; | |
| var dy = _movementCurrent.Y - _movementCenter.Y; | |
| var distance = Math.Sqrt(dx * dx + dy * dy); | |
| var normalizedDistance = Math.Min(distance / JoystickRadius, 1.0); | |
| if (normalizedDistance > DeadZone) | |
| { | |
| var angle = Math.Atan2(dy, dx); |
This file contains hidden or 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
| if (IsInFireButton(position) && !_firePointerId.HasValue) | |
| { | |
| _firePointerId = pointerId; | |
| SetFirePressed(true); | |
| CapturePointer(e.Pointer); | |
| e.Handled = true; | |
| return; | |
| } | |
| if (IsInUseButton(position) && !_usePointerId.HasValue) |
This file contains hidden or 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
| <UserControl | |
| x:Class="UnoDoom.Game.TouchInputOverlay" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| xmlns:toolkit="using:Uno.UI.Toolkit" | |
| IsHitTestVisible="True" | |
| Opacity="0.85" | |
| mc:Ignorable="d"> |
This file contains hidden or 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
| private static string _localWadPath; | |
| /// <summary> | |
| /// Prepares assets for WebAssembly by downloading them via HTTP | |
| /// </summary> | |
| public static async Task PrepareAssetsAsync() | |
| { | |
| var localFolder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("Wads", CreationCollisionOption.OpenIfExists); | |
| foreach (var name in iwadNames) | |
| { |
This file contains hidden or 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
| public partial class MainViewModel : PageViewModel | |
| { | |
| private readonly IBlueskyService _blueskyService; | |
| public MainViewModel(INavigationService navigationService, IBlueskyService blueskyService) : base(navigationService) | |
| { | |
| _blueskyService = blueskyService; | |
| } | |
| [ObservableProperty] |
This file contains hidden or 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
| <Grid> | |
| <Grid.RowDefinitions> | |
| <RowDefinition Height="*" /> | |
| <RowDefinition Height="Auto" /> | |
| </Grid.RowDefinitions> | |
| <ListView SelectionMode="None" ItemsSource="{x:Bind ViewModel.Feed, Mode=OneWay}"> | |
| <ListView.ItemTemplate> | |
| <DataTemplate x:DataType="vm:FeedItemViewModel"> | |
| <StackPanel CornerRadius="8" Margin="8,4,8,4" Padding="8" Spacing="8" Background="{ThemeResource ButtonBackground}"> | |
| <TextBlock Text="{x:Bind Text}" TextWrapping="WrapWholeWords" /> |
This file contains hidden or 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
| using Birdsky.Core.Services.Bluesky; | |
| using Birdsky.Services.Navigation; | |
| using CommunityToolkit.Mvvm.ComponentModel; | |
| using CommunityToolkit.Mvvm.Input; | |
| using MZikmund.Toolkit.WinUI.Infrastructure; | |
| namespace Birdsky.Core.ViewModels; | |
| public partial class LoginViewModel : PageViewModel | |
| { |
This file contains hidden or 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
| private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e) | |
| { | |
| ViewModel!.AppPassword = ((PasswordBox)sender).Password; | |
| } |
This file contains hidden or 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
| <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="10"> | |
| <TextBox Header="Handle" Text="{Binding Handle, Mode=TwoWay}" Width="300" /> | |
| <PasswordBox Header="App Password" Width="300" PasswordChanged="PasswordBox_PasswordChanged" /> | |
| <Button Content="Login" Command="{Binding LoginCommand}" Width="300" /> | |
| </StackPanel> |
NewerOlder