[BUG] GSE is corrupting text justification of other add-ons (+ fix)
tflo opened this issue · 1 comments
WoW Retail – GSE 3.0.55
I installed GSE yesterday and noticed that opening the sequence panel corrupts the text alignment (justification) of some other add-ons (formerly left aligned text becomes a center-aligned mess).
This is probably related to issue #693, however I’m on Retail and it does not affect my Tradeskill window, like in the other thread.
The affected add-ons are at least TinyPad and M6, but probably more. Unlike in the other issue, I can definitely exclude any interferences by outdated Ace libraries or such.
To reproduce:
- First, let’s get a clean environment:
- Quit the WoW Retail client.
- Rename your ‘AddOns’ folder (located in _retail_/Interface/) to ‘AddOns--normal’.
- Create an empty folder at the same location and name it ‘AddOns’
- Copy your GSE folders from the renamed AddOns folder into the new one.
- Download TinyPad and install it in the new AddOns folder.
- The folder now should only contain GSE and TinyPad.
- Start the WoW client and log in.
- Open TinyPad and write some lines into an edit box. Close TinyPad.
- Open the GSE sequence panel by entering
/gs
in the chat console. - Close GSE and open TinyPad again.
- You should now notice that your previously entered text has become center-aligned.
TinyPad is just an example. You can also use any other add-on that exhibits the bug.
To fix:
-
In GSE_GUI Viewer.lua, comment out line 86…
-- local font = GameFontNormal:GetFontObject()
…and add these lines:
local font = CreateFont("seqPanelFont") font:SetFontObject(GameFontNormal)
Save the file. The sequence panel (viewer) should now no longer corrupt the global text justification. Reload your client UI and verify.
-
Another instance of
GameFontNormal:GetFontObject()
is in the Editor.lua file, at line 2014. Change it analogously to above, to prevent the Editor panel from doing the same as the Viewer before.
Please note that I am not familiar with the WoW API, nor with Lua. The above fix works for me, but there is probably a more correct or/and elegant way to do it!
If I understood the sparse API documentation on wowpedia correctly, the issue seems to lie in GetFontObject
creating a reference to the original (global) font object, as opposed to creating a local copy of the object (as with CreateFont
and then SetFontObject
).
If this fix works for you too, or you found a better one, then you should probably also fix the fontlarge
declarations in both files.
– Tom