Skamer / Syling-Tracker

12 stars 2 forks source link

[Cata Classic] Cosmetic: Minimize button on tracker + headers not visible #113

Closed Road-block closed 2 months ago

Road-block commented 2 months ago

Describe the bug The bug is cosmetic. The minimize button on the headers does not draw (or perhaps it draws at the wrong layer and is simply not vislble) It still works by clicking in its general area, but there's no visual indication the category is collapsible if you don't know the minimize button should be right about here.

Do you have an error log of what happened? If you don't see any errors, make sure that error reporting is enabled (/console scriptErrors 1) or install BugSack. There are no Lua errors

To Reproduce Steps to reproduce the behavior: Track a couple quests.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. image

What is the version of SylingTracker you use ? 2.5.3

What are the versions of PLoop and Scorpio you use ?

Additional context I'm not playing retail but having an invisible clickable area felt strange (it is not a 2.5.3 problem it was this way from the first Cata Classic version I installed) The preview on the addon page also suggests the minimize button should be visible sylingtracker_v2

Road-block commented 2 months ago

I don't want to open another ticket so I'll tack on another mostly cosmetic issue.

When tracking an achievement, the criteria are shown appropriately (which are completed and which are not) The same happens after a /reloadui.

However they don't refresh on a cold login. I'm going to guess it's a timing issue. (info not yet returned by the game when the addon asks for it, when it's a fresh login) In any case it's minor as they will update when something changes.

Road-block commented 2 months ago

Both the minimize button for the whole tracker is invisible as well as the minimize button of the header which I initially reported.

Road-block commented 2 months ago

tracker-minimize

Road-block commented 2 months ago

header-minimize Additionally while I can find RegisterUISetting("content.header.showMinimizeButton", true) at \Core\UI\Views\ContentView.lua

I cannot see an option for it in either quest or achievement header section of the options. Regardless of the option being user facing, the buttons actually exist and are clickable, they're just invisible.

Road-block commented 2 months ago

Ok after some more digging I think I found the issue. /Core/Tracker.lua#L1300 + 1303

None of "common-button-dropdown-closed" "common-button-dropdown-closedpressed" "common-button-dropdown-open" atlas identifiers exist for the Cataclysm Client (4.4.0 live client at least, maybe things will change in a month for 4.4.1)

Similarly /Core/UI/Views/ContentView.lua#L159 + 162 None of "UI-HUD-Minimap-Zoom-Out" "UI-HUD-Minimap-Zoom-In" exist either.

I haven't yet looked for alternatives that exist on both clients.

Edit: Live Cataclysm client (4.4.0) entries https://wago.tools/db2/UiTextureAtlasMember?build=4.4.0.56489 PTR (4.4.1, upcoming client) https://wago.tools/db2/UiTextureAtlasMember?build=4.4.1.56574

From what I can see neither the live or the upcoming client will have those atlas.

Road-block commented 2 months ago

All expanded image Header collapsed image Tracker collapsed image

Not too pretty but at least they show. I put some conditionals IsCataclysm() to use these atlas

"minimal-scrollbar-small-arrow-returntobottom"
"minimal-scrollbar-small-arrow-returntobottom-down"
"minimal-scrollbar-small-arrow-top"
"minimal-scrollbar-small-arrow-top-down"

for the tracker and

"minimal-scrollbar-small-arrow-top"
"minimal-scrollbar-small-arrow-bottom"

for the header. Was either that or use some eyesores from RedButtons atlas. Couldn't find anything else that kinda matches the tracker aesthetic.

Road-block commented 2 months ago

/Core/Tracker.lua#L1297

function FromMinizeButtonAtlas(normal)
  return FromUIProperty("Minimized"):Map(function(minimized)
    if minimized then 
      if IsRetail() then
        return normal and AtlasType("common-button-dropdown-closed", false) or AtlasType("common-button-dropdown-closedpressed", false)
      else
        return normal and AtlasType("minimal-scrollbar-small-arrow-returntobottom", false) or AtlasType("minimal-scrollbar-small-arrow-returntobottom-down", false)
      end
    else
      if IsRetail() then
        return normal and AtlasType("common-button-dropdown-open", false) or AtlasType("common-button-dropdown-closedpressed", false)
      else
        return normal and AtlasType("minimal-scrollbar-small-arrow-top", false) or AtlasType("minimal-scrollbar-small-arrow-top-down", false)
      end
    end
  end)
end

I flipped to a IsRetail check as vanilla will probably need the same treatment. and /Core/UI/Views/ContentView.lua#L157 to

        normalTexture = {
          setAllPoints = true, 
          mediaTexture = Wow.FromUIProperty("Expanded"):Map(function(expanded)
            if expanded then 
              if IsRetail() then
                return { atlas = AtlasType("UI-HUD-Minimap-Zoom-Out") }
              else
                return { atlas = AtlasType("minimal-scrollbar-small-arrow-top") }
              end
            end
            if IsRetail() then
              return { atlas = AtlasType("UI-HUD-Minimap-Zoom-In") }
            else
              return { atlas = AtlasType("minimal-scrollbar-small-arrow-bottom") }
            end
          end)
        },

The tracker minimize button looks better at a w:24 h:16 size (the header buttons are already squished) but I didn't know how that makes the retail texture look so I left it alone.

Skamer commented 2 months ago

The tracker minimize button looks better at a w:24 h:16 size (the header buttons are already squished) but I didn't know how that makes the retail texture look so I left it alone.

For the size, we could use different values for Retail and Classic:

{
  -- ... others props
  [TrackerMinimizeButton] = {
    size                              = { width = 24, height = IsRetail() and 24 or 16 },
    registerForClicks                 = { "AnyUp"},
    visible                           = FromUIProperty("Enabled"),
    --  ... other props
  },
}

In the future, i'll see a solution to unify the textures for Retail and Classic.

Road-block commented 2 months ago

2.5.5 works nicely thanks. ❤️