コード例 #1
0
        public void GetOptions()
        {
            // Initialize registry key.
            RegistryKey optionsKey = Registry.CurrentUser.CreateSubKey("SOFTWARE\\RE2REmakeSRT", false);

            // Load registry values.
            if (RegistryHelper.GetBoolValue(optionsKey, "Debug", false))
            {
                Flags |= ProgramFlags.Debug;
            }
            else
            {
                Flags &= ~ProgramFlags.Debug;
            }

            if (RegistryHelper.GetBoolValue(optionsKey, "SkipChecksumCheck", false))
            {
                Flags |= ProgramFlags.SkipChecksumCheck;
            }
            else
            {
                Flags &= ~ProgramFlags.SkipChecksumCheck;
            }

            if (RegistryHelper.GetBoolValue(optionsKey, "NoTitleBar", false))
            {
                Flags |= ProgramFlags.NoTitleBar;
            }
            else
            {
                Flags &= ~ProgramFlags.NoTitleBar;
            }

            if (RegistryHelper.GetBoolValue(optionsKey, "AlwaysOnTop", false))
            {
                Flags |= ProgramFlags.AlwaysOnTop;
            }
            else
            {
                Flags &= ~ProgramFlags.AlwaysOnTop;
            }

            if (RegistryHelper.GetBoolValue(optionsKey, "Transparent", false))
            {
                Flags |= ProgramFlags.Transparent;
            }
            else
            {
                Flags &= ~ProgramFlags.Transparent;
            }

            if (RegistryHelper.GetBoolValue(optionsKey, "NoInventory", false))
            {
                Flags |= ProgramFlags.NoInventory;
            }
            else
            {
                Flags &= ~ProgramFlags.NoInventory;
            }

            double.TryParse(RegistryHelper.GetValue(optionsKey, "ScalingFactor", "0.75"), out ScalingFactor);
        }