Skip to content

Conversation

@Humeian
Copy link
Contributor

@Humeian Humeian commented Jun 25, 2025

Cleans up Battlegrounds Hero & Trinket picking overlays to use the same new SwiftUi view:
Old:
Screenshot 2025-06-20 at 11 46 33 AM
Screenshot 2025-06-20 at 11 38 52 AM

New:
Screenshot 2025-06-25 at 4 13 30 PM
Screenshot 2025-06-25 at 4 25 26 PM

Additionally adds some text bolding to the battlegrounds session headers for increased clarity

@Humeian Humeian requested a review from fmoraes74 June 25, 2025 20:46
@beheh
Copy link
Contributor

beheh commented Jul 1, 2025

This looks so much better! I can't give constructive feedback on the added code, but the visuals are much closer to HDT.
@fmoraes74 would you be able to peek at the code and see if anything jumps out to you? Thanks!

@Humeian I think one more pass on a few of the sizes, and then we should merge this ASAP:

I've created a split view for the different elements (HDT is the right one and HSTracker the left one, respectively):
image

Based on that, here's some visual feedback:

  • the Avg Placement and Pick Rate boxes can generally shrink:
    • the text size is fine, it's really just the layout around it
    • the purple header sections can be a little smaller (leading to less padding for the text)
    • less padding around the placement/pick rate number itself
  • the tier box can loose a few pixels in all directions (to keep the top aligned)
  • the tier letter can be a tiny bit larger, so that it closer in width to the "TIER" txt

Here's the full screenshot from HDT for direct comparison:
image

@fmoraes74
Copy link
Contributor

I am curious why I don't see this difference with the existing code. I am worried about the duplication of UIs with this solution as I'd not have two different ways to handle the same UI.

The choice is to either figure out what's wrong with the AppKit version or make HST require 10.15 and above, even though Hearthstone still has a minimum requirement of 10.14.

Also, there is duplicate code for the Color extension as there is one already that pretty much does the same thing. I will take a closer look at this tonight but I'd rather not have duplicate UIs

@available(macOS 10.15, *)
// Extend SwiftUI color to be able to accept hex string that avgPlacementColor is generating
// from the placement value. Implementation from: https://blog.eidinger.info/from-hex-to-color-and-back-in-swiftui
extension Color {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code seems to be duplicate of the code in HSTracker/Core/Extensions/Color.swift. A convenience constructor already exists to use a NSColor and crease a Color object, so this seems like duplicate code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I didn't see that, the convenience constructor to convert from NSColor to Color requires macOS 12.0 and would add and extra conversion step, so instead I've abstracted the logic from taking hex into RBGA and used that single function for converting hex to NSColor & Color

@fmoraes74
Copy link
Contributor

I looked at the code and in general I don't have a problem except for having duplicate code. So, I would vote for picking one or the other as the way to go. So, either we figure out why AppKit is not working on other systems or we raise the minimum HST version to 10.15 which I assume Hearthstone will do next time they update Unity

@Humeian Humeian force-pushed the battlegrounds-ux-clarity branch from 4dc9649 to 13ab848 Compare July 3, 2025 15:28
@Humeian
Copy link
Contributor Author

Humeian commented Jul 3, 2025

I have updated the visuals to match more closely with HDT:
Screenshot 2025-07-03 at 11 23 49 AM

As far as the duplicate code, I left the existing AppKit implementation there as a fallback to not take away existing functionality from 10.14 users. I definitely agree that we should not be actively maintaining both, and if we want to go forward with additional development in swiftUI we should likely just increase the minimum requirement to match

@beheh
Copy link
Contributor

beheh commented Jul 3, 2025

Let's just hold on this until we can chat more on Discord with fmoraes74 about how we want to proceed with SwiftUI/10.15 vs continuing to support 10.14.

@azeier azeier force-pushed the master branch 14 times, most recently from d653ee6 to aa3f672 Compare November 21, 2025 23:54
@azeier azeier force-pushed the master branch 6 times, most recently from c04662e to 15ecafb Compare December 8, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants