WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Tutorials & Other Helpful Info. (https://www.wowinterface.com/forums/forumdisplay.php?f=12)
-   -   Backdrop (in XML) doesn't show even after adjusting to 9.0 patch (https://www.wowinterface.com/forums/showthread.php?t=59153)

Kesselero 06-20-22 01:41 PM

Backdrop (in XML) doesn't show even after adjusting to 9.0 patch
 
Hey,

so im trying to get a backdrop of a frame to show up, I'm not getting any errors and the frame seems to load fine but without any textures applied to it.

I just copy pasted the example from https://github.com/Stanzilla/WoWUIBu...system-changes just to test but nothing happens.

Code:

<Frame name="TestFrame" parent="UIParent" inherits="BackdropTemplate">
    <KeyValues>
        <KeyValue key="backdropInfo" value="BACKDROP_TOOLTIP_16_16_5555" type="global"/>
        <KeyValue key="backdropBorderColor" value="LEGENDARY_ORANGE_COLOR" type="global"/>
        <KeyValue key="backdropBorderColorAlpha" value="0.25" type="number"/>
    </KeyValues>
    <Size x="300" y="300"/>
    <Anchors>
        <Anchor point="CENTER"/>
    </Anchors>
    <Scripts>
        <OnLoad inherit="prepend">
            print("Loaded!");
        </OnLoad>
    </Scripts>
</Frame>

Using /fstack I can click the frame in the center of my screen but no texture is showing

Thanks for helping!

Mimma 06-20-22 02:22 PM

The code works for me if I change the backdropInfo to another one than BACKDROP_TOOLTIP_16_16_5555 - for example BACKDROP_ARENA_32_32.

Kesselero 06-20-22 04:25 PM

Quote:

Originally Posted by Mimma (Post 340723)
The code works for me if I change the backdropInfo to another one than BACKDROP_TOOLTIP_16_16_5555 - for example BACKDROP_ARENA_32_32.

Weird, but it does work! Thank you

Fizzlemizz 06-20-22 08:37 PM

BACKDROP_TOOLTIP_16_16_5555 doesn't exist (anymore?)

Xrystal 06-20-22 08:52 PM

Doesn't seem to be in Backdrop.lua - 9.1.5 version here - https://github.com/Gethe/wow-ui-sour...L/Backdrop.lua

Nor in the GameTooltip.lua file from 9.2.5 - https://github.com/Gethe/wow-ui-sour...ameTooltip.lua


Looks like I will have to find another frame for my backdrops as I think I was using that for all my addons. And there I was hoping I wouldn't have to do anything until I got access to Dragonflight, seeing as there could be some hefty UI changes there based on the talk they streamed.


Yep, my Mage Portal addon needed adjusting - obviously no-one using it as have had no reports of problems in months. Anyway. I put this block of code in one of my lua files that loaded before the file needing access to it.

Lua Code:
  1. XRYSTAL_BACKDROP_TOOLTIP_16_16_5555 = {
  2.     bgFile = "Interface\Tooltips\UI-Tooltip-Background",
  3.     edgeFile = "Interface\Tooltips\UI-Tooltip-Border",
  4.     tile = true,
  5.     tileEdge = true,
  6.     tileSize = 16,
  7.     edgeSize = 16,
  8.     insets = { left = 5, right = 5, top = 5, bottom = 5 },
  9. };

This is the closest to what the addon original had before switching to the built in layout. Obviously being a public table in my case I had to give it a unique name. You could perhaps use a localised variable instead.

SDPhantom 06-22-22 04:23 PM

I noticed a lot of backdrop constants moved over to SharedXML\NineSliceLayouts.lua a while ago. Gethe has commits on it going back to 9.1.5.

These are applied using NineSliceUtil.ApplyLayout(). BackdropTemplate is basically a NineSlice frame, so you can pass it directly to NineSliceUtil.



If you insist on using XML, here are a few templates that might interest you.Ultimately, it's NineSlicePanelTemplate/NineSliceCodeTemplate that handles applying the layout. You can inherit NineSlicePanelTemplate directly and set the layoutType key there if you aren't going to use the backdropColor or backdropColorAlpha keys.



If you're interested in how BackdropTemplate converts the old backdrop tables into NineSlice layouts, BackdropTemplateMixin:ApplyBackdrop() handles that passing BackdropTemplateMixin:SetupPieceVisuals() as the optional setup function.

Xrystal 06-22-22 05:37 PM

Oh thanks .. worth noting for the future. I totally forgot about the NineSlice stuff when I was looking.

SDPhantom 06-22-22 05:48 PM

I haven't watched any of the streams. I just don't have the time or attention span really for that format of media. Even so, the way BackdropTemplate was coded, it seems like it's a bridge between the old backdrop layouts and the NineSlice system. I would venture a guess that they're in the middle of converting everything to NineSlice and the old Backdrop is going away permanently.

With how much older code used the Backdrop system, it would take substantial effort to convert all of it at once and it was easier to move the new implementation forward this way to buy more time.

Xrystal 06-22-22 07:08 PM

Well they have said the UI has had a big revamp for Dragonflight. Maybe this is one of those things that are enroute to that.

I'm already under the understanding that I may not need some of my addons or they may need rewrites etc. So hopefully I'll get into testing to see how things look. Otherwise, people will have to wait until I've had time to test and fix/rewrite things :)

I recall NineSlice as something sneaking into dominance in the last expansion so maybe this one is pushing them forward again as you say to be the next system to use.


All times are GMT -6. The time now is 07:01 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI