Hooks:PostHook(MenuSceneManager, "_set_up_templates", "FixBlackMarketFov", function(self)
	self._scene_templates.blackmarket.fov = 50
end)
Hooks:PostHook(MenuSceneManager, "update", "UpdateFov", function(self)
	if self._camera_object then
		local fixed_fov = math.min(50, self._new_fov)
		if self._new_fov ~= fixed_fov then		
			self._new_fov = fixed_fov
			self._camera_object:set_fov(self._new_fov)
		end
	end	
end)
Hooks:PostHook(MenuSceneManager, "set_scene_template", "SetMenuBackground", function(self, template)
	self:add_callback(callback(self, self, "SetBackground"), 0.01, template)
end)
function MenuSceneManager:SetBackground(background)
	local bg_allowed = {}
	bg_allowed.blackmarket_crafting = true
	bg_allowed.blackmarket_armor = true
	bg_allowed.blackmarket_weapon_color = true
--[[
	bg_allowed.blackmarket = true
	bg_allowed.blackmarket_item = true
	bg_allowed.blackmarket_customize = true
	bg_allowed.blackmarket_mask = true
	bg_allowed.blackmarket_screenshot = true
	bg_allowed.inventory = true
	bg_allowed.lobby = true
	bg_allowed.safe = true
	bg_allowed.standard = true
	bg_allowed.blackmarket_crafting = true
--]]

	if bg_allowed[background] == true then
		background = background or self._last_bg
		self._last_bg = background
		if not managers.environment_controller._vp or not background then
			return
		end

		if not Utils:IsInGameState() then
			if self._shaker then
				self._shaker:stop_all()
			end
			managers.environment_controller._vp:vp():set_post_processor_effect("World", Idstring("bloom_combine_post_processor"), Idstring("bloom_combine_empty"))
			World:effect_manager():set_rendering_enabled(false)
		end
--[[
		if alive(self._background_ws) then
			World:newgui():destroy_workspace(self._background_ws)
		end
--]]
		if self._bg_unit then
			self._bg_unit:set_visible(false)
		end
		if self._workbench_room then
			self._workbench_room:set_visible(false)
		end
		local cam = managers.viewport:get_current_camera()
		local gui = World:newgui()
		local w,h = 1600, 900
		self._background_ws = gui:create_world_workspace(w, h, cam:position() - Vector3(0, -486.5, 449.5):rotate_with(cam:rotation()) , Vector3(0, w, 0):rotate_with(cam:rotation()) , Vector3(0, 0, h):rotate_with(cam:rotation()))
		local bg = "guis/textures/backgrounds/" .. (ExcludableMenuBackgrounds.Options.use_standard_for_all and "standard" or background)
		if ExcludableMenuBackgrounds._movies and ExcludableMenuBackgrounds._movies[bg] and SystemFS:exists(ExcludableMenuBackgrounds._movies[bg]) then
			self._background_ws:panel():video({
				name = "bg",
				video = bg,
				width = w,
				height = h,
				loop = true,
				layer = 2000000
			})
		else
			self._background_ws:panel():bitmap({
				name = "bg",
				w = w,
				h = h,
				texture = bg,
				layer = 2000000
			})
		end
		self._background_ws:set_billboard(Workspace.BILLBOARD_BOTH)
	else
		if not Utils:IsInGameState() then
			World:effect_manager():set_rendering_enabled(true)
		end
		self._bg_unit:set_visible(true)
	end
end