From 1d003be0290b1b7a88b8411911dc5d8a9e6510da Mon Sep 17 00:00:00 2001 From: Jove Zhong Date: Sun, 24 May 2015 18:33:05 +0800 Subject: [PATCH 1/4] update CardDefs XML parsing --- tools/extract-card-data.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/extract-card-data.coffee b/tools/extract-card-data.coffee index 0743f40..9b930c3 100644 --- a/tools/extract-card-data.coffee +++ b/tools/extract-card-data.coffee @@ -19,13 +19,13 @@ xml2js.parseString cards, (err, result) -> id: card.$.CardID for tag in card.Tag - switch tag.$.name - when 'CardName' + switch tag.$.enumID + when '185' data.name = tag._ - when 'CardTextInHand' - data.text = tag.$.value + when '184' + data.text = tag._ else - data[tag.$.name.toLowerCase()] = tag.$.value + data[tag.$.enumID] = tag.$.value cardData[data.id] = data From eb483227dedbb528880b80c8d517fe6ec35f3f01 Mon Sep 17 00:00:00 2001 From: Jove Zhong Date: Sun, 24 May 2015 21:04:58 +0800 Subject: [PATCH 2/4] upgrade cap from 0.0.10 to 0.0.15. Otherwise the capture.js doesn't work for me --- capture/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capture/package.json b/capture/package.json index e5beca8..2eee2db 100644 --- a/capture/package.json +++ b/capture/package.json @@ -9,7 +9,7 @@ "author": "", "license": "ISC", "dependencies": { - "cap": "0.0.10", + "cap": "0.0.15", "minimist": "^1.1.0", "node-protobuf": "^1.2.1" } From 07249923d6f16d5d30f28ad8cbce21faf57e89a1 Mon Sep 17 00:00:00 2001 From: Jove Zhong Date: Sun, 24 May 2015 22:06:02 +0800 Subject: [PATCH 3/4] call reset() for onCreateGame. Otherwise the entities is null --- src/app/game-manager.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/game-manager.coffee b/src/app/game-manager.coffee index c7075ae..5523a18 100644 --- a/src/app/game-manager.coffee +++ b/src/app/game-manager.coffee @@ -229,6 +229,7 @@ module.exports = class GameManager size = @gameView.opponentHandView.addCard entity.name onCreateGame: (message) -> + @reset()#need call this, otherwise the entities is null getEntity: (entity, update=true) -> if @entities[entity.id] From 34915e9c80c859e6c29d8e4b426c4e085a127ed7 Mon Sep 17 00:00:00 2001 From: Jove Zhong Date: Sun, 24 May 2015 22:14:15 +0800 Subject: [PATCH 4/4] update README.md, adding more instructions to install package and run with sudo --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9068bdc..0c4eb13 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ You can download Hearthdash from the [releases](https://github.com/postcasio/hea ### Requirements * OS X, Windows -* nodejs v0.10 +* nodejs v0.12 * coffee-script * protobuf @@ -34,10 +34,18 @@ Homebrew is the best way to install Node and protobufs on OS X: ### Building - cd tools + npm install + cd capture + npm install + cd ../tools npm install coffee build.coffee --card-xml-path= -Where `path` is the path to the `cardxml0.unity3d` file in the Hearthstone Data directory. +Where `path` is the path to the `cardxml0.unity3d` file in the Hearthstone Data directory. If you don't set this paramater, default value is /Applications/Hearthstone/Data/OSX/cardxml0.unity3d Hearthdash should now be in the `build` directory. + +You probably need run with sudo to make sure it can capture network packs. + + sudo build/Hearthdash.app/Contents/MacOS/Atom +