Skip to content

Commit

Permalink
feat(configuration): add audio section
Browse files Browse the repository at this point in the history
  • Loading branch information
DorielRivalet committed Aug 8, 2023
1 parent f74cc5e commit 8ca2272
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 1 deletion.
103 changes: 102 additions & 1 deletion MHFZ_Overlay/Views/Windows/ConfigWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2062,7 +2062,108 @@
</TabControl>
</Grid>
</TabItem>
<TabItem ToolTip="Player Settings" Background="{StaticResource Mantle}" Foreground="{StaticResource Text}">
<TabItem ToolTip="Audio Settings" Background="{StaticResource Mantle}" Foreground="{StaticResource Text}">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<Image Source="../../Assets/Icons/png/note_pink.png" Width="32" Height="32"/>
<TextBlock Foreground="#ff985d" Text="Audio" Margin="4,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</TabItem.Header>
<Grid x:Name="AudioContent" Height="Auto" Width="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="100"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!--https://stackoverflow.com/questions/17946487/how-to-scroll-a-grid-->
<ScrollViewer VerticalScrollBarVisibility="Visible" Grid.Row="0" CanContentScroll="True" IsDeferredScrollingEnabled="True">
<Grid Height="Auto" Width="Auto" Background="Transparent" Style="{StaticResource ConfigSingleGrid}" Grid.Row="0" Grid.Column="1" Margin="20,20,20,20" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>

<TextBlock Text="Main Volume" Margin="5" ToolTip="Adjust the main volume" Style="{StaticResource ConfigTextBox}" Grid.Row="0" Grid.Column="0"/>
<DockPanel Grid.Row="0" Grid.Column="1">
<ui:TextBlock Text="{Binding Path=VolumeMain, Source={StaticResource Settings}, StringFormat={}{0:P0}}" DockPanel.Dock="Right" TextAlignment="Center" Width="80" VerticalAlignment="Center">
</ui:TextBlock>
<Slider IsSnapToTickEnabled="True" TickFrequency="0.05" TickPlacement="Both" Minimum="0" Maximum="1" Value="{Binding Path=VolumeMain, Source={StaticResource Settings}}" />
</DockPanel>

<TextBlock Text="Achievement Unlock Volume" Margin="5" ToolTip="Adjust the volume" Style="{StaticResource ConfigTextBox}" Grid.Row="1" Grid.Column="0"/>
<DockPanel Grid.Row="1" Grid.Column="1">
<ui:TextBlock Text="{Binding Path=VolumeAchievementUnlock, Source={StaticResource Settings}, StringFormat={}{0:P0}}" DockPanel.Dock="Right" TextAlignment="Center" Width="80" VerticalAlignment="Center">
</ui:TextBlock>
<Slider IsSnapToTickEnabled="True" TickFrequency="0.05" TickPlacement="Both" Minimum="0" Maximum="1" Value="{Binding Path=VolumeAchievementUnlock, Source={StaticResource Settings}}" />
</DockPanel>

<TextBlock Text="Challenge Unlock Volume" Margin="5" ToolTip="Adjust the volume" Style="{StaticResource ConfigTextBox}" Grid.Row="2" Grid.Column="0"/>
<DockPanel Grid.Row="2" Grid.Column="1">
<ui:TextBlock Text="{Binding Path=VolumeChallengeUnlock, Source={StaticResource Settings}, StringFormat={}{0:P0}}" DockPanel.Dock="Right" TextAlignment="Center" Width="80" VerticalAlignment="Center">
</ui:TextBlock>
<Slider IsSnapToTickEnabled="True" TickFrequency="0.05" TickPlacement="Both" Minimum="0" Maximum="1" Value="{Binding Path=VolumeChallengeUnlock, Source={StaticResource Settings}}" />
</DockPanel>

<TextBlock Text="Challenge Start Volume" Margin="5" ToolTip="Adjust the volume" Style="{StaticResource ConfigTextBox}" Grid.Row="3" Grid.Column="0"/>
<DockPanel Grid.Row="3" Grid.Column="1">
<ui:TextBlock Text="{Binding Path=VolumeChallengeStart, Source={StaticResource Settings}, StringFormat={}{0:P0}}" DockPanel.Dock="Right" TextAlignment="Center" Width="80" VerticalAlignment="Center">
</ui:TextBlock>
<Slider IsSnapToTickEnabled="True" TickFrequency="0.05" TickPlacement="Both" Minimum="0" Maximum="1" Value="{Binding Path=VolumeChallengeStart, Source={StaticResource Settings}}" />
</DockPanel>

<TextBlock Text="Gacha Unlock Volume" Margin="5" ToolTip="Adjust the volume" Style="{StaticResource ConfigTextBox}" Grid.Row="4" Grid.Column="0"/>
<DockPanel Grid.Row="4" Grid.Column="1">
<ui:TextBlock Text="{Binding Path=VolumeGachaUnlock, Source={StaticResource Settings}, StringFormat={}{0:P0}}" DockPanel.Dock="Right" TextAlignment="Center" Width="80" VerticalAlignment="Center">
</ui:TextBlock>
<Slider IsSnapToTickEnabled="True" TickFrequency="0.05" TickPlacement="Both" Minimum="0" Maximum="1" Value="{Binding Path=VolumeGachaUnlock, Source={StaticResource Settings}}" />
</DockPanel>

<TextBlock Text="Gacha Trial Volume" Margin="5" ToolTip="Adjust the volume" Style="{StaticResource ConfigTextBox}" Grid.Row="5" Grid.Column="0"/>
<DockPanel Grid.Row="5" Grid.Column="1">
<ui:TextBlock Text="{Binding Path=VolumeGachaTrial, Source={StaticResource Settings}, StringFormat={}{0:P0}}" DockPanel.Dock="Right" TextAlignment="Center" Width="80" VerticalAlignment="Center">
</ui:TextBlock>
<Slider IsSnapToTickEnabled="True" TickFrequency="0.05" TickPlacement="Both" Minimum="0" Maximum="1" Value="{Binding Path=VolumeGachaTrial, Source={StaticResource Settings}}" />
</DockPanel>

<TextBlock Text="Gacha Rare Volume" Margin="5" ToolTip="Adjust the volume" Style="{StaticResource ConfigTextBox}" Grid.Row="6" Grid.Column="0"/>
<DockPanel Grid.Row="6" Grid.Column="1">
<ui:TextBlock Text="{Binding Path=VolumeGachaRare, Source={StaticResource Settings}, StringFormat={}{0:P0}}" DockPanel.Dock="Right" TextAlignment="Center" Width="80" VerticalAlignment="Center">
</ui:TextBlock>
<Slider IsSnapToTickEnabled="True" TickFrequency="0.05" TickPlacement="Both" Minimum="0" Maximum="1" Value="{Binding Path=VolumeGachaRare, Source={StaticResource Settings}}" />
</DockPanel>

<TextBlock Text="Hover Volume" Margin="5" ToolTip="Adjust the volume" Style="{StaticResource ConfigTextBox}" Grid.Row="7" Grid.Column="0"/>
<DockPanel Grid.Row="7" Grid.Column="1">
<ui:TextBlock Text="{Binding Path=VolumeHover, Source={StaticResource Settings}, StringFormat={}{0:P0}}" DockPanel.Dock="Right" TextAlignment="Center" Width="80" VerticalAlignment="Center">
</ui:TextBlock>
<Slider IsSnapToTickEnabled="True" TickFrequency="0.05" TickPlacement="Both" Minimum="0" Maximum="1" Value="{Binding Path=VolumeHover, Source={StaticResource Settings}}" />
</DockPanel>

<TextBlock Text="Select Volume" Margin="5" ToolTip="Adjust the volume" Style="{StaticResource ConfigTextBox}" Grid.Row="8" Grid.Column="0"/>
<DockPanel Grid.Row="8" Grid.Column="1">
<ui:TextBlock Text="{Binding Path=VolumeSelect, Source={StaticResource Settings}, StringFormat={}{0:P0}}" DockPanel.Dock="Right" TextAlignment="Center" Width="80" VerticalAlignment="Center">
</ui:TextBlock>
<Slider IsSnapToTickEnabled="True" TickFrequency="0.05" TickPlacement="Both" Minimum="0" Maximum="1" Value="{Binding Path=VolumeSelect, Source={StaticResource Settings}}" />
</DockPanel>
</Grid>
</ScrollViewer>
<customcontrols:MainConfigurationActions Grid.Row="1" Grid.ColumnSpan="1" Loaded="MainConfigurationActions_Loaded" Unloaded="MainConfigurationActions_Unloaded"/>
</Grid>
</TabItem>
<TabItem ToolTip="Player Settings" Background="{StaticResource Mantle}" Foreground="{StaticResource Text}">
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<Image Source="../../Assets/Icons/png/helm.png" Width="32" Height="32"/>
Expand Down
2 changes: 2 additions & 0 deletions MHFZ_Overlay/Views/Windows/ConfigWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ public ConfigWindow(MainWindow mainWindow)
var background7 = @"pack://application:,,,/MHFZ_Overlay;component/Assets/Background/7.png";
var background8 = @"pack://application:,,,/MHFZ_Overlay;component/Assets/Background/8.png";
var background9 = @"pack://application:,,,/MHFZ_Overlay;component/Assets/Background/9.png";
var background10 = @"pack://application:,,,/MHFZ_Overlay;component/Assets/Background/10.png";

// https://stackoverflow.com/questions/30839173/change-background-image-in-wpf-using-c-sharp
this.GeneralContent.Background = new ImageBrush(new BitmapImage(new Uri(background1)));
Expand All @@ -519,6 +520,7 @@ public ConfigWindow(MainWindow mainWindow)
this.MonsterInfoContent.Background = new ImageBrush(new BitmapImage(new Uri(background7)));
this.QuestLogContent.Background = new ImageBrush(new BitmapImage(new Uri(background8)));
this.PlayerContent.Background = new ImageBrush(new BitmapImage(new Uri(background9)));
this.AudioContent.Background = new ImageBrush(new BitmapImage(new Uri(background10)));

// TODO: test this
this.DataContext = this.MainWindow.DataLoader.Model;
Expand Down

0 comments on commit 8ca2272

Please sign in to comment.