Skip to content

Commit

Permalink
Release v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnymac committed Feb 26, 2017
2 parents 96517eb + 20580e3 commit 9ec98cd
Show file tree
Hide file tree
Showing 43 changed files with 1,731 additions and 1,121 deletions.
8 changes: 4 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"stage-0",
"react"
],
"plugins": ["add-module-exports"],
"plugins": [
"react-hot-loader/babel",
"add-module-exports"
],
"env": {
"production": {
"presets": ["react-optimize"],
"plugins": [
"babel-plugin-dev-expression"
]
},
"development": {
"presets": ["react-hmre"]
},
"test": {
"plugins": [
["webpack-loaders", { "config": "webpack.config.node.js", "verbose": false }]
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"no-use-before-define": 0,
"import/no-unresolved": [2, { "ignore": ["electron"] }],
"import/no-extraneous-dependencies": 0,
"react/prefer-es6-class": [2, "never"],
"react/prefer-es6-class": [2, "always"],
"react/jsx-no-bind": 0,
"react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx"] }],
"react/prefer-stateless-function": 0,
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

**Pok茅Nurse** is a desktop application for Windows and Mac that allows you to manage your pok茅mon from Pok茅mon Go without the need for a mobile device. You can now favorite, transfer, and evolve from the comfort of your own home!

## Downloads for v2.0.3
## Downloads for v2.1.0
You may view all the releases [here](https://github.com/vinnymac/PokeNurse/releases)
* [macOS](https://github.com/vinnymac/PokeNurse/releases/download/v2.0.3/PokeNurse.dmg)
* [Windows](https://github.com/vinnymac/PokeNurse/releases/download/v2.0.3/PokeNurse.exe)
* [Linux 32 bit](https://github.com/vinnymac/PokeNurse/releases/download/v2.0.3/PokeNurse-ia32.deb)
* [Linux 64 bit](https://github.com/vinnymac/PokeNurse/releases/download/v2.0.3/PokeNurse-x64.deb)
* [macOS](https://github.com/vinnymac/PokeNurse/releases/download/v2.1.0/PokeNurse.dmg)
* [Windows](https://github.com/vinnymac/PokeNurse/releases/download/v2.1.0/PokeNurse.exe)
* [Linux 32 bit](https://github.com/vinnymac/PokeNurse/releases/download/v2.1.0/PokeNurse-ia32.deb)
* [Linux 64 bit](https://github.com/vinnymac/PokeNurse/releases/download/v2.1.0/PokeNurse-x64.deb)

## Examples
![Login Window](app/loginExample.png)
Expand Down
4 changes: 2 additions & 2 deletions app/actions/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export default {
useHashingServer: !!hashingKey,
}

// Use API version 0.51 (minimum version for hashing server)
if (hashingKey) options.version = 5100
// Use API version 0.53 (minimum version for hashing server)
if (hashingKey) options.version = 5300

const client = new pogobuf.Client(options)

Expand Down
7 changes: 5 additions & 2 deletions app/actions/trainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,13 @@ function parseInventory(inventory) {

const move2 = getMove(type, moveSettings, p.move_2, false)

const level = utils.getLevelFromCpMultiplier(totalCpMultiplier)

// TODO Use CamelCase instead of under_score for all keys except responses
const pokemonWithStats = {
iv,
type,
level,
evolvesTo,
additional_cp_multiplier: p.additional_cp_multiplier,
cp_multiplier: p.cp_multiplier,
Expand Down Expand Up @@ -220,8 +223,8 @@ function parseInventory(inventory) {
// TODO use map
speciesList.forEach((s) => {
const pokemonSetting = pokemonSettings[s.pokemon_id - 1]
const candyToEvolve = pokemonSetting ? pokemonSetting.candy_to_evolve : 0
s.evolves = utils.getEvolvesCount(candyToEvolve, s)
s.candyToEvolve = pokemonSetting ? pokemonSetting.candy_to_evolve : 0
s.evolves = utils.getEvolvesCount(s.candyToEvolve, s.candy, s.count)
})

return {
Expand Down
7 changes: 7 additions & 0 deletions app/app.global.css
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ tbody > tr > td a {
cursor: pointer;
}

tbody > tr > td .additional-info {
font-size: 11px;
font-weight: 400;
color: #33ab77;
vertical-align: super;
}

.favorite-yellow {
color: #F3BC0A;
}
Expand Down
54 changes: 54 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React, {
PropTypes
} from 'react'
import {
connect,
Provider,
} from 'react-redux'
import { bindActionCreators } from 'redux'

import store from './store'

import Login from './screens/Login'
import Table from './screens/Table'

import {
login
} from './actions'

// Wraps the connected App component in a <Provider>, to provide the redux store.
const provider = (App) => () => <Provider store={store}><App /></Provider> // eslint-disable-line

class App extends React.Component {
static propTypes = {
authenticate: PropTypes.object.isRequired,
autoLogin: PropTypes.bool.isRequired,
login: PropTypes.func.isRequired,
}

componentDidMount() {
const {
autoLogin,
authenticate,
} = this.props

const { credentials } = authenticate

if (autoLogin && credentials.method && credentials.password && credentials.username) {
this.props.login(credentials)
}
}

render() {
if (this.props.authenticate.loggedIn) return (<Table />)

return (<Login />)
}
}

export default provider(connect((state => ({
authenticate: state.authenticate,
autoLogin: state.settings.autoLogin,
})), (dispatch => bindActionCreators({
login
}, dispatch)))(App))
61 changes: 12 additions & 49 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,18 @@
import React, {
PropTypes
} from 'react'
import ReactDOM from 'react-dom'
import {
Provider,
connect
} from 'react-redux'
import { bindActionCreators } from 'redux'

import store from './store'
import Login from './screens/Login'
import Table from './screens/Table'

import {
login
} from './actions'
import React from 'react'
import { render } from 'react-dom'
import { AppContainer } from 'react-hot-loader'

import App from './app'
import './app.global.css'

const App = React.createClass({
propTypes: {
authenticate: PropTypes.object.isRequired,
autoLogin: PropTypes.bool.isRequired,
login: PropTypes.func.isRequired,
},

componentDidMount() {
const {
autoLogin,
authenticate,
} = this.props

const { credentials } = authenticate

if (autoLogin && credentials.method && credentials.password && credentials.username) {
this.props.login(credentials)
}
},

render() {
if (this.props.authenticate.loggedIn) return (<Table />)
const rootEl = document.getElementById('content')

return (<Login />)
}
})
render(<AppContainer><App /></AppContainer>, rootEl)

const ConnectedApp = connect((state => ({
authenticate: state.authenticate,
autoLogin: state.settings.autoLogin,
})), (dispatch => bindActionCreators({
login
}, dispatch)))(App)
if (module.hot) {
module.hot.accept('./app', () => {
const NextApp = require('./app') // eslint-disable-line

ReactDOM.render(<Provider store={store}><ConnectedApp /></Provider>, document.getElementById('content'))
render(<AppContainer><NextApp /></AppContainer>, rootEl)
})
}
2 changes: 1 addition & 1 deletion app/main.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (process.env.NODE_ENV === 'production') {

if (process.env.NODE_ENV === 'development') {
require('electron-debug')() // eslint-disable-line global-require
const path = require('path'); // eslint-disable-line
const path = require('path') // eslint-disable-line
const p = path.join(__dirname, '..', 'app', 'node_modules') // eslint-disable-line
require('module').globalPaths.push(p) // eslint-disable-line
}
Expand Down
6 changes: 3 additions & 3 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "PokeNurse",
"productName": "PokeNurse",
"version": "2.0.3",
"version": "2.1.0",
"description": "A tool for Pok茅mon Go to aid in transferring and evolving Pok茅mon",
"main": "./main.js",
"author": {
Expand All @@ -13,7 +13,7 @@
"dependencies": {
"async-file": "^2.0.2",
"electron-localshortcut": "^1.0.0",
"node-pogo-protos": "2.4.2",
"pogobuf": "1.9.2"
"node-pogo-protos": "2.7.0",
"pogobuf": "1.10.0"
}
}
51 changes: 23 additions & 28 deletions app/screens/ConfirmationDialog/components/SelectedPokemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React, {
PropTypes
} from 'react'

const SelectedPokemon = React.createClass({
displayName: 'SelectedPokemon',
class SelectedPokemon extends React.Component {
static displayName = 'SelectedPokemon'

propTypes: {
static propTypes = {
pokemon: PropTypes.array
},
}

render() {
const {
Expand Down Expand Up @@ -37,31 +37,26 @@ const SelectedPokemon = React.createClass({
</p>
</div>
)
},

buildRows(pokemon) {
return (
pokemon.map((p, i) => {
const favoriteGlyph = 'glyphicon glyphicon-star favorite-yellow'
const emptyFavoriteGlyph = 'glyphicon glyphicon-star-empty'
const favorite = p.favorite ? favoriteGlyph : emptyFavoriteGlyph

return (
<tr key={i}>
<td>
<span className={`favorite ${favorite}`} />
</td>
<td>{p.name}</td>
<td>{p.nickname}</td>
<td>{p.cp}</td>
<td>{p.iv}%</td>
</tr>
)
})
)
}


})
buildRows = (pokemon) =>
pokemon.map((p, i) => {
const favoriteGlyph = 'glyphicon glyphicon-star favorite-yellow'
const emptyFavoriteGlyph = 'glyphicon glyphicon-star-empty'
const favorite = p.favorite ? favoriteGlyph : emptyFavoriteGlyph

return (
<tr key={i}>
<td>
<span className={`favorite ${favorite}`} />
</td>
<td>{p.name}</td>
<td>{p.nickname}</td>
<td>{p.cp}</td>
<td>{p.iv}%</td>
</tr>
)
})
}

export default SelectedPokemon
22 changes: 11 additions & 11 deletions app/screens/ConfirmationDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import React, {
import ReactDOM from 'react-dom'
import SelectedPokemon from './components/SelectedPokemon'

const ConfirmationDialog = React.createClass({
displayName: 'ConfirmationDialog',
class ConfirmationDialog extends React.Component {
static displayName = 'ConfirmationDialog'

propTypes: {
static propTypes = {
onClickSecondary: PropTypes.func.isRequired,
onClickPrimary: PropTypes.func.isRequired,
dialog: PropTypes.object.isRequired,
Expand All @@ -16,11 +16,11 @@ const ConfirmationDialog = React.createClass({
title: PropTypes.string.isRequired,
message: PropTypes.string.isRequired,
pokemon: PropTypes.array
},
}

componentDidMount() {
this.props.dialog.modal('show')
},
}

render() {
const {
Expand Down Expand Up @@ -55,7 +55,7 @@ const ConfirmationDialog = React.createClass({
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">&times;</span>
<span aria-hidden="true">&times</span>
</button>
<h4 className="modal-title" id="confirmationDialogLabel">
{title}
Expand Down Expand Up @@ -87,18 +87,18 @@ const ConfirmationDialog = React.createClass({
</div>
</div>
)
},
}

handleSecondary() {
handleSecondary = () => {
this.props.dialog.modal('hide')
this.props.onClickSecondary()
},
}

handlePrimary() {
handlePrimary = () => {
this.props.dialog.modal('hide')
this.props.onClickPrimary()
}
})
}

export default ($modal, props) => {
props.dialog = $modal
Expand Down
Loading

0 comments on commit 9ec98cd

Please sign in to comment.