View Single Post
06/14/19, 03:52 PM   #10
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Lua Code:
  1. ReshadeMap = {}
  2. ReshadeMap.appName = "ReshadeMap"
  3.  
  4. function ReshadeMap.OnAddOnLoaded()
  5. local mapTexturesOrig = {
  6.  
  7.     [1] = "/art/maps/vvardenfell/balmora_base_0.dds",
  8.     [2] = "/art/maps/vvardenfell/balmora_base_1.dds",
  9.     [3] = "/art/maps/vvardenfell/balmora_base_2.dds",
  10.     [4] = "/art/maps/vvardenfell/balmora_base_3.dds",
  11.     [5] = "/art/maps/vvardenfell/balmora_base_4.dds",
  12.  
  13. }
  14.  
  15. for index, textureNameOrig in ipairs(mapTexturesOrig) do
  16.    RedirectTexture(textureNameOrig, ReshadeMap.appName.. "/textures".. textureNameOrig)
  17. end
  18. end
  19.      
  20. EVENT_MANAGER:RegisterForEvent(ReshadeMap.appName, EVENT_ADD_ON_LOADED, ReshadeMap.OnAddOnLoaded)

The addon loads the code from top to bottom as soon as the lua file is loaded so make sure it will be at event_add_on_liaded first or the maps might not be ingane loaded properly if you try to do it before.
You can even try to load all at event_player_activated if the game tries to replace the Textures again after a zone change.

Last edited by Baertram : 06/14/19 at 03:57 PM.
  Reply With Quote