GSE: Sequences, Variables, Macros

GSE: Sequences, Variables, Macros

6M Downloads

[BUG] GSE is corrupting text justification of other add-ons (+ fix)

tflo opened this issue · 1 comments

commented

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:

  1. First, let’s get a clean environment:
    1. Quit the WoW Retail client.
    2. Rename your ‘AddOns’ folder (located in _retail_/Interface/) to ‘AddOns--normal’.
    3. Create an empty folder at the same location and name it ‘AddOns’
    4. Copy your GSE folders from the renamed AddOns folder into the new one.
    5. Download TinyPad and install it in the new AddOns folder.
    6. The folder now should only contain GSE and TinyPad.
  2. Start the WoW client and log in.
  3. Open TinyPad and write some lines into an edit box. Close TinyPad.
  4. Open the GSE sequence panel by entering /gs in the chat console.
  5. Close GSE and open TinyPad again.
  6. 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:

  1. 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.

  2. 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

commented

Tom this is the most amazing description I have ever seen! Thank you for both the time it took to figure this out and the way you have written it.

Have made those changes and will release immediately.