1515using System . Windows . Media . Imaging ;
1616using System . Windows . Navigation ;
1717using System . Windows . Shapes ;
18+ using ShortcutDestinations = thcrap_configure_v3 . GlobalConfig . ShortcutDestinations ;
1819
1920namespace thcrap_configure_v3
2021{
@@ -42,12 +43,18 @@ public void Enter()
4243 if ( config == null )
4344 {
4445 config = new GlobalConfig ( ) ;
45- GlobalConfig . ShortcutDestinations dest = config . default_shortcut_destinations ;
46+ ShortcutDestinations dest = config . default_shortcut_destinations ;
4647
47- checkboxDesktop . IsChecked = dest . HasFlag ( GlobalConfig . ShortcutDestinations . Desktop ) ;
48- checkboxStartMenu . IsChecked = dest . HasFlag ( GlobalConfig . ShortcutDestinations . StartMenu ) ;
49- checkboxGamesFolder . IsChecked = dest . HasFlag ( GlobalConfig . ShortcutDestinations . GamesFolder ) ;
50- checkboxThcrapFolder . IsChecked = dest . HasFlag ( GlobalConfig . ShortcutDestinations . ThcrapFolder ) ;
48+ checkboxDesktop . IsChecked = dest . HasFlag ( ShortcutDestinations . Desktop ) ;
49+ checkboxStartMenu . IsChecked = dest . HasFlag ( ShortcutDestinations . StartMenu ) ;
50+ checkboxGamesFolder . IsChecked = dest . HasFlag ( ShortcutDestinations . GamesFolder ) ;
51+ checkboxThcrapFolder . IsChecked = dest . HasFlag ( ShortcutDestinations . ThcrapFolder ) ;
52+ }
53+
54+ if ( config . developer_mode )
55+ {
56+ shortcutTypePanel . Visibility = Visibility . Visible ;
57+ shortcutType . SelectedIndex = ( int ) config . shortcuts_type ;
5158 }
5259 }
5360
@@ -61,7 +68,7 @@ private void checkbox_Checked(object sender, RoutedEventArgs e)
6168
6269 if ( checkboxDesktop . IsChecked == true || checkboxStartMenu . IsChecked == true ||
6370 checkboxGamesFolder . IsChecked == true || checkboxThcrapFolder . IsChecked == true || isUTLPresent == true )
64- warningPanel . Visibility = Visibility . Hidden ;
71+ warningPanel . Visibility = Visibility . Collapsed ;
6572 else
6673 warningPanel . Visibility = Visibility . Visible ;
6774 }
@@ -90,10 +97,14 @@ private void CreateShortcuts(string configName, IEnumerable<ThcrapDll.games_js_e
9097 public void Leave ( string configName , IEnumerable < ThcrapDll . games_js_entry > games )
9198 {
9299 config . default_shortcut_destinations =
93- ( checkboxDesktop . IsChecked == true ? GlobalConfig . ShortcutDestinations . Desktop : 0 ) |
94- ( checkboxStartMenu . IsChecked == true ? GlobalConfig . ShortcutDestinations . StartMenu : 0 ) |
95- ( checkboxGamesFolder . IsChecked == true ? GlobalConfig . ShortcutDestinations . GamesFolder : 0 ) |
96- ( checkboxThcrapFolder . IsChecked == true ? GlobalConfig . ShortcutDestinations . ThcrapFolder : 0 ) ;
100+ ( checkboxDesktop . IsChecked == true ? ShortcutDestinations . Desktop : 0 ) |
101+ ( checkboxStartMenu . IsChecked == true ? ShortcutDestinations . StartMenu : 0 ) |
102+ ( checkboxGamesFolder . IsChecked == true ? ShortcutDestinations . GamesFolder : 0 ) |
103+ ( checkboxThcrapFolder . IsChecked == true ? ShortcutDestinations . ThcrapFolder : 0 ) ;
104+ if ( config . developer_mode )
105+ {
106+ config . shortcuts_type = ( ThcrapDll . ShortcutsType ) shortcutType . SelectedIndex ;
107+ }
97108 config . Save ( ) ;
98109
99110 if ( checkboxDesktop . IsChecked == true )
0 commit comments