Ejemplo n.º 1
0
        public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int        game_gen_index = 0;
            build_type build_type     = (build_type)0;
            var        vis            = Visibility.Collapsed;

            if (ToolkitProfiles.SettingsList != null && (int)value >= 0)
            {
                //Not sure what to do here. Crashes designer otherwise cause the list or value is empty
                game_gen_index = ToolkitProfiles.SettingsList[(int)value].game_gen;
                build_type     = ToolkitProfiles.SettingsList[(int)value].build_type;
            }
            else
            {
                vis = Visibility.Visible;
            }
            if (parameter is string && Int32.Parse(parameter as string) == game_gen_index)
            {
                if (build_type == build_type.release_mcc)
                {
                    vis = Visibility.Visible;
                }
            }
            return(vis);
        }
        private void profile_selection_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            setting_profile           = true;
            profile_name.Text         = "";
            tool_path.Text            = "";
            sapien_path.Text          = "";
            guerilla_path.Text        = "";
            gen_type.SelectedIndex    = 0;
            build_type.SelectedIndex  = 0;
            community_tools.IsChecked = false;
            data_path.Text            = "";
            tag_path.Text             = "";
            verbose.IsChecked         = false;
            game_path.Text            = "";
            game_exe_path.Text        = "";
            if (profile_select != null && profile_select.SelectedItem != null && ToolkitProfiles.SettingsList.Count > profile_select.SelectedIndex && profile_select.SelectedIndex >= 0)
            {
                build_type build_type_enum = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].build_type;

                profile_name.Text         = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].profile_name;
                tool_path.Text            = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].tool_path;
                sapien_path.Text          = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].sapien_path;
                guerilla_path.Text        = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].guerilla_path;
                gen_type.SelectedIndex    = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].game_gen;
                build_type.SelectedIndex  = (int)build_type_enum;
                community_tools.IsChecked = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].community_tools;
                data_path.Text            = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].data_path;
                tag_path.Text             = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].tag_path;
                verbose.IsChecked         = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].verbose;
                game_path.Text            = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].game_path;
                game_exe_path.Text        = ToolkitProfiles.SettingsList[profile_select.SelectedIndex].game_exe_path;
            }
            setting_profile = false;
        }
Ejemplo n.º 3
0
        public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            build_type build_type = (build_type)0;
            var        vis        = Visibility.Collapsed;

            if (ToolkitProfiles.SettingsList != null && (int)value >= 0)
            {
                //Not sure what to do here. Crashes designer otherwise cause the list or value is empty
                build_type = (build_type)(int)value;
            }
            else
            {
                vis = Visibility.Visible;
            }
            if (build_type == build_type.release_mcc)
            {
                vis = Visibility.Visible;
            }
            return(vis);
        }
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var    vis        = Visibility.Collapsed;
            string build_type = "release_mcc";

            if (ToolkitProfiles.SettingsList != null && (int)value >= 0) //Not sure what to do here. Crashes designer otherwise cause the list or value is empty
            {
                build_type build_type_item = (build_type)value;
                build_type = Enum.GetName(typeof(build_type), build_type_item);
            }
            else
            {
                vis = Visibility.Visible;
            }
            if (build_type == "release_mcc")
            {
                vis = Visibility.Visible;
            }
            return(vis);
        }
Ejemplo n.º 5
0
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            build_type build_type      = (build_type)0;
            bool       community_tools = false;
            int        game_gen_index  = 0;
            var        vis             = Visibility.Collapsed;

            if (ToolkitProfiles.SettingsList != null && (int)value >= 0)
            {
                //Not sure what to do here. Crashes designer otherwise cause the list or value is empty
                game_gen_index  = ToolkitProfiles.SettingsList[(int)value].game_gen;
                build_type      = ToolkitProfiles.SettingsList[(int)value].build_type;
                community_tools = ToolkitProfiles.SettingsList[(int)value].community_tools;

                if (parameter is string && Int32.Parse(parameter as string) == 0)
                {
                    //Gen 1 dropdown
                    if (game_gen_index == 0)
                    {
                        vis = Visibility.Visible;
                    }
                }
                else
                {
                    //Gen 2 dropdown
                    if (game_gen_index == 1)
                    {
                        vis = Visibility.Visible;
                    }
                }
            }
            else
            {
                //Either we're in desinger or there are no profiles. Reveal ourselves either way.
                vis = Visibility.Visible;
            }

            return(vis);
        }