local SceneWhitelist={
crownCrateKeyboard=true;
crownCrateGamepad=true;
};
local Fragments={
[FRAME_PLAYER_FRAGMENT]={-- Calls SetFrameLocalPlayerInGameCamera()
-- Calls SetFrameLocalPlayerTarget()
[FRAME_TARGET_STANDARD_RIGHT_PANEL_FRAGMENT] =true;
[FRAME_TARGET_STANDARD_RIGHT_PANEL_MEDIUM_LEFT_PANEL_FRAGMENT] =true;
[FRAME_TARGET_FURNITURE_BROWSER_FRAGMENT] =true;
[FRAME_TARGET_CRAFTING_FRAGMENT] =true;
[FRAME_TARGET_CRAFTING_GAMEPAD_FRAGMENT] =true;
[FRAME_TARGET_CENTERED_FRAGMENT] =true;
[FRAME_TARGET_OPTIONS_FRAGMENT] =true;
[FRAME_TARGET_STORE_WINDOW_FRAGMENT] =true;
[FRAME_TARGET_GAMEPAD_FRAGMENT] =true;
[FRAME_TARGET_GAMEPAD_OPTIONS_FRAGMENT] =true;
[FRAME_TARGET_LEFT_GAMEPAD_FRAGMENT] =true;
[FRAME_TARGET_TRADING_HOUSE_GAMEPAD_FRAGMENT] =true;
[FRAME_TARGET_GAMEPAD_RIGHT_FRAGMENT] =true;
-- Calls SetFullscreenEffect()
[FRAME_TARGET_BLUR_STANDARD_RIGHT_PANEL_FRAGMENT] =true;
[FRAME_TARGET_BLUR_STANDARD_RIGHT_PANEL_MEDIUM_LEFT_PANEL_FRAGMENT] =true;
[FRAME_TARGET_BLUR_CENTERED_FRAGMENT] =true;
[FRAME_TARGET_BLUR_STORE_WINDOW_FRAGMENT] =true;
[FRAME_TARGET_BLUR_GAMEPAD_FRAGMENT] =true;
[FRAME_TARGET_LEFT_BLUR_GAMEPAD_FRAGMENT] =true;
[FRAME_TARGET_TRADING_HOUSE_BLUR_GAMEPAD_FRAGMENT] =true;
[FRAME_TARGET_BLUR_GAMEPAD_RIGHT_FRAGMENT] =true;
[FRAME_TARGET_BLUR_FULLSCREEN_FRAGMENT] =true;
-- Calls SetFrameLocalPlayerLookAtDistanceFactor()
[FRAME_TARGET_DISTANCE_GAMEPAD_FAR_FRAGMENT] =true;
};
};
--Fragments[FRAME_PLAYER_ON_SCENE_HIDDEN_FRAGMENT]=Fragments[FRAME_PLAYER_FRAGMENT];-- Alias for FRAME_PLAYER_FRAGMENT (Only used for item previews, not actually registered to any scenes)
local ProcessScene; do-- function ProcessScene(scene)
local Lookup=Fragments;
function ProcessScene(scene)
local lookup=Lookup or Fragments;-- Save a copy, it changes with recursion
local list=scene.fragments;-- Scene fragment list
local i=#list;-- For doesn't handle changes in index mid-loop
while i>0 do
local val=lookup[list[i]]; i=i-1;
if val then
table.remove(list,i+1);-- We decremented the index already
if type(val)=="table" then
Lookup=val;-- Select lookup table
ProcessScene(scene);-- Recursive iteration
Lookup=lookup;-- Restore lookup table
i=math.min(i,#list);-- Make sure we're still within list boundries
end
end
end
end
end
for name,scene in pairs(SCENE_MANAGER.scenes) do
if not SceneWhitelist[name] then ProcessScene(scene); end
end