Esempio n. 1
0
        private void FormSettings_Load(object sender, EventArgs e)
        {
            // get them for enumeration
            m_checks.Clear( );
            m_checks.Add(chkHidden01); m_checks.Add(chkHidden02); m_checks.Add(chkHidden03); m_checks.Add(chkHidden04); m_checks.Add(chkHidden05); m_checks.Add(chkHidden06);
            m_checks.Add(chkHidden07); m_checks.Add(chkHidden08); m_checks.Add(chkHidden09); m_checks.Add(chkHidden10); m_checks.Add(chkHidden11); m_checks.Add(chkHidden12);

            m_labels.Clear( );
            m_labels.Add(lblColor01); m_labels.Add(lblColor02); m_labels.Add(lblColor03); m_labels.Add(lblColor04); m_labels.Add(lblColor05); m_labels.Add(lblColor06);
            m_labels.Add(lblColor07); m_labels.Add(lblColor08); m_labels.Add(lblColor09); m_labels.Add(lblColor10); m_labels.Add(lblColor11); m_labels.Add(lblColor12);

            // init GUI
            Tx.LocalizeControlTree(this);
            foreach (var c in m_checks)
            {
                c.Text = Tx.Translate("chkHideXX");
            }

            chkLbActionMaps.Items.Clear( );
            for (int i = 0; i < ActionMapsCls.ActionMaps.Length; i++)
            {
                chkLbActionMaps.Items.Add(ActionMapsCls.ActionMaps[i]);
            }

            comboLanguage.Items.Clear( );
            comboLanguage.Items.AddRange(SC.SCUiText.Instance.LanguagesS.ToArray( ));

            LoadSettings( );
        }
Esempio n. 2
0
        private void FormReassign_Load(object sender, EventArgs e)
        {
            Tx.LocalizeControlTree(this);
            lblJoy1.Text  = Tx.Translate("xJoystick") + " 1";
            lblJoy2.Text  = Tx.Translate("xJoystick") + " 2";
            lblJoy3.Text  = Tx.Translate("xJoystick") + " 3";
            lblJoy4.Text  = Tx.Translate("xJoystick") + " 4";
            lblJoy5.Text  = Tx.Translate("xJoystick") + " 5";
            lblJoy6.Text  = Tx.Translate("xJoystick") + " 6";
            lblJoy7.Text  = Tx.Translate("xJoystick") + " 7";
            lblJoy8.Text  = Tx.Translate("xJoystick") + " 8";
            lblJoy9.Text  = Tx.Translate("xJoystick") + " 9";
            lblJoy10.Text = Tx.Translate("xJoystick") + " 10";
            lblJoy11.Text = Tx.Translate("xJoystick") + " 11";
            lblJoy12.Text = Tx.Translate("xJoystick") + " 12";

            int textIdx = 0;

            foreach (JoystickCls j in m_owner)
            {
                m_tb[textIdx++].Text = j.DevName;
            }

            LoadSettings( );
        }
Esempio n. 3
0
        // Save the current settings
        private void SaveSettings()
        {
            // SC path
            AppSettings.Instance.UserSCPath     = txSCPath.Text;
            AppSettings.Instance.UserSCPathUsed = cbxUsePath.Checked;

            //Ignore Buttons
            AppSettings.Instance.IgnoreJS1  = txJS1.Text;
            AppSettings.Instance.IgnoreJS2  = txJS2.Text;
            AppSettings.Instance.IgnoreJS3  = txJS3.Text;
            AppSettings.Instance.IgnoreJS4  = txJS4.Text;
            AppSettings.Instance.IgnoreJS5  = txJS5.Text;
            AppSettings.Instance.IgnoreJS6  = txJS6.Text;
            AppSettings.Instance.IgnoreJS7  = txJS7.Text;
            AppSettings.Instance.IgnoreJS8  = txJS8.Text;
            AppSettings.Instance.IgnoreJS9  = txJS9.Text;
            AppSettings.Instance.IgnoreJS10 = txJS10.Text;
            AppSettings.Instance.IgnoreJS11 = txJS11.Text;
            AppSettings.Instance.IgnoreJS12 = txJS12.Text;

            // Ignore actionmaps
            string ignore = ",";

            for (int i = 0; i < chkLbActionMaps.Items.Count; i++)
            {
                if (chkLbActionMaps.GetItemCheckState(i) == CheckState.Checked)
                {
                    ignore += chkLbActionMaps.Items[i].ToString( ) + ",";
                }
            }
            AppSettings.Instance.IgnoreActionmaps = ignore;

            // DetectGamepad
            if (AppSettings.Instance.DetectGamepad != cbxDetectGamepad.Checked)
            {
                MessageBox.Show(Tx.Translate("setNote1"), Tx.Translate("setNote2"), MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            AppSettings.Instance.DetectGamepad = cbxDetectGamepad.Checked;

            //// Use PTU
            if (AppSettings.Instance.UsePTU != cbxPTU.Checked)
            {
                MessageBox.Show("Changing to / from PTU folders needs a restart of the application !!", "Settings Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            AppSettings.Instance.UsePTU = cbxPTU.Checked;

            // AutoTabXML
            AppSettings.Instance.AutoTabXML = cbxAutoTabXML.Checked;

            // Use CSV Listing
            AppSettings.Instance.UseCSVListing = cbxCSVListing.Checked;
            AppSettings.Instance.ListModifiers = cbxListModifiers.Checked;

            // Language
            AppSettings.Instance.UseLanguage  = (string)comboLanguage.SelectedItem;
            AppSettings.Instance.ShowTreeTips = cbxTreeTips.Checked;

            AppSettings.Instance.Save( );
        }
Esempio n. 4
0
 private void cbxUsePath_CheckedChanged(object sender, EventArgs e)
 {
     if (cbxUsePath.Checked)
     {
         string issue = SC.SCPath.CheckSCBasePath(fbDlg.SelectedPath);
         if (!string.IsNullOrEmpty(issue))
         {
             MessageBox.Show(this, issue, Tx.Translate("setMsgBox"), MessageBoxButtons.OK);
         }
     }
 }
Esempio n. 5
0
 private void btDone_Click(object sender, EventArgs e)
 {
     if (IsOK( ))
     {
         SaveSettings( );
         Canceled = false;
         this.Hide( );
     }
     else
     {
         MessageBox.Show(Tx.Translate("setNote3"), Tx.Translate("setNote4"), MessageBoxButtons.OK);
     }
 }
Esempio n. 6
0
        private void btChooseSCDir_Click(object sender, EventArgs e)
        {
            fbDlg.SelectedPath = txSCPath.Text;
            if (fbDlg.ShowDialog(this) == DialogResult.OK)
            {
                txSCPath.Text = fbDlg.SelectedPath;

                string issue = SC.SCPath.CheckSCBasePath(fbDlg.SelectedPath);
                if (!string.IsNullOrEmpty(issue))
                {
                    MessageBox.Show(this, issue, Tx.Translate("setMsgBox"), MessageBoxButtons.OK);
                }
            }
        }
Esempio n. 7
0
 private void TranslateDGV()
 {
     DGV.Columns["ID_Action"].Visible        = false;
     DGV.Columns["ActionName"].Visible       = false;
     DGV.Columns["REF_ActionMap"].HeaderText = Tx.Translate("tREF_ActionMap");
     DGV.Columns["ActionText"].HeaderText    = Tx.Translate("tActionText");
     DGV.Columns["Device"].HeaderText        = Tx.Translate("tDevice");
     DGV.Columns["Def_Binding"].HeaderText   = Tx.Translate("tDef_Binding");
     DGV.Columns["Def_Modifier"].HeaderText  = Tx.Translate("tDef_Modifier");
     DGV.Columns["AddBind"].HeaderText       = Tx.Translate("tAddBind");
     DGV.Columns["Usr_Binding"].HeaderText   = Tx.Translate("tUsr_Binding");
     DGV.Columns["Usr_Modifier"].HeaderText  = Tx.Translate("tUsr_Modifier");
     DGV.Columns["Disabled"].HeaderText      = Tx.Translate("tDisabled");
 }
Esempio n. 8
0
        // one more would be here

        /// <summary>
        /// Checks if the base path is correct - i.e. the subfolders can be found
        /// Changed for Patcher 1.2.0 again
        /// </summary>
        /// <param name="basePath"></param>
        /// <returns>An empty string if OK - else the issue found</returns>
        static public string CheckSCBasePath(string basePath)
        {
            string issue = "";

            if (string.IsNullOrEmpty(basePath))
            {
                issue = Tx.Translate("scpEmptyString"); // string.Format( "There is no vaild path given (empty string)" );
                return(issue);                          // no valid one can be found
            }

            if (!Directory.Exists(basePath))
            {
                issue = Tx.Translate("scpInvalidPath"); // string.Format( "There is no vaild path given (invalid directory)" );
                return(issue);                          // no valid one can be found
            }
            // 20180321 New PTU 3.1 another change in setup path - Testing for PTU first
            // 20190711 Lanuncher 1.2 - PTU has moved - change detection to find this one first.
            basePath = Path.Combine(basePath, "StarCitizen");

            string scpX = "";

            scpX = Path.Combine(basePath, "PTU");
            if (Directory.Exists(scpX))
            {
                return(""); // OK at least PTU folder exists - seems legit
            }
            else
            {
                // may be there is only LIVE ?
                scpX = Path.Combine(basePath, "LIVE");
                if (Directory.Exists(scpX))
                {
                    return(""); // OK LIVE folder exists - seems legit
                }
                // for now it failed
                issue = string.Format(Tx.Translate("scpClientDirNotFound").Replace("\\n", "\n"), scpX);
                //"Cannot find the SC Client Directory !!\n\nTried to look for:\n{0} \n\nPlease adjust the path in Settings\n"
            }

            // last resort is old style PTU only
            // This would be pre 1.2 laucher and PTU only
            basePath += "PTU"; // makes it "StarCitizenPTU"
            if (Directory.Exists(basePath))
            {
                return(""); // OK at least old PTU folder exists - seems legit
            }

            return(issue); // OK exit
        }
Esempio n. 9
0
        private void FormTable_Load(object sender, EventArgs e)
        {
            Tx.LocalizeControlTree(this);
            btClrFilterAction.Text     = Tx.Translate("btClear");
            btClrFilterDefBinding.Text = Tx.Translate("btClear");
            btClrFilterUsrBinding.Text = Tx.Translate("btClear");
            TranslateDGV( );

            // Assign Size property - check if on screen, else use defaults
            if (Commons.IsOnScreen(new Rectangle(AppSettings.Instance.FormTableLocation, AppSettings.Instance.FormTableSize)))
            {
                this.Size     = AppSettings.Instance.FormTableSize;
                this.Location = AppSettings.Instance.FormTableLocation;
            }
        }
Esempio n. 10
0
        private void btDone_Click(object sender, EventArgs e)
        {
            if (cbxUsePath.Checked)
            {
                string issue = SC.SCPath.CheckSCBasePath(fbDlg.SelectedPath);
                if (!string.IsNullOrEmpty(issue))
                {
                    MessageBox.Show(this, issue, Tx.Translate("setMsgBox"), MessageBoxButtons.OK);
                    return;
                }
            }

            SaveSettings( );
            Canceled = false;
            this.Hide( );
        }
Esempio n. 11
0
        // one more would be here

        /// <summary>
        /// Checks if the base path is correct - i.e. the subfolders can be found
        /// </summary>
        /// <param name="basePath"></param>
        /// <returns></returns>
        static public string CheckSCBasePath(string basePath)
        {
            string issue = "";

            if (string.IsNullOrEmpty(basePath))
            {
                issue = Tx.Translate("scpEmptyString"); // string.Format( "There is no vaild path given (empty string)" );
                return(issue);                          // no valid one can be found
            }

            if (!Directory.Exists(basePath))
            {
                issue = Tx.Translate("scpInvalidPath"); // string.Format( "There is no vaild path given (invalid directory)" );
                return(issue);                          // no valid one can be found
            }
            // 20180321 New PTU 3.1 another change in setup path - Testing for PTU first
            if (Directory.Exists(Path.Combine(basePath, "StarCitizenPTU")))
            {
                basePath = Path.Combine(basePath, "StarCitizenPTU");
            }
            else
            {
                // then try the retail path (was valid so far..)
                basePath = Path.Combine(basePath, "StarCitizen");
            }

            string scpX = "";

            // SC 3.0 try LIVE
            scpX = Path.Combine(basePath, "LIVE");

            if (!Directory.Exists(scpX))
            {
                issue = string.Format(Tx.Translate("scpClientDirNotFound").Replace("\\n", "\n"), scpX);
                //"Cannot find the SC Client Directory !!\n\nTried to look for:\n{0} \n\nPlease adjust the path in Settings\n"
                return(issue);
            }

            return(issue);
        }