Ejemplo n.º 1
0
        private void init()
        {
            if (_t_init)
            {
                return;
            }
            _t_init = true;

            uint   id   = Settings.Instance.WerewolfTransformationEffectId;
            string file = Settings.Instance.WerewolfTransformationEffectFile;

            if (id == 0 || string.IsNullOrEmpty(file))
            {
                return;
            }

            _effect = TESForm.LookupFormFromFile <EffectSetting>(id, file);
        }
Ejemplo n.º 2
0
        private void init()
        {
            if (_t_init)
            {
                return;
            }
            _t_init = true;

            var id   = Settings.Instance.LichTransformationEffectId;
            var file = Settings.Instance.LichTransformationEffectFile;

            if (id == 0 || string.IsNullOrEmpty(file))
            {
                return;
            }

            _effect = TESForm.LookupFormFromFile(id, file) as EffectSetting;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Tries to get a <see cref="TESForm"/> from a plugin file.
        /// </summary>
        /// <typeparam name="T">Type of <see cref="TESForm"/> you want to get</typeparam>
        /// <param name="formID">Form ID as <c>0x1234</c> of the <see cref="TESForm"/></param>
        /// <param name="fileName">Name of the plugin</param>
        /// <param name="value">The resulting value if return true</param>
        /// <returns>True if successful, false if not</returns>
        public static bool TryGetFormFromFile <T>(uint formID, string fileName, out T value) where T : TESForm
        {
            value = default;

            var form = TESForm.LookupFormFromFile(formID, fileName);

            if (form == null)
            {
                return(false);
            }

            if (!(form is T tForm))
            {
                return(false);
            }

            value = tForm;
            return(true);
        }
Ejemplo n.º 4
0
 public static TESForm TESFormLookupFormFromFile(uint id, string fileName)
 {
     return(TESForm.LookupFormFromFile(id, fileName));
 }