Exemple #1
0
        static void Postfix(vp_FPWeapon __instance)
        {
            // I don't actually use these values because the game overrides them for non-gun items. RenderingFieldOfView is set to 45 from scripts inside resources.assets such as WeaponBow, WeaponDefault ...
            CustomPrefs customPrefs = CustomPrefs.GetCustomPrefs();

            try
            {
                __instance.RenderingFieldOfView         = customPrefs.GetCustomPref <int>("WeaponFov");
                __instance.originalRenderingFieldOfView = customPrefs.GetCustomPref <int>("WeaponFov");
            }
            catch (ArgumentException e)
            {
                customPrefs.SetCustomPref <int>("WeaponFov", 60);
                __instance.RenderingFieldOfView         = customPrefs.GetCustomPref <int>("WeaponFov");
                __instance.originalRenderingFieldOfView = customPrefs.GetCustomPref <int>("WeaponFov");
            }
        }
Exemple #2
0
        static bool Prefix(vp_FPWeapon __instance, float ___m_FinalZoomTime, bool ___m_Wielded, GameObject ___m_WeaponCamera)
        {
            if (!___m_Wielded)
            {
                return(false);
            }

            __instance.RenderingZoomDamping = Mathf.Max(__instance.RenderingZoomDamping, 0.01f);
            float num = 1f - (___m_FinalZoomTime - Time.time) / __instance.RenderingZoomDamping;

            if (___m_WeaponCamera != null)
            {
                CustomPrefs customPrefs = CustomPrefs.GetCustomPrefs();
                ___m_WeaponCamera.GetComponent <Camera>().fieldOfView = Mathf.SmoothStep(___m_WeaponCamera.gameObject.GetComponent <Camera>().fieldOfView, customPrefs.GetCustomPref <int>("WeaponFov"), num * 15f);
            }

            return(false);
        }
Exemple #3
0
    public override void Execute(List <string> _params, global::CommandSenderInfo _senderInfo)
    {
        CustomPrefs customPrefs = CustomPrefs.GetCustomPrefs();

        int num;

        if (_params.Count == 0)
        {
            try
            {
                global::SingletonMonoBehaviour <global::SdtdConsole> .Instance.Output(customPrefs.GetCustomPref <int>("WeaponFov").ToString());
            }
            catch (ArgumentException)
            {
                global::SingletonMonoBehaviour <global::SdtdConsole> .Instance.Output("WeaponFov is not set");
            }
        }
        else if (_params.Count == 1 && int.TryParse(_params[0], out num))
        {
            customPrefs.SetCustomPref <int>("WeaponFov", num);
            global::SingletonMonoBehaviour <global::SdtdConsole> .Instance.Output("Set Weapon/Hands FOV to " + num);
        }
    }