Quantcast
Supporting multiple clients - WoWInterface
Thread Tools Display Modes
05-24-21, 10:34 AM   #1
fullmoon_sulfuras
A Murloc Raider
Join Date: Dec 2019
Posts: 6
Supporting multiple clients

Hi there! I'm working on fixing LunarSphere for TBC Classic and wed like to have it working for the three clients: Retail, Classic, and BCC. The Backdrop System Changes seems the most problematic to handle, as every single frame creation will have an extra argument for inheriting from `BackdropTemplate` for Retail and BCC, but not for Classic.

Any elegant way to handle this? I didn't want to pepper the code with `if` on every single frame declaration.

Perhaps defining a `BackdropTemplate` only for the Classic client?

We have some frame templates defined in XML, so I'm guessing we would need to define the template in XML as well (because it's parsed before the Lua code).

Thanks!
  Reply With Quote
05-24-21, 10:52 AM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 814
See https://www.wowinterface.com/forums/...19&postcount=8 for more ...
Something like this should do the trick ...
Lua Code:
  1. local f = CreateFrame("Frame", nil, self, BackdropTemplateMixin and "BackdropTemplate")

For xml-files I'd recommend to take a look at the new toc-change mentioned here ... https://github.com/Stanzilla/WoWUIBu...ment-830351390

This way you can have different xml-files loaded by providing client-based toc files.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
05-24-21, 01:26 PM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,417
An alternative with xml to using different files is to use:
Code:
<OnLoad inherit="prepend">
     OnLoadFunc(self)
</OnLoad>
And then in OnLoadFunc before using any SetBackdropXxx calls use:

Lua Code:
  1. if BackdropTemplateMixin then
  2.     Mixin(self, BackdropTemplateMixin)
  3. end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-24-21 at 01:29 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Supporting multiple clients

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