-- name: FOV Config -- description: FOV Config v1.1\nAllows you to configure the game's Field of View via a Mod Menu Slider\nor Chat Command.\n\nMade by: Squishy6094 -- category: qol utility local FOV_MIN = 30 local FOV_DEFAULT = 45 local FOV_MAX = 120 local configFov = math.clamp(mod_storage_load_integer("configFov", FOV_DEFAULT), FOV_MIN, FOV_MAX) local configExternal = mod_storage_load_bool("configExternal", true) -- Overwrite Lua API function to be compatible local og_set_override_fov = set_override_fov local overrideFOV = FOV_DEFAULT _G.set_override_fov = function(fov) overrideFOV = fov ~= 0 and fov or FOV_DEFAULT end local function update() local setFov = configFov if configExternal then setFov = setFov * overrideFOV/FOV_DEFAULT end og_set_override_fov(setFov) end local function set_fov_slider(_, value) configFov = value mod_storage_save_integer("configFov", configFov) end local function set_fov_message(msg) if string.lower(msg) == "default" then msg = 40 end value = tonumber(msg) if value ~= nil then configFov = math.clamp(math.round(value), FOV_MIN, FOV_MAX) mod_storage_save_integer("configFov", configFov) update_mod_menu_element_slider(fovSliderIndex, configFov) djui_chat_message_create("Field of View set to " .. configFov) else djui_chat_message_create("Field of View must be a number!") end return true end local function set_external_check(_, value) configExternal = value mod_storage_save_bool("configExternal", configExternal) end hook_event(HOOK_UPDATE, update) hook_mod_menu_text("Made by: Squishy6094\nDefault Field of View: "..FOV_DEFAULT) fovSliderIndex = hook_mod_menu_slider("Field of View", configFov, FOV_MIN, FOV_MAX, set_fov_slider) hook_mod_menu_checkbox("Allow External Changes", configExternal, set_external_check) hook_chat_command("fov", "Sets the Field of View, Default is "..FOV_DEFAULT, set_fov_message)