Skip to content

Commit

Permalink
Support for new heroes, closes #62
Browse files Browse the repository at this point in the history
Also, add a verification if hero is found, so HSTracker will not crash if it does not find the hero
  • Loading branch information
bmichotte committed Jun 16, 2015
1 parent 5936acb commit cd7c806
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 21 deletions.
4 changes: 2 additions & 2 deletions app/controllers/huds/timer_hud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ def restart(player)

private
def fire(_)
return if !@player_mulligan and !@opponent_mulligan

@seconds -= 1 if @seconds > 0

return if !@player_mulligan and !@opponent_mulligan

seconds = 90 - @seconds
if @seconds < 10
@label.flash
Expand Down
9 changes: 6 additions & 3 deletions app/hearthstone/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def handle_end_game
:duration => (@end_date.timeIntervalSince1970 - @start_date.timeIntervalSince1970).to_i,
:deck_id => @current_deck.hearthstats_id,
:deck_version_id => @current_deck.hearthstats_version_id,
:oppclass => @current_opponent.player_class,
:oppclass => @current_opponent ? @current_opponent.player_class : nil,
:oppname => @opponent_name || nil,
:notes => nil,
:ranklvl => @current_rank,
Expand Down Expand Up @@ -233,8 +233,11 @@ def player_get_to_deck(card_id, turn)
end

def player_hero(hero_id)
log(:player, "hero is #{hero_id} (#{Card.hero(hero_id).name})")
player_tracker.set_hero(hero_id)
hero = Card.hero(hero_id)
if hero
log(:player, "hero is #{hero_id} (#{hero.name})")
player_tracker.set_hero(hero_id)
end
end

def player_draw(card_id, turn)
Expand Down
6 changes: 4 additions & 2 deletions app/utilities/database_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class DatabaseGenerator
include CDQ

# usefull if we need to force reloading of database
DATABASE_VERSION = 4
DATABASE_VERSION = 5

Log = Motion::Log

Expand Down Expand Up @@ -46,7 +46,9 @@ def load(splash, &block)
'Promotion',
'Curse of Naxxramas',
'Goblins vs Gnomes',
'Blackrock Mountain'
'Blackrock Mountain',
'Hero Skins',
'Tavern Brawl'
]
splash.max(langs.size) if splash

Expand Down
2 changes: 1 addition & 1 deletion resources/cards/cardsDB.deDE.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.enGB.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.enUS.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.esES.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.esMX.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.frFR.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.itIT.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.koKR.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.plPL.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.ptBR.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.ptPT.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.ruRU.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.zhCN.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/cards/cardsDB.zhTW.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions versions.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### 0.11.2
- Correct a bug where HSTracker will crash when canceling a modal dialog in the deck manager
- Support for new heroes

#### 0.11.1
- Correct a bug where the last deck was deleted on right-click instead of the selected one
- Add a verification for the config.log file
Expand Down

0 comments on commit cd7c806

Please sign in to comment.