Quantcast Graphics auto-setting to highest setting (and temporary workaround) - WoWInterface
Thread Tools Display Modes
10-13-16, 09:52 PM   #1
A Murloc Raider
whatisxml's Avatar
Join Date: Jun 2016
Posts: 9
Graphics auto-setting to highest setting (and temporary workaround)

For temporary workaround snippet/macro go to the bottom

The Bug
Occasionally, when making any changes in the VideoOptionsFrame (Game Menu > System) such as changes to Sound or Graphics, clicking "Okay" or "Apply" will cause all Graphics Quality settings to be set to their max values.

Recreating the Bug
  1. go to Game Menu > System > Graphics
  2. pull the large Graphics Quality slider to "1" and click APPLY
  3. change a different graphics setting, e.g. set View Distance to "2" and click APPLY
  4. click CANCEL then re-click SYSTEM
  5. once more, click CANCEL then re-click SYSTEM. Notice that APPLY is now enabled.
  6. click APPLY or OKAY and notice the delay as most of the Graphics Settings are increased to max
  7. if you exit and return to the Graphics settings, it should properly display its current max settings

Source of the Bug
This bug comes from the fact that a "Custom" graphics setting is treated as GraphicsQuality = 11. A "Custom" graphics setting is one where an individual dropdown or slider has been changed from the value set by the large Graphics Quality slider. A small text that says "Custom" will be visible just below the Graphics Quality slider when you do this. Running Graphics_Quality:GetValue() will return 11.

When a user clicks CANCEL or ESC from the VideoOptionsFrame, it calls VideoOptionsPanel_Cancel(Graphics_) https://github.com/tomrus88/Blizzard...anels.lua#L311
which loops through all the controls of Graphics_ and runs ControlSetValue(control, control.value) https://github.com/tomrus88/Blizzard...anels.lua#L323
ControlSetValue basically just does control:SetValue(control.value) to set controls back to their previous values.

The problem is that when Graphics_Quality is set to "11" for a custom setting, running ControlSetValue on it sets Graphics_Quality to "10" which is max graphics settings.

This new max setting isn't applied until the next time the user presses OKAY or APPLY.

Some Further Details
The reason that recreating the bug above requires two cycles of clicking CANCEL is that ControlSetValue uses Graphics_Quality.value which is not always the same as Graphics_Quality:GetValue(). When changing a "Custom" setting, Graphics_Quality:GetValue() will immediately change to "11" while Graphics_Quality.value will remain what it was (e.g. 1). The first time you press CANCEL in the above example, Graphics_Quality:GetValue() remains 11 while Graphics_Quality.value is set to "nil". When you next click on SYSTEM, it sets Graphics_Quality.value = Graphics_Quality:GetValue(), so now Graphics_Quality.value is "11". Clicking CANCEL a 2nd time will cause ControlSetValue to write this "11" to Graphics_Quality resulting in max graphics settings which will be applied next time you press APPLY or OKAY.

Use this little snippet to see how these two values change while you do this. The first displayed number is Graphics_Quality:GetValue() and the second is Graphics_Quality.value.

Lua Code:
  1. local valA, valB
  2. local function PrintQualityVals()
  3.     if Graphics_Quality then
  4.         local valANew = Graphics_Quality:GetValue()
  5.         local valBNew = Graphics_Quality.value
  6.         valANew = valANew or "nil"
  7.         valBNew = valBNew or "nil"
  8.         if (valA ~= valANew) or (valB ~= valBNew) then
  9.             valA = valANew
  10.             valB = valBNew
  11.             print("QualityValues: "..valA.." -- "..valB)
  12.         end
  13.     end
  14. end
  15. PlayerFrame:HookScript("OnUpdate",PrintQualityVals)

Temporary Workaround
My poor laptop can't handle the max graphics settings so I'm using this snippet as a simple workaround
Lua Code:
  1. local function ToggleNoClick(self)
  2.     if self:GetName() == "Display_" then
  3.         Graphics_Quality.noclick = true
  4.     elseif self:GetName() == "Graphics_" then
  5.         Graphics_Quality.noclick = false
  6.     end
  7. end
  8. hooksecurefunc("VideoOptionsPanel_Cancel",ToggleNoClick)

This workaround leverages this conditional in the "onvaluechanged" method of Graphics_Quality https://github.com/tomrus88/Blizzard...Levels.lua#L97

Here's the workaround as a macro for those that prefer it
/run hooksecurefunc("VideoOptionsPanel_Cancel",function(s)local g=Graphics_Quality local n=s:GetName()if s:GetName()=="Display_" then g.noclick=true elseif s:GetName()=="Graphics_" then g.noclick=false end end)

Last edited by whatisxml : 10-16-16 at 09:16 AM.
10-25-16, 05:22 PM   #2
A Murloc Raider
whatisxml's Avatar
Join Date: Jun 2016
Posts: 9
This has been fixed with 7.1

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » Graphics auto-setting to highest setting (and temporary workaround)

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