Skip to content

Commit 4989c24

Browse files
committed
[UX] Configuration check-up list added in about page for newcomers
1 parent 7f4cdd4 commit 4989c24

File tree

5 files changed

+160
-54
lines changed

5 files changed

+160
-54
lines changed

WoWDatabaseEditor.Common/WDE.Common/DBC/IDbcStore.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace WDE.Common.DBC
66
[UniqueProvider]
77
public interface IDbcStore
88
{
9+
bool IsConfigured { get; }
910
Dictionary<long, string> AreaTriggerStore { get; }
1011
Dictionary<long, string> SkillStore { get; }
1112
Dictionary<long, string> LanguageStore { get; }

WoWDatabaseEditor.Common/WDE.DbcStore/DbcStore.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public DbcStore(IParameterFactory parameterFactory, ITaskRunner taskRunner, IDbc
3636
Load();
3737
}
3838

39+
public bool IsConfigured { get; private set; }
3940
public Dictionary<long, string> AreaTriggerStore { get; internal set; } = new();
4041
public Dictionary<long, string> FactionStore { get; internal set; } = new();
4142
public Dictionary<long, string> SpellStore { get; internal set; } = new();
@@ -82,6 +83,7 @@ internal void Load()
8283
if (!Directory.Exists(dbcSettingsProvider.GetSettings().Path))
8384
return;
8485

86+
IsConfigured = true;
8587
taskRunner.ScheduleTask(new DbcLoadTask(parameterFactory, dbcSettingsProvider, this));
8688
}
8789

WoWDatabaseEditor/ViewModels/AboutViewModel.cs

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
using System;
2+
using System.Collections.ObjectModel;
23
using System.ComponentModel;
4+
using System.Linq;
35
using System.Windows.Input;
6+
using Prism.Commands;
7+
using WDE.Common.CoreVersion;
8+
using WDE.Common.Database;
9+
using WDE.Common.DBC;
410
using WDE.Common.History;
511
using WDE.Common.Managers;
612
using WDE.Common.Services;
713
using WDE.Module.Attributes;
14+
using WoWDatabaseEditorCore.CoreVersion;
815

916
namespace WoWDatabaseEditorCore.ViewModels
1017
{
@@ -13,11 +20,39 @@ public class AboutViewModel : IDocument
1320
{
1421
private readonly IApplicationVersion applicationVersion;
1522

16-
public AboutViewModel(IApplicationVersion applicationVersion)
23+
public AboutViewModel(IApplicationVersion applicationVersion,
24+
IDatabaseProvider databaseProvider,
25+
IDbcStore dbcStore,
26+
IConfigureService settings,
27+
ICurrentCoreVersion coreVersion,
28+
IRemoteConnectorService remoteConnectorService)
1729
{
1830
this.applicationVersion = applicationVersion;
31+
32+
ConfigurationChecks.Add(new ConfigurationCheckup(true,
33+
"Core version compatibility mode",
34+
"WoW Database Editor supports multiple world of warcraft server cores. In order to achieve maximum compatibility, choose version that matches best.\nYou are using: " + coreVersion.Current.FriendlyName + " compatibility mode now."));
35+
36+
ConfigurationChecks.Add(new ConfigurationCheckup(dbcStore.IsConfigured,
37+
"DBC settings",
38+
"DBC is DataBaseClient files provided with WoW client. Those contain a lot of useful stuff for scripting like spells data. For maximum features you have to provide DBC files path. All WoW servers require those files to work so if you have working core, you must have DBC files already."));
39+
40+
ConfigurationChecks.Add(new ConfigurationCheckup(databaseProvider.IsConnected,
41+
"Database connection",
42+
"WoW Database Editor is database editor by design. It stores all data and loads things from wow database. Therefore to activate all features you have to provide wow compatible database connection settings."));
43+
44+
ConfigurationChecks.Add(new ConfigurationCheckup(remoteConnectorService.IsConnected,
45+
"Remote SOAP connection",
46+
"WDE can invoke reload commands for you for faster work. To enable that, you have to enable SOAP connection in your worldserver configuration and provide details in the settings."));
47+
48+
AllConfigured = ConfigurationChecks.All(s => s.Fulfilled);
49+
50+
OpenSettingsCommand = new DelegateCommand(settings.ShowSettings);
1951
}
2052

53+
public ICommand OpenSettingsCommand { get; }
54+
public bool AllConfigured { get; }
55+
public ObservableCollection<ConfigurationCheckup> ConfigurationChecks { get; } = new();
2156
public int BuildVersion => applicationVersion.BuildVersion;
2257
public string Branch => applicationVersion.Branch;
2358
public string CommitHash => applicationVersion.CommitHash;
@@ -40,6 +75,20 @@ public AboutViewModel(IApplicationVersion applicationVersion)
4075
public void Dispose()
4176
{
4277
}
78+
79+
public class ConfigurationCheckup
80+
{
81+
public bool Fulfilled { get; }
82+
public string Title { get; }
83+
public string Description { get; }
84+
85+
public ConfigurationCheckup(bool fulfilled, string title, string description)
86+
{
87+
Fulfilled = fulfilled;
88+
Title = title;
89+
Description = description;
90+
}
91+
}
4392
}
4493

4594
public class DisabledCommand : ICommand
Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,54 @@
11
<UserControl x:Class="WoWDatabaseEditorCore.Avalonia.Views.AboutView"
22
xmlns="https://github.com/avaloniaui"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
4-
<DockPanel Margin="20" LastChildFill="True">
5-
<TextBlock DockPanel.Dock="Bottom" IsVisible="{Binding VersionKnown}" Text="{Binding ReleaseData}" TextWrapping="WrapWithOverflow" />
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:converters="clr-namespace:WDE.Common.Avalonia.Converters;assembly=WDE.Common.Avalonia">
5+
<UserControl.Resources>
6+
<converters:InverseBoolConverter x:Key="InversedBoolConverter" />
7+
</UserControl.Resources>
8+
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
9+
<DockPanel Margin="20" LastChildFill="True">
10+
<TextBlock DockPanel.Dock="Bottom" IsVisible="{Binding VersionKnown}" Text="{Binding ReleaseData}" TextWrapping="WrapWithOverflow" />
611
<StackPanel>
7-
<Border BorderThickness="0,0,0,2" BorderBrush="#FF5FA2DA">
8-
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
9-
<Image Source="../Icon.png" Width="56" Height="56" />
10-
<TextBlock VerticalAlignment="Bottom" FontSize="34" FontFamily="Segoe UI Light" TextWrapping="WrapWithOverflow">World of Warcraft Database Editor</TextBlock>
11-
</StackPanel>
12-
</Border>
13-
<WrapPanel Orientation="Horizontal" Margin="0, 10, 0, 0">
14-
<TextBlock FontWeight="Bold" Text="WoW Database Editor" />
15-
<TextBlock TextWrapping="WrapWithOverflow" Text=" is an application used to create scripts (behaviours) in TrinityCore based servers." />
16-
</WrapPanel>
17-
<WrapPanel Orientation="Horizontal" Margin="0, 10, 0, 0">
18-
<TextBlock TextWrapping="WrapWithOverflow" Text="To start work, add new &quot;file&quot; to the solution - File -&gt; Load. To edit script, double click on selected item in Solution Explorer." />
19-
</WrapPanel>
20-
<WrapPanel Orientation="Horizontal" Margin="0, 10, 0, 0">
21-
<TextBlock TextWrapping="WrapWithOverflow" Text="Items in Solution Explorer are saved automatically, but scripts themselves are not. Remember to save them (export to database)" />
22-
</WrapPanel>
23-
<WrapPanel Orientation="Horizontal" Margin="0, 10, 0, 0">
24-
<TextBlock TextWrapping="WrapWithOverflow" Text="Database is not required, but in that case features are limited. It is database editor by design." />
25-
</WrapPanel>
26-
</StackPanel>
27-
</DockPanel>
12+
<Border BorderThickness="0,0,0,2" BorderBrush="#FF5FA2DA">
13+
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
14+
<Image Source="../Icon.png" Width="56" Height="56" />
15+
<TextBlock VerticalAlignment="Bottom" FontSize="34" FontFamily="Segoe UI Light" TextWrapping="WrapWithOverflow">World of Warcraft Database Editor</TextBlock>
16+
</StackPanel>
17+
</Border>
18+
<WrapPanel Orientation="Horizontal" Margin="0, 10, 0, 0">
19+
<TextBlock FontWeight="Bold" Text="WoW Database Editor" />
20+
<TextBlock TextWrapping="WrapWithOverflow" Text=" is an application used to create scripts (behaviours) in TrinityCore based servers." />
21+
</WrapPanel>
22+
<WrapPanel Orientation="Horizontal" Margin="0, 10, 0, 0">
23+
<TextBlock TextWrapping="WrapWithOverflow" Text="To start work, add new &quot;file&quot; to the solution - File -&gt; Add. To edit script, double click on selected item in Solution Explorer." />
24+
</WrapPanel>
25+
<WrapPanel Orientation="Horizontal" Margin="0, 10, 0, 0">
26+
<TextBlock TextWrapping="WrapWithOverflow" Text="Items in Solution Explorer are saved automatically, but scripts themselves are not. Remember to save them (export to database)" />
27+
</WrapPanel>
28+
<WrapPanel Orientation="Horizontal" Margin="0, 10, 0, 0">
29+
<TextBlock TextWrapping="WrapWithOverflow" Text="Database is not required, but in that case features are limited. It is database editor by design." />
30+
</WrapPanel>
31+
32+
<Border Margin="0,35,0,0" BorderThickness="0,0,0,2" BorderBrush="#FF5FA2DA">
33+
<TextBlock FontSize="26">Configuration check-up list</TextBlock>
34+
</Border>
35+
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">In order to enable all features, you have to configure the editor first.</TextBlock>
36+
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow" IsVisible="{Binding AllConfigured}">Congratulations! You have everything configured properly!</TextBlock>
37+
<ItemsControl Items="{Binding ConfigurationChecks}">
38+
<ItemsControl.ItemTemplate>
39+
<DataTemplate>
40+
<DockPanel LastChildFill="True" Margin="0,10,0,0">
41+
<CheckBox MinWidth="0" VerticalAlignment="Center" IsChecked="{Binding Fulfilled, Mode=OneWay}" IsHitTestVisible="False" />
42+
<StackPanel Orientation="Vertical">
43+
<TextBlock FontWeight="Bold" Text="{Binding Title}"/>
44+
<TextBlock TextWrapping="WrapWithOverflow" Text="{Binding Description}" />
45+
</StackPanel>
46+
</DockPanel>
47+
</DataTemplate>
48+
</ItemsControl.ItemTemplate>
49+
</ItemsControl>
50+
<Button Margin="0,10,0,0" IsVisible="{Binding AllConfigured, Converter={StaticResource InversedBoolConverter}}" Command="{Binding OpenSettingsCommand}">Open settings to configure</Button>
51+
</StackPanel>
52+
</DockPanel>
53+
</ScrollViewer>
2854
</UserControl>
Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,62 @@
11
<UserControl x:Class="WoWDatabaseEditorCore.WPF.Views.AboutView"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:viewHelpers="clr-namespace:WDE.Common.WPF.ViewHelpers;assembly=WDE.Common.WPF"
45
Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}">
5-
<Grid Margin="20">
6-
<StackPanel>
7-
<Border BorderThickness="0,0,0,2" BorderBrush="#FF5FA2DA">
8-
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
9-
<Image Source="/Icon.ico" Width="56" Height="56" />
10-
<TextBlock VerticalAlignment="Bottom" FontSize="34" FontFamily="Segoe UI Light" TextWrapping="WrapWithOverflow">World of Warcraft Database Editor</TextBlock>
11-
</StackPanel>
12-
</Border>
13-
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">
14-
<Run FontWeight="Bold" Text="WoW Database Editor" /><Run Text=" " />
15-
<Run Text="is an application used to create scripts (behaviours) in TrinityCore based servers." />
16-
</TextBlock>
17-
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">
18-
<Run Text="To start work, add new &quot;file&quot; to the solution " />
19-
<Run Text="- File -&gt; Load. " />
20-
<Run Text="To edit script, double click on selected item in Solution Explorer." />
21-
</TextBlock>
22-
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">
23-
<Run
24-
Text="Items in Solution Explorer are saved automatically, but scripts themselves are not. Remember to save them " />
25-
<Run Text="(" /><Run Text="export to database" /><Run Text=")." />
26-
</TextBlock>
27-
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">
28-
<Run Text="Database is not required" /><Run Text=", " /><Run Text="but in that" />
29-
<Run Text=" case features are limited." /><Run Text=" " />
30-
<Run Text="It is database editor by design" /><Run Text="." />
31-
</TextBlock>
32-
</StackPanel>
33-
</Grid>
6+
<UserControl.Resources>
7+
<viewHelpers:BooleanToVisibilityConverter WhenTrue="Visible" WhenFalse="Collapsed" x:Key="BooleanToVisibilityConverter"/>
8+
<viewHelpers:BooleanToVisibilityConverter WhenTrue="Collapsed" WhenFalse="Visible" x:Key="InverseBooleanToVisibilityConverter"/>
9+
</UserControl.Resources>
10+
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
11+
<DockPanel Margin="20" LastChildFill="True">
12+
<TextBlock DockPanel.Dock="Bottom" Visibility="{Binding VersionKnown, Converter={StaticResource BooleanToVisibilityConverter}}" Text="{Binding ReleaseData}" TextWrapping="WrapWithOverflow" />
13+
<StackPanel>
14+
<Border BorderThickness="0,0,0,2" BorderBrush="#FF5FA2DA">
15+
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
16+
<Image Source="/Icon.ico" Width="56" Height="56" />
17+
<TextBlock VerticalAlignment="Bottom" FontSize="34" FontFamily="Segoe UI Light" TextWrapping="WrapWithOverflow">World of Warcraft Database Editor</TextBlock>
18+
</StackPanel>
19+
</Border>
20+
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">
21+
<Run FontWeight="Bold" Text="WoW Database Editor" /><Run Text=" " />
22+
<Run Text="is an application used to create scripts (behaviours) in TrinityCore based servers." />
23+
</TextBlock>
24+
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">
25+
<Run Text="To start work, add new &quot;file&quot; to the solution " />
26+
<Run Text="- File -&gt; Load. " />
27+
<Run Text="To edit script, double click on selected item in Solution Explorer." />
28+
</TextBlock>
29+
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">
30+
<Run
31+
Text="Items in Solution Explorer are saved automatically, but scripts themselves are not. Remember to save them " />
32+
<Run Text="(" /><Run Text="export to database" /><Run Text=")." />
33+
</TextBlock>
34+
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">
35+
<Run Text="Database is not required" /><Run Text=", " /><Run Text="but in that" />
36+
<Run Text=" case features are limited." /><Run Text=" " />
37+
<Run Text="It is database editor by design" /><Run Text="." />
38+
</TextBlock>
39+
40+
<Border Margin="0,35,0,0" BorderThickness="0,0,0,2" BorderBrush="#FF5FA2DA">
41+
<TextBlock FontSize="26">Configuration check-up list</TextBlock>
42+
</Border>
43+
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow">In order to enable all features, you have to configure the editor first.</TextBlock>
44+
<TextBlock Margin="0,10,0,0" TextWrapping="WrapWithOverflow" Visibility="{Binding AllConfigured, Converter={StaticResource BooleanToVisibilityConverter}}">Congratulations! You have everything configured properly!</TextBlock>
45+
<ItemsControl ItemsSource="{Binding ConfigurationChecks}">
46+
<ItemsControl.ItemTemplate>
47+
<DataTemplate>
48+
<DockPanel LastChildFill="True" Margin="0,10,0,0">
49+
<CheckBox MinWidth="0" VerticalAlignment="Center" IsChecked="{Binding Fulfilled, Mode=OneWay}" IsHitTestVisible="False" />
50+
<StackPanel Orientation="Vertical" Margin="5,0,0,0">
51+
<TextBlock FontWeight="Bold" Text="{Binding Title}"/>
52+
<TextBlock TextWrapping="WrapWithOverflow" Text="{Binding Description}" />
53+
</StackPanel>
54+
</DockPanel>
55+
</DataTemplate>
56+
</ItemsControl.ItemTemplate>
57+
</ItemsControl>
58+
<Button Margin="0,10,0,0" Visibility="{Binding AllConfigured, Converter={StaticResource InverseBooleanToVisibilityConverter}}" Command="{Binding OpenSettingsCommand}">Open settings to configure</Button>
59+
</StackPanel>
60+
</DockPanel>
61+
</ScrollViewer>
3462
</UserControl>

0 commit comments

Comments
 (0)