예제 #1
0
        public void AttackThing(IItemOfInterest itemOfInterest)
        {
            if (Profile.Get.CurrentGame.Difficulty.IsDefined("NoHostileCreatures"))
            {
                return;
            }

            Body.EyeMode = BodyEyeMode.Hostile;
            Hostile hostile = null;

            if (!worlditem.Is <Hostile> (out hostile))
            {
                hostile = worlditem.GetOrAdd <Hostile> ();
                //copy the properties quickly
                Reflection.CopyProperties(Template.HostileTemplate, hostile.State);
                //copy the attacks directly
                hostile.TerritoryBase   = Den;
                hostile.State.Attack1   = ObjectClone.Clone <AttackStyle> (Template.HostileTemplate.Attack1);
                hostile.State.Attack2   = ObjectClone.Clone <AttackStyle> (Template.HostileTemplate.Attack2);
                hostile.OnAttack1Start += OnAttack1;
                hostile.OnAttack2Start += OnAttack2;
                hostile.OnWarn         += OnWarn;
                hostile.OnCoolOff      += OnCoolOff;
            }
            if (!hostile.HasPrimaryTarget || hostile.PrimaryTarget != itemOfInterest)
            {
                hostile.PrimaryTarget = itemOfInterest;
            }
            hostile.RefreshAttackSettings();
            Body.Animator.Idling = false;
        }
예제 #2
0
        public bool AttackThingAction(IItemOfInterest itemOfInterest)
        {
            bool    result  = false;
            Hostile hostile = null;

            if (!worlditem.Is <Hostile> (out hostile))
            {
                hostile = worlditem.GetOrAdd <Hostile> ();
                //copy the properties quickly
                Reflection.CopyProperties(Template.HostileTemplate, hostile.State);
                //copy the attacks directly
                hostile.TerritoryBase   = TerritoryBase;
                hostile.State.Attack1   = ObjectClone.Clone <AttackStyle> (Template.HostileTemplate.Attack1);
                hostile.State.Attack2   = ObjectClone.Clone <AttackStyle> (Template.HostileTemplate.Attack2);
                hostile.OnAttack1Start += OnAttack1;
                hostile.OnAttack2Start += OnAttack2;
                hostile.OnWarn         += OnWarn;
                hostile.OnCoolOff      += OnCoolOff;
                result = true;
            }
            if (!hostile.HasPrimaryTarget || hostile.PrimaryTarget != itemOfInterest)
            {
                hostile.PrimaryTarget = itemOfInterest;
                result = true;
            }
            animator.Idling     = false;
            animator.WeaponMode = CharacterWeaponMode.BareHands;
            return(false);
        }
예제 #3
0
        private List <Model.Produto> ObterProdutosSemRestricoes(List <Model.Produto> produtos, Model.Enum.TipoRelacaoSegurado?tipoRelacaoSegurado, Produto.Profissao profissaoProponente, DateTime dataNascimento, string uf)
        {
            var produtosParaSimulacao = new List <Model.Produto>();

            foreach (var produto in produtos)
            {
                string motivoRestricaoProduto;

                bool produtoRestrito = ProdutoRestrito(produto, tipoRelacaoSegurado, profissaoProponente, out motivoRestricaoProduto);

                if (produtoRestrito)
                {
                    Mensagens.Add(new Observacao(descricao: motivoRestricaoProduto));

                    continue;
                }

                var produtoParaSimulacao = ObjectClone.DoClone(produto);

                var coberturasObrigatoriasRemovidas = new List <Model.Cobertura>();

                foreach (var cobertura in produto.Coberturas)
                {
                    string motivoRestricaoCobertura;

                    bool coberturaRestrita = CoberturaRestrita(cobertura, dataNascimento, uf, profissaoProponente, out motivoRestricaoCobertura);

                    if (coberturaRestrita && cobertura.Obrigatoria.Value)
                    {
                        coberturasObrigatoriasRemovidas.Add(cobertura);

                        Mensagens.Add(new Observacao(descricao: motivoRestricaoCobertura));

                        continue;
                    }

                    if (coberturaRestrita)
                    {
                        Mensagens.Add(new Observacao(descricao: motivoRestricaoCobertura));

                        continue;
                    }

                    produtoParaSimulacao.Coberturas.Add(ObjectClone.DoClone(cobertura));
                }

                if (coberturasObrigatoriasRemovidas.Any())
                {
                    string mensagem = $"Produto {produto.Id} - {produto.Descricao} removido da simulação pois possui restrição em alguma(s) cobertura(s) obrigatória(s). Cobertura(s): { string.Join(", ", coberturasObrigatoriasRemovidas.Select(c => $"{c.Id} - {c.Descricao}")) }";

                    Mensagens.Add(new Observacao(descricao: mensagem));

                    continue;
                }

                produtosParaSimulacao.Add(produtoParaSimulacao);
            }

            return(produtosParaSimulacao);
        }
예제 #4
0
 public void SendDamageToItem()
 {
     while (ItemsOfInterest.Count > 0)
     {
         IItemOfInterest itemOfInterest = ItemsOfInterest.Dequeue();
         DamagePackage   packageCopy    = ObjectClone.Clone <DamagePackage>(ExplosionDamage);
         float           adjustedDamage = Mathf.Lerp(ExplosionDamage.DamageSent * ForceAtEdge, ExplosionDamage.DamageSent * ForceAtCenter, NormalizedRadius);
         packageCopy.DamageSent = adjustedDamage;
         packageCopy.ForceSent  = Mathf.Max(MinimumForce, packageCopy.ForceSent * NormalizedRadius);
         packageCopy.Point      = itemOfInterest.Position;
         packageCopy.Origin     = transform.position;
         packageCopy.Target     = itemOfInterest;
         //Debug.Log("Force: " + packageCopy.Force.ToString());
         DamageManager.Get.SendDamage(packageCopy);
         //characters and creatures are automatically stunned
         if (itemOfInterest.IOIType == ItemOfInterestType.WorldItem)
         {
             if (itemOfInterest.worlditem.Is <Creature>(out mCreatureCheck))
             {
                 mCreatureCheck.TryToStun(adjustedDamage);
             }
             else if (itemOfInterest.worlditem.Is <Character>(out mCharacterCheck))
             {
                 mCharacterCheck.TryToStun(adjustedDamage);
             }
         }
     }
 }
예제 #5
0
 private void copyGroupButton_Click(object sender, EventArgs e)
 {
     if (this.groupComboBox.SelectedIndex >= 0 && this.groupComboBox.SelectedIndex < this.HilightGroupList.Count)
     {
         HilightGroup newGroup = ObjectClone.Clone <HilightGroup>(this.HilightGroupList[this.groupComboBox.SelectedIndex]);
         newGroup.GroupName = "Copy of " + newGroup.GroupName;
         this.HilightGroupList.Add(newGroup);
         FillGroupComboBox();
         SelectGroup(this.HilightGroupList.Count - 1);
     }
 }
예제 #6
0
        public static WIFlags Intersection(WIFlags flags1, WIFlags flags2)
        {
            WIFlags newFlags = ObjectClone.Clone <WIFlags>(flags1);

            newFlags.Alignment  &= flags2.Alignment;
            newFlags.Faction    &= flags2.Faction;
            newFlags.Occupation &= flags2.Occupation;
            newFlags.Region     &= flags2.Region;
            newFlags.Subject    &= flags2.Subject;
            newFlags.Wealth     &= flags2.Wealth;
            return(newFlags);
        }
예제 #7
0
        public void CloneTest()
        {
            var cloner = new ObjectClone()
            {
                Pet = new Cat("Tom")
            };
            var newOne = cloner.Clone() as ObjectClone;

            Assert.IsNotNull(newOne);
            Assert.AreNotSame(cloner, newOne);
            Assert.AreNotSame(cloner.Pet, newOne.Pet);
            Assert.AreEqual(cloner.Pet.Name, newOne.Pet.Name);
        }
예제 #8
0
        public void EditorLoadTemplate()
        {
            if (!Manager.IsAwake <Books> ())
            {
                Manager.WakeUp <Books> ("Frontiers_ObjectManagers");
            }

            for (int i = 0; i < Books.Get.Templates.Count; i++)
            {
                if (Books.Get.Templates [i].Name == State.TemplateName)
                {
                    Template = ObjectClone.Clone <BookTemplate> (Books.Get.Templates [i]);
                }
            }
        }
예제 #9
0
        private void OnLogTabWindowLoad(object sender, EventArgs e)
        {
            ApplySettings(ConfigManager.Settings, SettingsFlags.All);
            if (ConfigManager.Settings.isMaximized)
            {
                Bounds      = ConfigManager.Settings.appBoundsFullscreen;
                WindowState = FormWindowState.Maximized;
                Bounds      = ConfigManager.Settings.appBounds;
            }
            else
            {
                if (ConfigManager.Settings.appBounds.Right > 0)
                {
                    Bounds = ConfigManager.Settings.appBounds;
                }
            }

            if (ConfigManager.Settings.preferences.openLastFiles && _startupFileNames == null)
            {
                List <string> tmpList = ObjectClone.Clone(ConfigManager.Settings.lastOpenFilesList);

                foreach (string name in tmpList)
                {
                    if (string.IsNullOrEmpty(name) == false)
                    {
                        AddFileTab(name, false, null, false, null);
                    }
                }
            }
            if (_startupFileNames != null)
            {
                LoadFiles(_startupFileNames, false);
            }
            _ledThread = new Thread(LedThreadProc);
            _ledThread.IsBackground = true;
            _ledThread.Start();

            _statusLineThread = new Thread(StatusLineThreadFunc);
            _statusLineThread.IsBackground = true;
            _statusLineThread.Start();

            FillHighlightComboBox();
            FillToolLauncherBar();
#if !DEBUG
            debugToolStripMenuItem.Visible = false;
#endif
        }
예제 #10
0
        public StackItem GetDuplicate(bool duplicateContainer)
        {
            StackItem stackItem = new StackItem();

            stackItem.Props.CopyGlobalNames(Props);
            stackItem.Props.CopyLocal(Props);
            stackItem.Props.CopyLocalNames(Props);
            //we might have to continue using object clone in this case
            //look into alternatives
            stackItem.SaveState = ObjectClone.Clone <WISaveState> (SaveState);
            //if (duplicateContainer) {
            //	if (mStackContainer != null) {
            //		WIStackContainer newContainer = ObjectClone.Clone <WIStackContainer> (mStackContainer);
            //		newContainer.Owner = stackItem;
            //	}
            //}
            return(stackItem);
        }
        public void OnClickCreateNewSetting()
        {
            mSuspendUpdates = true;

            CurrentDifficultySetting = ObjectClone.Clone <DifficultySetting>(CurrentDifficultySetting);
            CurrentDifficultySetting.HasBeenCustomized = true;
            CurrentDifficultySetting.Name     = "New Setting";
            CustomSettingNameInput.text       = CurrentDifficultySetting.Name;
            CustomSettingNameInput.label.text = CustomSettingNameInput.text;
            UICamera.selectedObject           = CustomSettingNameInput.gameObject;
            UIInput.current = CustomSettingNameInput;

            SavingNew = true;

            mSuspendUpdates = false;

            ResetInputs();
        }
예제 #12
0
        public bool ConditionByName(string conditionName, out Condition condition)
        {
            condition = null;
            Condition findCondition = null;

            if (!mConditionLookup.TryGetValue(conditionName, out findCondition))
            {
                if (Mods.Get.Runtime.LoadMod <Condition>(ref findCondition, "Condition", conditionName))
                {
                    mConditionLookup.Add(conditionName, findCondition);
                }
            }
            if (findCondition == null)
            {
                condition = null;
                return(false);
            }
            //clone the object
            condition = ObjectClone.Clone <Condition>(findCondition);
            return(true);
        }
예제 #13
0
        /// <summary>
        /// Imports all or some of the settings/prefs stored in the input stream.
        /// This will overwrite appropriate parts of the current (own) settings with the imported ones.
        /// </summary>
        /// <param name="currentSettings"></param>
        /// <param name="fileInfo"></param>
        /// <param name="flags">Flags to indicate which parts shall be imported</param>
        private Settings Import(Settings currentSettings, FileInfo fileInfo, ExportImportFlags flags)
        {
            Settings importSettings = LoadOrCreateNew(fileInfo);
            Settings ownSettings    = ObjectClone.Clone(currentSettings);
            Settings newSettings;

            // at first check for 'Other' as this are the most options.
            if ((flags & ExportImportFlags.Other) == ExportImportFlags.Other)
            {
                newSettings             = ownSettings;
                newSettings.preferences = ObjectClone.Clone(importSettings.preferences);
                newSettings.preferences.columnizerMaskList = ownSettings.preferences.columnizerMaskList;
                newSettings.preferences.highlightMaskList  = ownSettings.preferences.highlightMaskList;
                newSettings.hilightGroupList        = ownSettings.hilightGroupList;
                newSettings.preferences.toolEntries = ownSettings.preferences.toolEntries;
            }
            else
            {
                newSettings = ownSettings;
            }

            if ((flags & ExportImportFlags.ColumnizerMasks) == ExportImportFlags.ColumnizerMasks)
            {
                newSettings.preferences.columnizerMaskList = ReplaceOrKeepExisting(flags, ownSettings.preferences.columnizerMaskList, importSettings.preferences.columnizerMaskList);
            }
            if ((flags & ExportImportFlags.HighlightMasks) == ExportImportFlags.HighlightMasks)
            {
                newSettings.preferences.highlightMaskList = ReplaceOrKeepExisting(flags, ownSettings.preferences.highlightMaskList, importSettings.preferences.highlightMaskList);
            }
            if ((flags & ExportImportFlags.HighlightSettings) == ExportImportFlags.HighlightSettings)
            {
                newSettings.hilightGroupList = ReplaceOrKeepExisting(flags, ownSettings.hilightGroupList, importSettings.hilightGroupList);
            }
            if ((flags & ExportImportFlags.ToolEntries) == ExportImportFlags.ToolEntries)
            {
                newSettings.preferences.toolEntries = ReplaceOrKeepExisting(flags, ownSettings.preferences.toolEntries, importSettings.preferences.toolEntries);
            }

            return(newSettings);
        }
예제 #14
0
        protected override bool OnCharacterEnter(Character character)
        {
            Motile motile = null;

            if (character.worlditem.Is <Motile>(out motile))
            {
                if (State.ClearActions)
                {
                    motile.StopMotileActions();
                }
                MotileAction newMotileAction = ObjectClone.Clone <MotileAction>(State.Action);
                if (State.SequenceNodes)
                {
                    string targetName = newMotileAction.Target.FileName.Replace("[#]", State.NumTimesTriggered.ToString());
                    newMotileAction.Target.FileName = targetName;
                }
                motile.PushMotileAction(newMotileAction, State.Priority);
                return(true);
            }

            return(false);
        }
예제 #15
0
        public override IEnumerable <ActionSetting> FetchItems()
        {
            mLastUserActionSettings.Clear();
            mLastInterfaceActionSettings.Clear();
            mActionSettings.Clear();
            //copy each item so we're working with a fresh copy
            foreach (ActionSetting a in UserActionManager.Get.CurrentActionSettings)
            {
                mLastUserActionSettings.Add(ObjectClone.Clone <ActionSetting>(a));
            }
            UserActionManager.Get.GetAvailableBindings(mLastUserActionSettings);

            foreach (ActionSetting a in InterfaceActionManager.Get.CurrentActionSettings)
            {
                mLastInterfaceActionSettings.Add(ObjectClone.Clone <ActionSetting>(a));
            }
            InterfaceActionManager.Get.GetAvailableBindings(mLastInterfaceActionSettings);

            mActionSettings.AddRange(mLastInterfaceActionSettings);
            mActionSettings.AddRange(mLastUserActionSettings);
            return(mActionSettings);
        }
예제 #16
0
        public void EditorSaveTemplate()
        {
            if (!Manager.IsAwake <Books> ())
            {
                Manager.WakeUp <Books> ("Frontiers_ObjectManagers");
            }

            if (Template.MeshIndex == 0)
            {
                Template.MeshIndex |= Books.Get.EditorMeshIndex(gameObject.GetComponent <MeshFilter> ().sharedMesh.name);
            }
            if (Template.TextureIndex == 0)
            {
                Template.TextureIndex |= Books.Get.EditorTextureIndex(gameObject.GetComponent <Renderer>().sharedMaterial.mainTexture.name);
            }

            bool foundExisting = false;

            for (int i = 0; i < Books.Get.Templates.Count; i++)
            {
                if (Books.Get.Templates [i].Name == State.TemplateName)
                {
                    if (!Books.Get.Templates [i].BookNames.Contains(State.BookName))
                    {
                        Books.Get.Templates [i].BookNames.Add(State.BookName);
                    }
                    Books.Get.Templates [i] = ObjectClone.Clone <BookTemplate> (Template);
                    foundExisting           = true;
                }
            }
            if (!foundExisting)
            {
                Books.Get.Templates.Add(ObjectClone.Clone <BookTemplate> (Template));
            }
            //RefreshAppearance ();
        }
예제 #17
0
        protected IEnumerator SendPlayerToLocation(int chunkID, string locationPath, string locationName, STransform spawnPosition, Vector3 chunkOffset, float delay)
        {
            //save our target info for when the location loads
            mTargetSpawnPosition          = ObjectClone.Clone <STransform> (spawnPosition);
            mTargetSpawnPosition.Position = chunkOffset + mTargetSpawnPosition.Position;
            mTargetLocationName           = locationName;
            //set the primary chunk
            GameWorld.Get.SetPrimaryChunk(chunkID);
            //set all the non-distant chunks to load
            GameWorld.Get.SetDistantChunks(mTargetSpawnPosition.Position);
            while (GameWorld.Get.PrimaryChunk.CurrentMode != ChunkMode.Primary)
            {
                mLoadingInfo = "Waiting for primary chunk to load";
                //Debug.Log("Waiting for primary chunk to load");
                yield return(null);
            }
            //use a SuperLoader to load the location
            yield return(WIGroups.SuperLoadChildItem(locationPath, locationName, null, delay));

            //alright! we've found the location
            //now we can send the player to our target position and spawn
            //send the player to the target position
            yield break;
        }
        public object Convert(object value, object parameter)
        {
            DataGridItemChangedEventArgs itemChangedEventArgs = new DataGridItemChangedEventArgs();

            DataGridCellEditEndingEventArgs args = (DataGridCellEditEndingEventArgs)value;

            Type itemType = args.Row.Item.GetType();

            if (args.Column is DataGridBoundColumn dataGridBoundColumn)
            {
                Binding binding      = dataGridBoundColumn.Binding as Binding;
                string  propertyName = binding.Path.Path;

                itemChangedEventArgs.BindPath = propertyName;

                PropertyInfo propertyInfo = itemType.GetProperty(propertyName);

                itemChangedEventArgs.OldItem = ObjectClone.CopyProperties(args.Row.Item, itemType);

                BindingExpression bindingExpression = args.EditingElement.GetBindingExpression(TextBox.TextProperty);
                bindingExpression.UpdateSource();

                itemChangedEventArgs.NewItem = args.Row.Item;

                itemChangedEventArgs.IsChanged = !object.Equals(propertyInfo.GetValue(itemChangedEventArgs.OldItem),
                                                                propertyInfo.GetValue(itemChangedEventArgs.NewItem));
            }

            #region Old
            //Type itemType = args.Row.Item.GetType();

            //itemChangedEventArgs.IsNewItem = args.Row.IsNewItem;

            //if (itemChangedEventArgs.IsNewItem == false)
            //{
            //    itemChangedEventArgs.OldItem = ObjectClone.CopyProperties(args.Row.Item, itemType);
            //}

            //if (args.Column is DataGridBoundColumn dataGridBoundColumn)
            //{
            //    Binding binding = dataGridBoundColumn.Binding as Binding;
            //    string propertyName = binding.Path.Path;
            //    PropertyInfo propertyInfo = itemType.GetProperty(propertyName);

            //    BindingExpression bindingExpression = args.EditingElement.GetBindingExpression(TextBox.TextProperty);
            //    bindingExpression.UpdateSource();

            //    itemChangedEventArgs.NewItem = args.Row.Item;

            //    if (itemChangedEventArgs.IsNewItem)
            //    {
            //        itemChangedEventArgs.IsChanged = true;
            //    }
            //    else
            //    {
            //        itemChangedEventArgs.IsChanged = !object.Equals(propertyInfo.GetValue(itemChangedEventArgs.OldItem),
            //        propertyInfo.GetValue(itemChangedEventArgs.NewItem));
            //    }



            //}
            #endregion

            #region Old
            //if (args.EditingElement is TextBox textBox)
            //{
            //if (string.IsNullOrEmpty(textBox.Text) == false)
            //{
            //    Type itemType = itemChangedEventArgs.OldItem.GetType();

            //    PropertyInfo propertyInfo = itemType.GetProperty(propertyName);

            //    Type metaType = propertyInfo.PropertyType;

            //    if (metaType.IsGenericType && metaType.GetGenericTypeDefinition() == typeof(Nullable<>))
            //    {
            //        metaType = propertyInfo.PropertyType.GetGenericArguments()[0];
            //    }

            //    try
            //    {
            //        object _value = System.Convert.ChangeType(textBox.Text, metaType);
            //        itemChangedEventArgs.NewItem = ObjectClone.CopyProperties(itemType, itemChangedEventArgs.OldItem);
            //        propertyInfo.SetValue(itemChangedEventArgs.NewItem, _value);
            //    }
            //    catch (Exception)
            //    {
            //        ApplicationCommands.Undo.Execute(null, textBox);
            //        //Log.Error("DataGridCellEditEndingEventArgs转换失败", e);
            //    }
            //}
            //}
            #endregion

            return(itemChangedEventArgs);
        }
예제 #19
0
        private void EditDeleteAnimation_Click(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (e.ColumnIndex >= 0 && senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                e.RowIndex >= 0)
            {
                var          action = senderGrid.Columns[e.ColumnIndex].HeaderText?.ToString();
                var          name   = senderGrid.Rows[e.RowIndex].Cells["What"].Value?.ToString();
                Form         frm;
                DialogResult result = DialogResult.Abort;
                switch (action)
                {
                case "E":
                    if (config.Animations == null || !config.Animations.Any(x => ((IAnimationItem)x).Name == name))
                    {
                        var newAnimation = new AnimationDrawing
                        {
                            Name     = name,
                            Type     = AnimationItemTypeEnum.Drawing,
                            Triggers = new IAnimationTrigger[0]
                        };
                        newAnimation.Triggers.ToList().Add(
                            (IAnimationTrigger) new AnimationTriggerClientRequest
                        {
                            Type    = AnimationTriggerTypeEnum.ClientRequest,
                            Actions = new IAnimationAction[0]
                        });
                        config.Animations = new IAnimationItem[0];;
                        config.Animations.ToList().Add(newAnimation);
                    }
                    var animation = ObjectClone.Clone <IAnimationItem>((IAnimationItem)config.Animations.First(x => ((IAnimationItem)x).Name == name));
                    //ObjectClone.Clone(config.Animations?.First(x => x.Name == name));
                    using (frm = new frmAnimation((IAnimationItem)animation, cockpitDirectory))
                    {
                        result = frm.ShowDialog(this);
                        if (result == DialogResult.OK)
                        {
                            var newAnimation = ((frmAnimation)frm).DialogValue;
                            // Replace existing animation with the modified version
                            var currentAnimations = config.Animations.ToList();
                            currentAnimations[currentAnimations.IndexOf(currentAnimations.First(x => ((IAnimationItem)x).Name == name))] = newAnimation;
                            config.Animations = currentAnimations.ToArray();
                        }
                    }
                    break;

                case "X":
                    result = MessageBox.Show("Are you sure you want to delete this animation?", "Delete Animation", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                    if (result == DialogResult.OK)
                    {
                        var newAnimations = config.Animations.ToList();
                        newAnimations.RemoveAt(newAnimations.IndexOf(newAnimations.First(x => ((IAnimationItem)x).Name == name)));
                        config.Animations = newAnimations.ToArray();
                    }
                    break;
                }
                if (result == DialogResult.OK)
                {
                    PopulateConfigForm();
                }
            }
        }
예제 #20
0
        public override void PushEditObjectToNGUIObject()
        {
            VideoFovMin          = Globals.FOVMin;
            VideoFovMax          = Globals.FOVMax;
            MaxMeshTreesMin      = Globals.ChunkTerrainMaxMeshTreesMin;
            MaxMeshTreesMax      = Globals.ChunkTerrainMaxMeshTreesMax;
            TreeBillboardDistMin = Globals.ChunkTerrainTreeBillboardDistMin;
            TreeBillboardDistMax = Globals.ChunkTerrainTreeBillboardDistMax;
            GrassDistMax         = Globals.ChunkTerrainGrassDistanceMax;
            GrassDistMin         = Globals.ChunkTerrainGrassDistanceMin;
            TerrainDetailMax     = Globals.ChunkTerrainDetailMax;
            TerrainDetailMin     = Globals.ChunkTerrainDetailMin;
            VideoTerrainReduceTreeVariation.functionName = "OnTerrainSettingChange";
            VideoTerrainMaxGrassVarieties.functionName   = "OnTerrainSettingChange";

            SoundGeneral.functionName           = "OnSoundLevelChange";
            SoundMusic.functionName             = "OnSoundLevelChange";
            SoundFX.functionName                = "OnSoundLevelChange";
            SoundAmbient.functionName           = "OnSoundLevelChange";
            SoundInterface.functionName         = "OnSoundLevelChange";
            SfxSoundFootstep.functionName       = "OnSoundLevelChange";
            SfxSoundPlayerVoice.functionName    = "OnSoundLevelChange";
            SfxSoundDynamicObjects.functionName = "OnSoundLevelChange";
            SfxSoundCreaturs.functionName       = "OnSoundLevelChange";

            ImmersionCrosshairAlphaSlider.functionName          = "OnImmersionSettingChange";
            ImmersionCrosshairAlphaSlider.eventReceiver         = gameObject;
            ImmersionCrosshairInactiveAlphaSlider.functionName  = "OnImmersionSettingChange";
            ImmersionCrosshairInactiveAlphaSlider.eventReceiver = gameObject;
            ImmersionWorldItemsOverlay.functionName             = "OnImmersionSettingChange";
            ImmersionWorldItemsOverlay.eventReceiver            = gameObject;
            ImmersionPathGlowIntensitySlider.functionName       = "OnImmersionSettingChange";
            ImmersionPathGlowIntensitySlider.eventReceiver      = gameObject;
            ImmersionSpecialObjectsOverlay.functionName         = "OnImmersionSettingChange";
            ImmersionSpecialObjectsOverlay.eventReceiver        = gameObject;
            ImmersionWorldItemHUD.functionName             = "OnImmersionSettingChange";
            ImmersionWorldItemHUD.eventReceiver            = gameObject;
            ImmersionWorldItemHUDInCenter.functionName     = "OnImmersionSettingChange";
            ImmersionWorldItemHUDInCenter.eventReceiver    = gameObject;
            ImmersionPathGlowIntensitySlider.functionName  = "OnImmersionSettingChange";
            ImmersionPathGlowIntensitySlider.eventReceiver = gameObject;
            ImmersionCameraSmoothingSlider.functionName    = "OnImmersionSettingChange";
            ImmersionCameraSmoothingSlider.eventReceiver   = gameObject;

            OculusModeCheckbox.functionName                 = "OnClickVideoCheckbox";
            OculusModeCheckbox.eventReceiver                = gameObject;
            VRDisableScreenEffectsCheckbox.functionName     = "OnClickVideoCheckbox";
            VRDisableScreenEffectsCheckbox.eventReceiver    = gameObject;
            VRStaticCutsceneCamerasCheckbox.functionName    = "OnClickVideoCheckbox";
            VRStaticCutsceneCamerasCheckbox.eventReceiver   = gameObject;
            VRStaticFastTravelCamerasCheckbox.functionName  = "OnClickVideoCheckbox";
            VRStaticFastTravelCamerasCheckbox.eventReceiver = gameObject;
            VRDisableExtraGrassLayersCheckbox.functionName  = "OnClickVideoCheckbox";
            VRDisableExtraGrassLayersCheckbox.eventReceiver = gameObject;

            Tabs.Initialize(this);

            Initialized = true;

            TempVideoPrefs = ObjectClone.Clone <PlayerPreferences.VideoPrefs>(Profile.Get.CurrentPreferences.Video);
            TempVideoPrefs.RefreshPostFX();
            TempVideoPrefs.RefreshSupportedResolutions();
            VideoRefresh(TempVideoPrefs);
            SoundRefresh();
            ImmersionRefresh();
            AccessibilityRefresh();
        }