Beispiel #1
0
        //---------------------------------------------------------------------------

        private void btOkClick(object sender, EventArgs e)
        {
            Utils.SetRegistryInteger("UpdateMode", rgUpdateMode.ItemIndex);
            Utils.SetRegistryInteger("OverwriteItems", cbOverwriteItems.Checked ? 1 : 0);
            Utils.SetRegistryInteger("UseProxy", cbUseProxy.Checked ? 1 : 0);
            Utils.SetRegistryInteger("AlternateLogin", cbAlternateLogin.Checked ? 1 : 0);
            Utils.SetRegistryString("ProxyServer", edServer.Text);
            Utils.SetRegistryString("ProxyPort", edPort.Text);
            Utils.SetRegistryString("ProxyUser", edUser.Text);
            Utils.SetRegistryString("ProxyPasswd", edPasswd.Text);
            Utils.SetRegistryInteger("IPWorkaround", cbIPWorkaround.Checked ? 1 : 0);
            Utils.SetRegistryInteger("CalcTotalUtility", cbCalcTotalUtility.Checked ? 1 : 0);
            Utils.SetRegistryInteger("ItemPreview", cbItemPreview.Checked ? 1 : 0);
            Utils.SetRegistryInteger("WikiHelp", cbWikiHelp.Checked ? 1 : 0);
            Utils.SetRegistryInteger("LoadChars", cbLoadChars.Checked ? 1 : 0);
            Utils.SetRegistryInteger("CheckForUpdate", cbCheckForUpdate.Checked ? 1 : 0);
            Utils.SetRegistryInteger("ProcessPriority", cbProcess.Checked ? 1 : 0);
            Utils.SetRegistryInteger("UpdateIntervall", rgUpdateIntervall.ItemIndex);

            Utils.SetRegistryInteger("StatDisplayMode", rgStatDisplay.ItemIndex);
            Utils.SetRegistryString("StatDisplayFormula", edDisplayStatFormula.Text);
            Utils.SetRegistryInteger("StatDisplayFloorCol", (int)Utils.Color2Int(shFloorCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapCol", (int)Utils.Color2Int(shCapCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapIncCol", (int)Utils.Color2Int(shCapIncCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapAddCol", (int)Utils.Color2Int(shCapAddCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayCapSubCol", (int)Utils.Color2Int(shCapSubCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayValueCol", (int)Utils.Color2Int(shValueCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayValueAddCol", (int)Utils.Color2Int(shValueAddCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayValueSubCol", (int)Utils.Color2Int(shValueSubCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayTextCol", (int)Utils.Color2Int(shTextCol.BackColor));
            Utils.SetRegistryInteger("StatDisplayTextMouseOverColCol", (int)Utils.Color2Int(shTextMouseOverCol.BackColor));
            TMCapView.UpdateColors();
            TMCapView.UpdateFormat();

            // gewähltes Preismodell speichern
            Unit.xml_config.SavePriceModel(cbPriceModel.CurrentData);
            // Und zugehörigen Menüpunkt aktivieren
            if (CraftMenu != null)
            {
                TMainMenu.TTBXCustomItem item = (TMainMenu.TTBXCustomItem)Utils.FindTBXItem(CraftMenu, Unit.xml_config.arMenuItems[cbPriceModel.CurrentData].Name);
                Debug.Assert(item != null);
                Unit.frmMain.mnUserOptionClick(item, EventArgs.Empty);
            }

            //Speichern der Erweiterungen
            for (int ext = 0; ext < Unit.xml_config.nExtensions; ext++)
            {
                Utils.SetRegistryInteger(Unit.xml_config.arExtensions[ext].Name, cbAddons.GetItemChecked(ext) ? 1 : 0, "\\Extensions");
            }
        }
Beispiel #2
0
        //---------------------------------------------------------------------------

        private void TfrmOptions_FormShow(object sender, EventArgs e)
        {
            // Jetzt irgendwie die Box mit den Preismodellen ausfüllen
            for (int i = 0; i < Unit.xml_config.arMenuItems.Length; i++)
            {
                if (Unit.xml_config.arMenuItems[i].bPricing)
                {
                    cbPriceModel.Add(Unit.xml_config.arMenuItems[i].Name, -1, i);
                    // Schauen, ob dieses Modell aktiv ist
                    CraftMenu = (TMainMenu.TTBXCustomItem)Utils.FindTBXItem(Unit.frmMain.Options1, Unit.xml_config.arMenuItems[i].Group);
                    Debug.Assert(CraftMenu != null);
                    TMainMenu.TTBXCustomItem item = (TMainMenu.TTBXCustomItem)Utils.FindTBXItem(CraftMenu, Unit.xml_config.arMenuItems[i].Name);
                    Debug.Assert(item != null);
                    if (item.Checked)
                    {
                        cbPriceModel.SelectData(i);
                    }
                }
            }
            cbPriceModelChange(null, EventArgs.Empty);
            // Erstelle Combobox für Bannzauberer-Stufe
            for (int i = 0; i < 20; i++)
            {
                cbSCLevel.Add((i * 50 + 1).ToString() + " - " + ((i + 1) * 50).ToString(), -1, -50 + i * 5);
            }
            cbSCLevel.Add("1001+", -1, 50);
            cbSCLevel.SelectData(Unit.xml_config.iSCLevel);
            chHalfIP.Checked         = Unit.xml_config.bHalfIP;
            chEnglish.Checked        = Unit.xml_config.bKortEnglish;
            chIgnoreRaceBoni.Checked = Unit.xml_config.bIgnoreRaceBoni;
            rgUpdateMode.ItemIndex   = Utils.GetRegistryInteger("UpdateMode", 0);
            cbOverwriteItems.Checked = Utils.GetRegistryInteger("OverwriteItems", 0) != 0;
            cbUseProxy.Checked       = Utils.GetRegistryInteger("UseProxy", 0) != 0;
            cbAlternateLogin.Checked = Utils.GetRegistryInteger("AlternateLogin", 0) != 0;
            edServer.Text            = Utils.GetRegistryString("ProxyServer", "");
            edPort.Text                 = Utils.GetRegistryString("ProxyPort", "");
            edUser.Text                 = Utils.GetRegistryString("ProxyUser", "");
            edPasswd.Text               = Utils.GetRegistryString("ProxyPasswd", "");
            cbIPWorkaround.Checked      = Utils.GetRegistryInteger("IPWorkaround", 0) != 0;
            cbCalcTotalUtility.Checked  = Utils.GetRegistryInteger("CalcTotalUtility", 1) != 0;
            cbItemPreview.Checked       = Utils.GetRegistryInteger("ItemPreview", 1) != 0;
            cbWikiHelp.Checked          = Utils.GetRegistryInteger("WikiHelp", 1) != 0;
            cbLoadChars.Checked         = Utils.GetRegistryInteger("LoadChars", 1) != 0;
            cbCheckForUpdate.Checked    = Utils.GetRegistryInteger("CheckForUpdate", 1) != 0;
            cbProcess.Checked           = Utils.GetRegistryInteger("ProcessPriority", 0) != 0;
            rgUpdateIntervall.ItemIndex = Utils.GetRegistryInteger("UpdateIntervall", 0);

            // Laden der Erweiterungen
            for (int ext = 0; ext < Unit.xml_config.nExtensions; ext++)
            {
                cbAddons.Items.Add(Unit.xml_config.arExtensions[ext].Name);
                cbAddons.SetItemChecked(ext, Utils.GetRegistryInteger(Unit.xml_config.arExtensions[ext].Name, 1, "\\Extensions") != 0);
            }

            // Stat-Dialog initialisieren:
            rgStatDisplay.ItemIndex   = Utils.GetRegistryInteger("StatDisplayMode", 2);
            edDisplayStatFormula.Text = Utils.GetRegistryString("StatDisplayFormula", "%W%(%C-w%|%M-c%)");
            // Die Breite springt dauernd auf 33...wieder korrigieren.
            MCapExample.Width = 198;
            // Die Farben laden
            shFloorCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayFloorCol", (int)Utils.Color2Int(Color.White)));
            shFloorCol.Tag       = 0;

            shCapCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayCapCol", (int)Utils.Color2Int(Color.Gray)));
            shCapCol.Tag       = 1;

            shCapIncCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayCapIncCol", 0x00aa0000));
            shCapIncCol.Tag       = 2;

            shCapSubCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayCapSubCol", 0x000000cc));
            shCapSubCol.Tag       = 3;

            shCapAddCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayCapAddCol", 0x0000cc00));
            shCapAddCol.Tag       = 4;

            shValueCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayValueCol", (int)Utils.Color2Int(Color.Gray)));
            shValueCol.Tag       = 5;

            shValueSubCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayValueSubCol", 0x006666dd));
            shValueSubCol.Tag       = 6;

            shValueAddCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayValueAddCol", 0x0066dd66));
            shValueAddCol.Tag       = 7;

            shTextCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayTextCol", (int)Utils.Color2Int(SystemColors.ControlText)));
            shTextCol.Tag       = 8;

            shTextMouseOverCol.BackColor = Utils.Int2Color(Utils.GetRegistryInteger("StatDisplayTextMouseOverColCol", (int)Utils.Color2Int(Color.Blue)));
            shTextMouseOverCol.Tag       = 9;
        }