Example #1
0
        /// <summary>
        /// Return a Copy of this item
        /// </summary>
        /// <returns>A copy of this catalog</returns>
        public WinHotkeyCat Copy( )
        {
            var ret = new WinHotkeyCat();

            foreach (var hk in this)
            {
                ret.Add(hk.Key, hk.Value.Copy( ));
            }
            return(ret);
        }
Example #2
0
        // LOAD is called on any invocation of the Dialog
        // Load all items from HUD to make them editable
        private void frmConfig_Load(object sender, EventArgs e)
        {
            this.TopMost = false; // inherited from parent - we don't want this here

            if (HudBarRef == null)
            {
                return;                // sanity ..
            }
            if (ProfilesRef?.Count < c_NumProfiles)
            {
                return;                                // sanity ..
            }
            cbxUnits.Checked          = HudBarRef.ShowUnits;
            cbxFlightRecorder.Checked = HudBarRef.FlightRecorder;

            PopulateASave(cbxASave); //20211204
            cbxASave.SelectedIndex = (int)HudBarRef.FltAutoSave;
            PopulateVoice(cbxVoice); // 20211006
            LoadVoice(cbxVoice);
            _speech.SetVoice(cbxVoice.SelectedItem.ToString( ));
            _speech.Enabled = true;

            PopulateVoiceCallouts( ); // 20211018

            // Hotkeys // 20211211
            m_hotkeys = HudBarRef.Hotkeys.Copy( );
            PopulateHotkeys( );
            chkKeyboard.Checked = HudBarRef.KeyboardHook; // 20211208
            chkInGame.Checked   = HudBarRef.InGameHook;   // 20211208


            // for all profiles
            for (int p = 0; p < c_NumProfiles; p++)
            {
                m_pName[p].Text = ProfilesRef[p].PName;
                m_flpHandler[p] = new FlpHandler(m_flps[p], p + 1,
                                                 ProfilesRef[p].ProfileString( ), ProfilesRef[p].FlowBreakString( ), ProfilesRef[p].ItemPosString( ));
                m_flpHandler[p].LoadFlp(HudBarRef);
                PopulateFonts(m_pFont[p]);
                ProfilesRef[p].LoadFontSize(m_pFont[p]);
                PopulatePlacement(m_pPlace[p]);
                ProfilesRef[p].LoadPlacement(m_pPlace[p]);
                PopulateKind(m_pKind[p]);
                ProfilesRef[p].LoadKind(m_pKind[p]);
                PopulateCond(m_pCondensed[p]);
                ProfilesRef[p].LoadCond(m_pCondensed[p]);
                PopulateTrans(m_pTransparency[p]);
                ProfilesRef[p].LoadTrans(m_pTransparency[p]);

                // mark the selected one
                if (SelectedProfile == p)
                {
                    m_pName[p].BackColor = Color.LimeGreen;
                }

                txShelfFolder.Text = HudBarRef.ShelfFolder; // 20220212
            }

#if DEBUG
            btDumpConfigs.Visible = true; // way to dump the configuration
#endif

            // use a Config Copy to allow Cancel changes
            FONTSdialog   = new FrmFonts( );
            m_configFonts = new GUI.GUI_Fonts(HudBarRef.FontRef);

            initDone = true;
        }