Quantcast Disable releaseUITextures cvar - WoWInterface
 
Thread Tools Display Modes
06-29-16, 01:39 PM   #1
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 882
Disable releaseUITextures cvar

This is kind of a follow-up to this thread: GetTexture() returns nil on unloaded textures

I've been trying to update LargerMacroIconSelection for the Equipment Manager icons too, but you have to show the parent frame(s) first in order to get the textures
  • At first I tried showing and hiding it, but then it would give an error
    Lua Code:
    1. CharacterFrame:Show()
    2. GearManagerDialogPopup:Show()
    3.  
    4. for _, child in ipairs(regions) do
    5.     if child.GetTexture then
    6.         if child:GetTexture() == "Interface\\MacroFrame\\MacroPopup-TopLeft.blp" then
    7.             -- dostuff
    8.         end
    9.     end
    10. end
    11.  
    12. CharacterFrame:Hide()
    13. GearManagerDialogPopup:Hide()
    Code:
    Message: ..\FrameXML\CharacterFrame.lua line 191:
       attempt to perform arithmetic on a nil value
    _
  • Then I tried ToggleCharacter("PaperDollFrame"), but it would throw errors on login

    Lua Code:
    1. ToggleCharacter("PaperDollFrame")
    2. GearManagerDialogPopup:Show()
    3.  
    4. for _, child in ipairs(regions) do
    5.     if child.GetTexture then
    6.         if child:GetTexture() == "Interface\\MacroFrame\\MacroPopup-TopLeft.blp" then
    7.             -- dostuff
    8.         end
    9.     end
    10. end
    11.  
    12. ToggleCharacter("PaperDollFrame")
    13. GearManagerDialogPopup:Hide()
    Code:
    Message: ..\FrameXML\PaperDollFrame.lua line 1727:
       Usage: GetSpecializationRole(specIndex[, isInspect[, isPet]])
    _
  • Now that I fail to work around it, my last resort is to just disable the releaseUITextures CVar
    But since Blizzard wants UI textures to be freed up when not visible, can I get away with doing that?

    Would the increase in memory (or any performance hit) be significant?
    Lua Code:
    1. if GetCVar("releaseUITextures") == "1" then
    2.     SetCVar("releaseUITextures", 0)
    3.     -- ask the user if they want to do a /reload
    4.     -- for releaseUITextures to be properly disabled, so we can grab our textures
    5. end

* I haven't yet checked into setting it up once the GearManagerDialogPopup is actually being shown, instead of at player login. Maybe that will also work...
 
06-29-16, 11:35 PM   #2
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 882
Originally Posted by Ketho View Post
* I haven't yet checked into setting it up once the GearManagerDialogPopup is actually being shown, instead of at player login. Maybe that will also work...
... and that worked. I guess you have to use more hooks as a workaround

But I honestly wonder if it's considered acceptable to just disable releaseUITextures

Completely useless snippet:
Lua Code:
  1. local f = CreateFrame("Frame")
  2. local active = {}
  3.  
  4. function f:SetHook(sf)
  5.     local popup = sf:GetParent()
  6.     popup:HookScript("OnShow", function()
  7.         if active[sf] then
  8.             return
  9.         else
  10.             self:Init(sf)
  11.             active[sf] = true
  12.         end
  13.     end)
  14. end
  15.  
  16. function f:OnEvent(event, addon)
  17.     if addon == "LargerMacroIconSelection" then
  18.         self:SetHook(GearManagerDialogPopupScrollFrame)
  19.     elseif addon == "Blizzard_MacroUI" then
  20.         self:SetHook(MacroPopupScrollFrame)
  21.     end
  22. end
  23.  
  24. f:RegisterEvent("ADDON_LOADED")
  25. f:SetScript("OnEvent", f.OnEvent)

Last edited by Ketho : 07-05-16 at 03:44 AM.
 
06-30-16, 03:15 AM   #3
Gello
A Firelord
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 488
imho addons should not change any cvar unless the purpose of the addon is to change those settings (turning something on/off) or a feature absolutely requires it (such as scriptProfile).

When addons take it upon themselves to tweak underlying console settings, it can affect the behavior of the UI or other addons that aren't related. Maybe that's an intended effect and in that case it's okay. Otherwsie imho it's better to exhaust all possible alternatives first, even if it means a little extra code to avoid taking a shortcut through the user's system settings. Like in your situation as a last resort I would've just built a separate dialog to replace the default's; it would not be a great deal of code and it would be a lot kinder to the user than tinkering with their system settings.

It's also neat and tidy when all traces of an addon are gone when an addon is disabled. It's messy when there's lingering stuff left over. And for this new cvar, which is not really related to the addon's purpose, the user would've likely forgetten all about that dialog asking about the cvar and it'd still be disabled for them for many years afterwards.

Another workaround for not being able to rely on GetTexture is to hook the SetTexture method on the texture.
 
06-30-16, 06:04 AM   #4
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 882
Originally Posted by Gello View Post
imho addons should not change any cvar unless the purpose of the addon is to change those settings (turning something on/off) or a feature absolutely requires it (such as scriptProfile).

Okay, I understand it can be a pain to find out why suddenly a cvar had changed after using some addon. Will try to keep my hands off that cvar and work around it
 
06-30-16, 03:31 PM   #5
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
fixed my EMS for legion, and also came up with hooking:OnShow
__________________
 
07-06-16, 11:59 AM   #6
Nevcairiel
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 60
Note that releaseUITextures was removed in a recent beta build and defaults to "on".
The bug that caused texture filenames to not be returned on hidden textures has however been fixed, and that informaiton is now always available.

Last edited by Nevcairiel : 07-06-16 at 12:25 PM.
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » Disable releaseUITextures cvar

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off