Skip to content

Commit

Permalink
Version 2.3.10
Browse files Browse the repository at this point in the history
Updated for patch 25.6
  • Loading branch information
fmoraes74 committed Mar 15, 2023
1 parent 53a8516 commit 6bfa8b8
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 65 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.3.10
## New
- Updated for patch 25.6.0

# 2.3.9
## New
- Updated for patch 25.4.3
Expand Down
4 changes: 2 additions & 2 deletions HSTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3918,7 +3918,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/downloaded-frameworks/mono/runtimes/osx-x64/native";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 2.3.9;
MARKETING_VERSION = 2.3.10;
OTHER_CFLAGS = "$(inherited)";
OTHER_CODE_SIGN_FLAGS = "--deep";
OTHER_LDFLAGS = "$(inherited)";
Expand Down Expand Up @@ -3963,7 +3963,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/downloaded-frameworks/mono/runtimes/osx-x64/native";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 2.3.9;
MARKETING_VERSION = 2.3.10;
OTHER_CODE_SIGN_FLAGS = "--deep";
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = net.hearthsim.hstracker;
Expand Down
2 changes: 1 addition & 1 deletion HSTracker/BobsBuddy-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.7
1.9.8
1 change: 1 addition & 0 deletions HSTracker/BobsBuddy/BobsBuddyErrorState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ enum BobsBuddyErrorState: Int {
case unknownCards
case failedToLoad
case monoNotFound
case unsupportedCards
}
10 changes: 10 additions & 0 deletions HSTracker/BobsBuddy/BobsBuddyInvoker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,10 @@ class BobsBuddyInvoker {
return e?.card.id == "unknown"
}

func isUnsupportedCard(e: Entity?) -> Bool {
return e?.card.id == CardIds.NonCollectible.Invalid.ProfessorPutricide_Festergut1 || e?.card.id == CardIds.NonCollectible.Invalid.ProfessorPutricide_Festergut2
}

func wasHeroPowerUsed(heroPower: Entity?) -> Bool {
return (heroPower?.has(tag: GameTag.exhausted) ?? false || heroPower?.has(tag: GameTag.bacon_hero_power_activated) ?? false)
}
Expand Down Expand Up @@ -600,6 +604,12 @@ class BobsBuddyInvoker {
return
}

if game.player.board.any(isUnsupportedCard) || game.opponent.board.any(isUnsupportedCard) {
errorState = .unsupportedCards
logger.debug("Board has unsupported cards. Exiting")
return
}

guard let races = game.availableRaces else {
errorState = .unknownCards
logger.error("Game has no available races. Exiting")
Expand Down
2 changes: 2 additions & 0 deletions HSTracker/BobsBuddy/StatusMessageConverter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class StatusMessageConverter {
case .monoNotFound:
return NSLocalizedString("Mono not found", comment: "")
//case .updateRequired:
case .unsupportedCards:
return NSLocalizedString("Found unsupported cards", comment: "")
default:
return NSLocalizedString("Unknown error", comment: "")
}
Expand Down
2 changes: 2 additions & 0 deletions HSTracker/Logging/CardIds/Invalid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ extension CardIds.NonCollectible {
static let HeroicDifficulty: String = "FB_LK_BossSetup001b"
static let NormalDifficulty: String = "FB_LK_BossSetup001c"
static let DiabolicalPowersTavernBrawl: String = "TB_SPT_DPromoHP"
static let ProfessorPutricide_Festergut1 = "BG25_HERO_100_Buddy"
static let ProfessorPutricide_Festergut2 = "BG25_HERO_100_Buddy_G"
}
}

5 changes: 3 additions & 2 deletions HSTracker/Logging/Enums/CardSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ enum CardSet: String, CaseIterable {
revendreth,
mercenaries_dev,
return_of_the_lich_king,
path_of_arthas
path_of_arthas,
battle_of_the_bands

static func deckManagerValidCardSets() -> [CardSet] {
return [.all, .vanilla, .core, .basic, .expert1, .naxx, .gvg, .brm, .tgt,
Expand All @@ -65,7 +66,7 @@ enum CardSet: String, CaseIterable {
.dalaran, .uldum, .dragons, .year_of_the_dragon,
.black_temple, .demon_hunter_initiate, .scholomance, .darkmoon_faire,
.the_barrens, .wailing_caverns, .stormwind, .alterac_valley,
.the_sunken_city, .revendreth, .return_of_the_lich_king, .path_of_arthas ]
.the_sunken_city, .revendreth, .return_of_the_lich_king, .path_of_arthas, .battle_of_the_bands ]
}

static func wildSets() -> [CardSet] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class BattlegroundsHeroPicking: OverWindowController {
// logger.debug("Window: \(window.frame)")
}

func setSelectedHeroDbfId(_ heroId: Int) {
viewModel.selectedHeroDbfId = heroId
}

func update(_ property: String?) {
let all = property == nil

Expand All @@ -80,6 +84,7 @@ class BattlegroundsHeroPicking: OverWindowController {
if let heroes = viewModel.heroStats {
for hero in heroes {
let heroView = BattlegroundsSingleHeroStats(frame: NSRect(x: 0, y: 0, width: 266, height: 480), viewModel: hero)
heroView.setSelectedHeroDbfIdCommand = setSelectedHeroDbfId
itemsStack.addArrangedSubview(heroView)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class BattlegroundsHeroPickingViewModel: ViewModel {
if let selectedHeroIndex {
let direction = (selectedHeroIndex >= heroStats.count / 2) ? -1 : 1
for i in 0 ..< heroStats.count {
heroStats[i].setHiddenByHeroPower(i == selectedHeroIndex + direction)
heroStats[i].setHiddenByHeroPower(i == selectedHeroIndex + direction || i == selectedHeroIndex + 2 * direction)
}
} else {
for i in 0 ..< heroStats.count {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ class BattlegroundsSingleHeroStats: NSView {

@IBOutlet weak var battlegroundsHeroHeader: BattlegroundsHeroHeader!
@IBOutlet weak var heroPortraitContainer: NSView!
@IBOutlet weak var armorTierLabel: NSTextField!
@IBOutlet weak var compositions: BattlegroundsCompositionPopularity!

@IBOutlet weak var armorTierTooltipRange: NSView!

let viewModel: BattlegroundsSingleHeroViewModel

var setSelectedHeroDbfIdCommand: ((_ heroId: Int) -> Void)?

override var intrinsicContentSize: NSSize {
return NSSize(width: 266, height: 480)
}
Expand All @@ -40,23 +41,41 @@ class BattlegroundsSingleHeroStats: NSView {
contentView.translatesAutoresizingMaskIntoConstraints = true
addSubview(contentView)
contentView.frame = self.bounds

viewModel.propertyChanged = { name in
DispatchQueue.main.async {
self.update(name)
}
}

// heroPortraitContainer.customToolTip = armorTierTooltipRange

let trackingArea = NSTrackingArea(rect: NSRect.zero,
options: [NSTrackingArea.Options.inVisibleRect, NSTrackingArea.Options.activeAlways, NSTrackingArea.Options.mouseEnteredAndExited],
owner: self,
userInfo: nil)
heroPortraitContainer.addTrackingArea(trackingArea)

compositions.viewModel = viewModel.bgsCompsPopularityVM
battlegroundsHeroHeader.viewModel = viewModel.bgsHeroHeaderVM

update()
}

func update() {
func update(_ property: String? = nil) {
battlegroundsHeroHeader.isHidden = !viewModel.heroPowerVisibility
if let armorTier = viewModel.armorTier {
armorTierLabel.intValue = Int32(armorTier)
} else {
armorTierLabel.stringValue = "" // em dash
if property == nil {
compositions.update()
}
compositions.update()
}

override func mouseEntered(with event: NSEvent) {
if let id = viewModel.heroDbfId {
setSelectedHeroDbfIdCommand?(id)
}
}

override func mouseExited(with event: NSEvent) {
setSelectedHeroDbfIdCommand?(0)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="BattlegroundsSingleHeroStats" customModule="HSTracker" customModuleProvider="target">
<connections>
<outlet property="armorTierLabel" destination="ocd-0X-qDy" id="f3w-tH-UBC"/>
<outlet property="armorTierTooltipRange" destination="ltz-0w-Isv" id="ZCa-Br-y9q"/>
<outlet property="battlegroundsHeroHeader" destination="dJn-dd-3p5" id="2M5-ai-Xdl"/>
<outlet property="compositions" destination="5q0-Cd-eRk" id="wMX-p5-ikQ"/>
Expand All @@ -31,47 +30,8 @@
</customView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="u1e-O1-gPf" userLabel="HeroPortraitContainer">
<rect key="frame" x="15" y="132" width="236" height="276"/>
<subviews>
<box boxType="custom" cornerRadius="5" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="8wp-RW-7UV">
<rect key="frame" x="92" y="35" width="106" height="25"/>
<view key="contentView" id="AiW-BE-n3a">
<rect key="frame" x="1" y="1" width="104" height="23"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" verticalCompressionResistancePriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="EgL-rE-BvX">
<rect key="frame" x="13" y="4" width="65" height="15"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Armor Tier" id="Emk-Rp-gHT">
<font key="font" metaFont="cellTitle"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="deviceRGB"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ocd-0X-qDy">
<rect key="frame" x="78" y="4" width="13" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="4" id="CbP-J2-cj6">
<font key="font" metaFont="systemBold"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="deviceRGB"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="ocd-0X-qDy" firstAttribute="centerY" secondItem="AiW-BE-n3a" secondAttribute="centerY" id="RDx-UA-sGV"/>
<constraint firstItem="EgL-rE-BvX" firstAttribute="top" secondItem="AiW-BE-n3a" secondAttribute="top" constant="4" id="Xgi-YC-fed"/>
<constraint firstAttribute="bottom" secondItem="EgL-rE-BvX" secondAttribute="bottom" constant="4" id="Ys8-CC-xpi"/>
<constraint firstAttribute="trailing" secondItem="ocd-0X-qDy" secondAttribute="trailing" constant="15" id="erp-jv-Ru4"/>
<constraint firstItem="EgL-rE-BvX" firstAttribute="leading" secondItem="AiW-BE-n3a" secondAttribute="leading" constant="15" id="fNT-qx-fXk"/>
<constraint firstItem="ocd-0X-qDy" firstAttribute="leading" secondItem="EgL-rE-BvX" secondAttribute="trailing" constant="4" id="oaE-Jg-ecG"/>
</constraints>
</view>
<color key="borderColor" red="0.21176470589999999" green="0.086274509799999996" blue="0.2156862745" alpha="1" colorSpace="deviceRGB"/>
<color key="fillColor" red="0.078431372550000003" green="0.086274509799999996" blue="0.090196078430000007" alpha="1" colorSpace="custom" customColorSpace="deviceRGB"/>
</box>
</subviews>
<constraints>
<constraint firstAttribute="width" constant="236" id="Evg-vn-ueL"/>
<constraint firstAttribute="trailing" secondItem="8wp-RW-7UV" secondAttribute="trailing" constant="38" id="UZm-gL-IJd"/>
<constraint firstAttribute="bottom" secondItem="8wp-RW-7UV" secondAttribute="bottom" constant="35" id="ilx-LY-VdE"/>
</constraints>
</customView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="5q0-Cd-eRk" userLabel="Compositions" customClass="BattlegroundsCompositionPopularity" customModule="HSTracker" customModuleProvider="target">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,9 @@ class BattlegroundsSingleHeroViewModel: ViewModel {
let bgsCompsPopularityVM: BattlegroundsCompositionPopularityViewModel?

private(set) var heroDbfId: Int?
private(set) var armorTier: Int?

var armorTierTooltipRange: String? {
guard let armorTier else {
return nil
}
let (_min, _max) = (2...7 ~= armorTier) ? (armorTier, armorTier + 3) : (0, 0)
return String(format: NSLocalizedString("BattlegroundsHeroPicking_Hero_ArmorTierTooltip_Range", comment: ""), _min, _max)
}


init(stats: BattlegroundsSingleHeroPickStats, onPlacementHover: @escaping ((_ isVisible: Bool) -> Void)) {
heroDbfId = stats.hero_dbf_id
armorTier = Cards.getBattlegroundsHeroFromDbfid(dbfId: stats.hero_dbf_id)?.battlegroundsArmorTier
bgsHeroHeaderVM = BattlegroundsHeroHeaderViewModel(tier: stats.tier, avgPlacement: stats.avg_placement, pickRate: stats.pick_rate, placementDistribution: stats.placement_distribution, onPlacementHover: onPlacementHover)
if stats.first_place_comp_popularity.count > 0 {
bgsCompsPopularityVM = BattlegroundsCompositionPopularityViewModel(compsData: stats.first_place_comp_popularity)
Expand Down
2 changes: 1 addition & 1 deletion HSTracker/cards-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
165029
168788
2 changes: 2 additions & 0 deletions Translations/macOS/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
"REVENDRETH" = "Murder at Castle Nathria";
"RETURN_OF_THE_LICH_KING" = "March of the Lich King";
"PATH_OF_ARTHAS" = "Path of Arthas";
"BATTLE_OF_THE_BANDS" = "Festival of Legends";

/* card type */
"all_types" = "All";
Expand Down Expand Up @@ -228,6 +229,7 @@
"Previous Combat" = "Previous Combat";
"Show Previous Combat" = "Show Previous Combat";
"Awaiting Shopping Phase" = "Awaiting Shopping Phase";
"BobsBuddyStatusMessage_UnsupportedCards" = "Found unsupported cards";

/* Battlegrounds */
"Turn" = "Turn";
Expand Down

0 comments on commit 6bfa8b8

Please sign in to comment.