Exemplo n.º 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");
            }
        }
Exemplo n.º 2
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);
        }
    }