Skip to content

Commit

Permalink
Remove ProfileSettingsToSpace and fix spacing on build type.
Browse files Browse the repository at this point in the history
  • Loading branch information
num0005 committed Jul 6, 2024
1 parent d75d5a2 commit 85b0b88
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 157 deletions.
105 changes: 14 additions & 91 deletions Launcher/PathSettings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<Window.Resources>
<toolkit_local:ProfileSettingsVisibility x:Key="ProfileSettingsVisibility" />
<toolkit_local:ProfileSettingsToSpace x:Key="ProfileSettingsToSpace" />
<toolkit_local:ProfiletoContent x:Key="ProfiletoContent" />
<ObjectDataProvider x:Key="built_type_enum" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
Expand Down Expand Up @@ -62,27 +61,9 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="8"/>
<RowDefinition Height="Auto"/>
<RowDefinition>
<RowDefinition.Height>
<MultiBinding Converter="{StaticResource ProfileSettingsToSpace}">
<Binding ElementName="is_mcc" Path="IsChecked" />
<Binding ElementName="gen_type" Path="SelectedIndex" />
<Binding ElementName="community_tools" Path="IsChecked" />
<Binding Source="3" />
</MultiBinding>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="Auto"/>
<RowDefinition>
<RowDefinition.Height>
<MultiBinding Converter="{StaticResource ProfileSettingsToSpace}">
<Binding ElementName="is_mcc" Path="IsChecked" />
<Binding ElementName="gen_type" Path="SelectedIndex" />
<Binding ElementName="community_tools" Path="IsChecked" />
<Binding Source="0" />
</MultiBinding>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="8"/>
Expand All @@ -103,30 +84,12 @@
<TextBox Grid.Column="1" Name="profile_name" BorderBrush="{StaticResource brushWatermarkBorder}" Foreground="{DynamicResource TextColor}" VerticalAlignment="Center" Background="Transparent" Height="26" TextChanged="profile_dataChangedEventHandler" CaretBrush="{DynamicResource TextColor}"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="4" x:Name="hek_box" Header="HEK Paths" IsEnabled="False" ToolTip="Paths to the HEK tools.">
<GroupBox Grid.Row="4" x:Name="hek_box" Header="HEK Paths" IsEnabled="False" ToolTip="Paths to the HEK tools." Margin="0,4,0,4">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition>
<RowDefinition.Height>
<MultiBinding Converter="{StaticResource ProfileSettingsToSpace}">
<Binding ElementName="is_mcc" Path="IsChecked" />
<Binding ElementName="gen_type" Path="SelectedIndex" />
<Binding ElementName="community_tools" Path="IsChecked" />
<Binding Source="5" />
</MultiBinding>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition>
<RowDefinition.Height>
<MultiBinding Converter="{StaticResource ProfileSettingsToSpace}">
<Binding ElementName="is_mcc" Path="IsChecked" />
<Binding ElementName="gen_type" Path="SelectedIndex" />
<Binding ElementName="community_tools" Path="IsChecked" />
<Binding Source="5" />
</MultiBinding>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="8"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="8"/>
Expand Down Expand Up @@ -234,7 +197,7 @@
</GroupBox>
</Grid>
</GroupBox>
<GroupBox Grid.Row="6" x:Name="asset_dir" Header="Asset Paths" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsEnabled="False">
<GroupBox Grid.Row="6" x:Name="asset_dir" Header="Asset Paths" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsEnabled="False" Margin="0,4,0,4">
<GroupBox.Visibility>
<MultiBinding Converter="{StaticResource ProfileSettingsVisibility}">
<Binding ElementName="is_mcc" Path="IsChecked" />
Expand Down Expand Up @@ -317,7 +280,7 @@
</GroupBox>
</Grid>
</GroupBox>
<GroupBox Grid.Row="8" x:Name="h2codez_update_groupbox" Header="H2Codez Update" IsEnabled="False">
<GroupBox Grid.Row="8" x:Name="h2codez_update_groupbox" Header="H2Codez Update" IsEnabled="False" Margin="0,4,0,4">
<GroupBox.Visibility>
<MultiBinding Converter="{StaticResource ProfileSettingsVisibility}">
<Binding ElementName="is_mcc" Path="IsChecked" />
Expand All @@ -336,7 +299,7 @@
<Button x:Name="update_h2codez" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="4" MinWidth="75" MinHeight="26" Click="update_h2codez_Click" ToolTip="No regrets.">Update!</Button>
</Grid>
</GroupBox>
<GroupBox Grid.Row="9" x:Name="prt_sim_update_groupbox" Header="PRT Simulator Update" IsEnabled="True">
<GroupBox Grid.Row="9" x:Name="prt_sim_update_groupbox" Header="PRT Simulator Update" IsEnabled="True" Margin="0,4,0,4">
<GroupBox.Visibility>
<MultiBinding Converter="{StaticResource ProfileSettingsVisibility}">
<Binding ElementName="is_mcc" Path="IsChecked" />
Expand All @@ -355,7 +318,7 @@
<Button x:Name="update_prt" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="4" MinWidth="75" MinHeight="26" ToolTip="Prophet." Click="update_prt_Click">Update!</Button>
</Grid>
</GroupBox>
<Grid Grid.Row="11">
<Grid Grid.Row="11" Margin="0,4,0,8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/>
Expand All @@ -375,7 +338,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
Expand All @@ -386,53 +349,13 @@
<Grid Grid.Column="1" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition>
<RowDefinition.Height>
<MultiBinding Converter="{StaticResource ProfileSettingsToSpace}">
<Binding ElementName="is_mcc" Path="IsChecked" />
<Binding ElementName="gen_type" Path="SelectedIndex" />
<Binding ElementName="community_tools" Path="IsChecked" />
<Binding Source="0" />
</MultiBinding>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="Auto"/>
<RowDefinition>
<RowDefinition.Height>
<MultiBinding Converter="{StaticResource ProfileSettingsToSpace}">
<Binding ElementName="is_mcc" Path="IsChecked" />
<Binding ElementName="gen_type" Path="SelectedIndex" />
<Binding ElementName="community_tools" Path="IsChecked" />
<Binding Source="1" />
</MultiBinding>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="Auto"/>
<RowDefinition>
<RowDefinition.Height>
<MultiBinding Converter="{StaticResource ProfileSettingsToSpace}">
<Binding ElementName="is_mcc" Path="IsChecked" />
<Binding ElementName="gen_type" Path="SelectedIndex" />
<Binding ElementName="community_tools" Path="IsChecked" />
<Binding Source="2" />
</MultiBinding>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="Auto"/>
<RowDefinition>
<RowDefinition.Height>
<MultiBinding Converter="{StaticResource ProfileSettingsToSpace}">
<Binding ElementName="is_mcc" Path="IsChecked" />
<Binding ElementName="gen_type" Path="SelectedIndex" />
<Binding ElementName="community_tools" Path="IsChecked" />
<Binding Source="2" />
</MultiBinding>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<CheckBox x:Name="is_mcc" Foreground="{DynamicResource TextColor}" Grid.Row="0" ToolTip="{Binding SelectedIndex, Converter={StaticResource ProfiletoContent}, ConverterParameter=8, ElementName=gen_type}" Content="{Binding SelectedIndex, Converter={StaticResource ProfiletoContent}, ConverterParameter=7, ElementName=gen_type}" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="22" Click="profile_data_Click" />
<CheckBox Grid.Row="2" Foreground="{DynamicResource TextColor}" x:Name="community_tools" Content="Community Extensions" HorizontalAlignment="Stretch" Height="22" VerticalAlignment="Bottom" Click="profile_data_Click" ToolTip="Are community extensions used? (H2Codez, OpenSauce, etc)">
<CheckBox Grid.Row="1" Foreground="{DynamicResource TextColor}" x:Name="community_tools" Content="Community Extensions" HorizontalAlignment="Stretch" Height="22" VerticalAlignment="Bottom" Click="profile_data_Click" ToolTip="Are community extensions used? (H2Codez, OpenSauce, etc)">
<CheckBox.Visibility>
<MultiBinding Converter="{StaticResource ProfileSettingsVisibility}">
<Binding ElementName="is_mcc" Path="IsChecked" />
Expand All @@ -442,7 +365,7 @@
</MultiBinding>
</CheckBox.Visibility>
</CheckBox>
<CheckBox Grid.Row="4" Foreground="{DynamicResource TextColor}" x:Name="verbose" Content="Verbose Tool Output" HorizontalAlignment="Stretch" Height="22" VerticalAlignment="Bottom" Click="profile_data_Click" ToolTip="Include more tool output.">
<CheckBox Grid.Row="2" Foreground="{DynamicResource TextColor}" x:Name="verbose" Content="Verbose Tool Output" HorizontalAlignment="Stretch" Height="22" VerticalAlignment="Bottom" Click="profile_data_Click" ToolTip="Include more tool output.">
<CheckBox.Visibility>
<MultiBinding Converter="{StaticResource ProfileSettingsVisibility}">
<Binding ElementName="is_mcc" Path="IsChecked" />
Expand All @@ -452,7 +375,7 @@
</MultiBinding>
</CheckBox.Visibility>
</CheckBox>
<CheckBox Grid.Row="6" Foreground="{DynamicResource TextColor}" x:Name="expert_mode" Content="Expert Mode" HorizontalAlignment="Stretch" Height="22" VerticalAlignment="Bottom" Click="profile_data_Click" ToolTip="Disables saftey checks for some commands.&#x0a;An example is allowing animation commands to import CE verion range files. You're on your own beyond this point.">
<CheckBox Grid.Row="3" Foreground="{DynamicResource TextColor}" x:Name="expert_mode" Content="Expert Mode" HorizontalAlignment="Stretch" Height="22" VerticalAlignment="Bottom" Click="profile_data_Click" ToolTip="Disables saftey checks for some commands.&#x0a;An example is allowing animation commands to import CE verion range files. You're on your own beyond this point.">
<CheckBox.Visibility>
<MultiBinding Converter="{StaticResource ProfileSettingsVisibility}">
<Binding ElementName="is_mcc" Path="IsChecked" />
Expand All @@ -462,7 +385,7 @@
</MultiBinding>
</CheckBox.Visibility>
</CheckBox>
<CheckBox Grid.Row="8" Foreground="{DynamicResource TextColor}" x:Name="batch" Content="Batch" HorizontalAlignment="Stretch" Height="22" VerticalAlignment="Bottom" Click="profile_data_Click" ToolTip="Disables lightmap progress updates and reduces build-cache-file output.">
<CheckBox Grid.Row="4" Foreground="{DynamicResource TextColor}" x:Name="batch" Content="Batch" HorizontalAlignment="Stretch" Height="22" VerticalAlignment="Bottom" Click="profile_data_Click" ToolTip="Disables lightmap progress updates and reduces build-cache-file output.">
<CheckBox.Visibility>
<MultiBinding Converter="{StaticResource ProfileSettingsVisibility}">
<Binding ElementName="is_mcc" Path="IsChecked" />
Expand Down
66 changes: 0 additions & 66 deletions Launcher/UIHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -721,72 +721,6 @@ public override object Convert(object[] values, Type targetType, object paramete
}
}

public class ProfileSettingsToSpace : OneWayMultiValueConverter
{
public override object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var grid = new GridLength(0);
bool isMCC = (bool)values[0];
int gen_type_selection = (int)values[1];
bool community_selection = (bool)values[2];
string parameter_workaround = (string)values[3];
if (ToolkitProfiles.SettingsList.Count > 0)
{
if (parameter_workaround is string && Int32.Parse(parameter_workaround as string) == 0)
{
//Check if the build type and gentype are set to a standalone Halo 1 or Halo 2 profile for community extensions
if (!isMCC)
if (gen_type_selection == 0 || gen_type_selection == 1)
grid = new GridLength(8);
}
else if (parameter_workaround is string && Int32.Parse(parameter_workaround as string) == 1)
{
//Check if the build type and gentype are set to an MCC Halo 1 or Halo 2 profile for the verbose flag
if (isMCC)
if (gen_type_selection == 0 || gen_type_selection == 1)
grid = new GridLength(8);
}
else if (parameter_workaround is string && Int32.Parse(parameter_workaround as string) == 2)
{
//Check if the build type and gentype are set to an MCC Halo 2 profile for the expert and batch flag
if (isMCC && gen_type_selection == 1)
grid = new GridLength(8);
}
else if (parameter_workaround is string && Int32.Parse(parameter_workaround as string) == 3)
{
//Check if the build type is MCC Halo 2 profile for the asset directory
if (isMCC && gen_type_selection <= 1)
grid = new GridLength(8);
}
else if (parameter_workaround is string && Int32.Parse(parameter_workaround as string) == 4)
{
//Check if the build type is standalone Halo 2 community profile for H2Codez updates
if (!isMCC && gen_type_selection == 1 && community_selection)
grid = new GridLength(8);
}
else if (parameter_workaround is string && Int32.Parse(parameter_workaround as string) == 5)
{
//Check if the build type is set to a MCC and gentype is not Halo CE or is Halo 3 and above
if (isMCC && gen_type_selection != 0 || gen_type_selection >= 2)
grid = new GridLength(1, (double)GridUnitType.Auto);
}
}
else
{
if (parameter_workaround is string && Int32.Parse(parameter_workaround as string) == 5)
{
grid = new GridLength(1, (double)GridUnitType.Auto);
}
else
{
//Either we're in desinger or there are no profiles. Reveal ourselves either way.
grid = new GridLength(8);
}
}
return grid;
}
}

public class LightmapConfigModifier : OneWayMultiValueConverter
{
public override object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Expand Down

0 comments on commit 85b0b88

Please sign in to comment.