View Single Post
07/18/18, 02:25 AM   #7
SDPhantom
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 47
Here's the second option I mentioned earlier. It scans through all scenes in the scene manager and removes the affecting fragments. The lookup table acts as a hierarchy. If the parent fragment is found, it tries to remove the child fragments as well.

Lua Code:
  1. local SceneWhitelist={
  2.     crownCrateKeyboard=true;
  3.     crownCrateGamepad=true;
  4. };
  5.  
  6. local Fragments={
  7.     [FRAME_PLAYER_FRAGMENT]={-- Calls SetFrameLocalPlayerInGameCamera()
  8. --      Calls SetFrameLocalPlayerTarget()
  9.         [FRAME_TARGET_STANDARD_RIGHT_PANEL_FRAGMENT]                =true;
  10.         [FRAME_TARGET_STANDARD_RIGHT_PANEL_MEDIUM_LEFT_PANEL_FRAGMENT]      =true;
  11.         [FRAME_TARGET_FURNITURE_BROWSER_FRAGMENT]               =true;
  12.         [FRAME_TARGET_CRAFTING_FRAGMENT]                    =true;
  13.         [FRAME_TARGET_CRAFTING_GAMEPAD_FRAGMENT]                =true;
  14.         [FRAME_TARGET_CENTERED_FRAGMENT]                    =true;
  15.         [FRAME_TARGET_OPTIONS_FRAGMENT]                     =true;
  16.         [FRAME_TARGET_STORE_WINDOW_FRAGMENT]                    =true;
  17.         [FRAME_TARGET_GAMEPAD_FRAGMENT]                     =true;
  18.         [FRAME_TARGET_GAMEPAD_OPTIONS_FRAGMENT]                 =true;
  19.         [FRAME_TARGET_LEFT_GAMEPAD_FRAGMENT]                    =true;
  20.         [FRAME_TARGET_TRADING_HOUSE_GAMEPAD_FRAGMENT]               =true;
  21.         [FRAME_TARGET_GAMEPAD_RIGHT_FRAGMENT]                   =true;
  22.  
  23. --      Calls SetFullscreenEffect()
  24.         [FRAME_TARGET_BLUR_STANDARD_RIGHT_PANEL_FRAGMENT]           =true;
  25.         [FRAME_TARGET_BLUR_STANDARD_RIGHT_PANEL_MEDIUM_LEFT_PANEL_FRAGMENT] =true;
  26.         [FRAME_TARGET_BLUR_CENTERED_FRAGMENT]                   =true;
  27.         [FRAME_TARGET_BLUR_STORE_WINDOW_FRAGMENT]               =true;
  28.         [FRAME_TARGET_BLUR_GAMEPAD_FRAGMENT]                    =true;
  29.         [FRAME_TARGET_LEFT_BLUR_GAMEPAD_FRAGMENT]               =true;
  30.         [FRAME_TARGET_TRADING_HOUSE_BLUR_GAMEPAD_FRAGMENT]          =true;
  31.         [FRAME_TARGET_BLUR_GAMEPAD_RIGHT_FRAGMENT]              =true;
  32.         [FRAME_TARGET_BLUR_FULLSCREEN_FRAGMENT]                 =true;
  33.  
  34. --      Calls SetFrameLocalPlayerLookAtDistanceFactor()
  35.         [FRAME_TARGET_DISTANCE_GAMEPAD_FAR_FRAGMENT]                =true;
  36.     };
  37. };
  38. --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)
  39.  
  40. local ProcessScene; do--    function ProcessScene(scene)
  41.     local Lookup=Fragments;
  42.     function ProcessScene(scene)
  43.         local lookup=Lookup or Fragments;-- Save a copy, it changes with recursion
  44.         local list=scene.fragments;--   Scene fragment list
  45.  
  46.         local i=#list;--    For doesn't handle changes in index mid-loop
  47.         while i>0 do
  48.             local val=lookup[list[i]]; i=i-1;
  49.             if val then
  50.                 table.remove(list,i+1);--   We decremented the index already
  51.                 if type(val)=="table" then
  52.                     Lookup=val;--   Select lookup table
  53.                     ProcessScene(scene);--  Recursive iteration
  54.                     Lookup=lookup;--    Restore lookup table
  55.  
  56.                     i=math.min(i,#list);--  Make sure we're still within list boundries
  57.                 end
  58.             end
  59.         end
  60.     end
  61. end
  62.  
  63. for name,scene in pairs(SCENE_MANAGER.scenes) do
  64.     if not SceneWhitelist[name] then ProcessScene(scene); end
  65. end

This is also experimental and may affect different parts of the UI. One noted issue so far is item previews are disabled in the Collections and Crown Store UIs. SetFrameLocalPlayerInGameCamera() is required for GetPreviewModeEnabled() to return true.

Last edited by SDPhantom : 07/18/18 at 02:34 AM.
  Reply With Quote