Skip to content

Commit

Permalink
[HaCreator] quest editor: exclude chaos update related items from que…
Browse files Browse the repository at this point in the history
…st act and checks (disabled in UI)
  • Loading branch information
lastbattle committed Nov 24, 2024
1 parent 6230de5 commit fca7e4d
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 14 deletions.
107 changes: 93 additions & 14 deletions HaCreator/GUI/Quest/QuestEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

<Window.Resources>
<haSharedLibConverter:BooleanToVisibility2Converter x:Key="booleanToVisibility2Converter"/>
<haSharedLibConverter:MultiBooleanToVisibility2Converter x:Key="multiBooleanToVisibility2Converter"/>
<converter:PetSkillFlagConverter x:Key="petSkillFlagConverter"/>
<converter:QuestIdToQuestNameConverter x:Key="questIdToQuestNameConverter"/>
<converter:NpcIdToNpcNameConverter x:Key="npcIdToNpcNameConverter"/>
Expand Down Expand Up @@ -417,57 +418,93 @@

<!-- Traits-->
<DataTemplate x:Key="ActTraitSenseTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(sense) reward amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="ActTraitWillTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(will) reward amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="ActTraitInsightTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(insight) reward amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="ActTraitCharismaTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(charisma) reward amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="ActTraitCharmTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(charm) reward amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="ActTraitCraftTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(craft) reward amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>

Expand Down Expand Up @@ -1126,8 +1163,13 @@
</ComboBox>

<!-- potential-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"
Visibility="{Binding IsEquip, Converter={StaticResource booleanToVisibility2Converter}}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<StackPanel.Visibility>
<MultiBinding Converter="{StaticResource multiBooleanToVisibility2Converter}">
<Binding Path="IsEquip"/>
</MultiBinding>
</StackPanel.Visibility>

<TextBlock Text="Potential:" Margin="20,0,5,0" MaxWidth="100" VerticalAlignment="Center"
/>
<ComboBox x:Name="comboBox_potentialGrade"
Expand Down Expand Up @@ -1451,57 +1493,93 @@

<!-- Traits-->
<DataTemplate x:Key="CheckTraitSenseTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(sense) required amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="CheckTraitWillTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(will) required amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="CheckTraitInsightTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(insight) required amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="CheckTraitCharismaTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(charisma) required amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="CheckTraitCharmTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(charm) required amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="CheckTraitCraftTemplate">
<StackPanel>
<StackPanel IsEnabled="{Binding IsPostBBDataWzFormat}">
<StackPanel Orientation="Horizontal">
<Image Height="20" Source="pack://application:,,,/HaCreator;component/Images/Quest/QuestIcon.11.0.png" Stretch="Uniform" HorizontalAlignment="Left"/>
<TextBlock Text="(craft) required amount:" Margin="4,0,0,0"/>
</StackPanel>
<TextBox Text="{Binding Amount, UpdateSourceTrigger=PropertyChanged}" InputScope="Number" Margin="0,2"/>

<TextBlock Text="This is not available in the pre-bigbang version of MapleStory."
FontStyle="Italic"
Margin="10,0,0,0"
Visibility="{Binding IsPreBBDataWzFormat, Converter={StaticResource booleanToVisibility2Converter}}"
/>
</StackPanel>
</DataTemplate>
<!-- lvMin -->
Expand Down Expand Up @@ -2814,6 +2892,7 @@

<DataGrid x:Name="DataGrid_checkStartQuest" Grid.Row="1"
ItemsSource="{Binding SelectedQuest.CheckStartInfo}"
IsReadOnly="False"
AutoGenerateColumns="False" CanUserAddRows="True" CanUserDeleteRows="True">
<DataGrid.Columns>
<!-- Conversation Type Column -->
Expand Down
19 changes: 19 additions & 0 deletions HaCreator/GUI/Quest/QuestEditorActInfoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,25 @@ private set
}
}

#region Misc
/// <summary>
/// Before big-bang update
/// </summary>
public bool IsPreBBDataWzFormat
{
get { return Program.WzManager.IsPreBBDataWzFormat; }
private set { }
}
/// <summary>
/// After big-bang update
/// </summary>
public bool IsPostBBDataWzFormat
{
get { return !Program.WzManager.IsPreBBDataWzFormat; }
private set { }
}
#endregion

#region Events
/// <summary>
/// On act conversation collection changed
Expand Down
19 changes: 19 additions & 0 deletions HaCreator/GUI/Quest/QuestEditorActInfoRewardModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,25 @@ public bool IsEquip
private set { }
}

#region Misc
/// <summary>
/// Before big-bang update
/// </summary>
public bool IsPreBBDataWzFormat
{
get { return Program.WzManager.IsPreBBDataWzFormat; }
private set { }
}
/// <summary>
/// After big-bang update
/// </summary>
public bool IsPostBBDataWzFormat
{
get { return !Program.WzManager.IsPreBBDataWzFormat; }
private set { }
}
#endregion

#region Property Changed Event
public event PropertyChangedEventHandler PropertyChanged;

Expand Down
41 changes: 41 additions & 0 deletions HaSharedLibrary/Converter/MultiBooleanToVisibility2Converter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows;

namespace HaSharedLibrary.Converter
{
/// <summary>
/// All must be true to be visible.
/// </summary>
public class MultiBooleanToVisibility2Converter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (values == null || values.Any(v => v == DependencyProperty.UnsetValue))
return Visibility.Collapsed;

// Check if all values are boolean and true
bool visible = values.All(v => v is bool && (bool)v);

// Invert logic if parameter is provided and true
if (parameter is bool invertLogic && invertLogic)
{
/*<MultiBinding.ConverterParameter>
<sys:Boolean>true</sys:Boolean>
</MultiBinding.ConverterParameter>*/
visible = !visible;
}

return visible ? Visibility.Visible : Visibility.Collapsed;
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
41 changes: 41 additions & 0 deletions HaSharedLibrary/Converter/MultiBooleanToVisibilityConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows;

namespace HaSharedLibrary.Converter
{
/// <summary>
/// All must be false to be visible.
/// </summary>
public class MultiBooleanToVisibilityConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (values == null || values.Any(v => v == DependencyProperty.UnsetValue))
return Visibility.Collapsed;

// Check if all values are boolean and true
bool visible = values.All(v => v is bool && (bool)v);

// Invert logic if parameter is provided and true
if (parameter is bool invertLogic && invertLogic)
{
/*<MultiBinding.ConverterParameter>
* <sys:Boolean>true</sys:Boolean>
* </MultiBinding.ConverterParameter>*/
visible = !visible;
}

return visible ? Visibility.Collapsed : Visibility.Visible;
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

0 comments on commit fca7e4d

Please sign in to comment.