-
Notifications
You must be signed in to change notification settings - Fork 1
/
ProjectSelectorWindow.xaml.cs
68 lines (61 loc) · 1.71 KB
/
ProjectSelectorWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Imperial_Commander_Editor;
namespace Saga_Translator_V2
{
/// <summary>
/// Interaction logic for ProjectSelectorWindow.xaml
/// </summary>
public partial class ProjectSelectorWindow : Window
{
public ProjectListData translatorData { get; set; }
public ProjectSelectorWindow()
{
InitializeComponent();
DataContext = translatorData = new();
FileManager.CreateBaseDirectory();
Utils.InitUtils();//load json data
}
private void Window_MouseDown( object sender, MouseButtonEventArgs e )
{
if ( e.LeftButton == MouseButtonState.Pressed )
DragMove();
}
private void cancelButton_Click( object sender, RoutedEventArgs e )
{
Close();
}
private void projectButton_Click( object sender, RoutedEventArgs e )
{
var item = (sender as Button).DataContext as ProjectListItem;
switch ( item.translationType )
{
//single shots
case TranslationType.UI:
case TranslationType.BonusEffects:
case TranslationType.EnemyInstructions:
case TranslationType.CampaignItems:
case TranslationType.CampaignRewards:
case TranslationType.CampaignSkills:
case TranslationType.HelpOverlays:
var dlg = new MainWindow( item.translationType );
dlg.Show();
Close();
break;
//these use a combobox
case TranslationType.CampaignInfo:
case TranslationType.DeploymentCardText:
case TranslationType.MissionInfoRules:
case TranslationType.MissionCardText:
case TranslationType.Mission:
case TranslationType.Tutorials:
var ci = new SelectorDialog( item.translationType );
ci.ShowDialog();
if ( ci.canClose )
Close();
break;
}
}
}
}