Skip to content

Commit

Permalink
fix positioning pane for non-english names
Browse files Browse the repository at this point in the history
  • Loading branch information
FugiTech committed Oct 4, 2018
1 parent c05c27a commit cb10500
Show file tree
Hide file tree
Showing 7 changed files with 1,507 additions and 1,494 deletions.
2 changes: 1 addition & 1 deletion cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def dl(url, path):
f.write("const AllCards = new Map([\n")
for d in sorted(all_cards, key=lambda c: c["ArenaID"]):
f.write(
'\t[{ArenaID}, {{ID: "{ArenaID}", name: "{Name}", set: "{Set}", number: {CollectorNumber}, color: "{Colors}", rarity: "{Rarity}", cmc: {CMC}, dualSided: {DualSided}}}],\n'.format(
'\t[{ArenaID}, {{ID: "{ArenaID}", name: "{Name}", set: "{Set}", number: "{CollectorNumber}", color: "{Colors}", rarity: "{Rarity}", cmc: {CMC}, dualSided: {DualSided}}}],\n'.format(
**d
)
)
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deckmaster",
"version": "201810.3.0",
"version": "201810.4.0",
"author": "Fugi <Fugiman47@gmail.com>",
"description": "Deckmaster Twitch Extension",
"repository": "github:fugiman/deckmaster",
Expand Down
2,980 changes: 1,490 additions & 1,490 deletions client/src/main/cards.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions client/src/main/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export default function(path, ipc) {
)
} catch (e) {}
}
if (store.state.token && !store.state.token.login) {
store.dispatch('hydrateUserLogin')
}
configureScope(scope => {
scope.setUser({
id: store.state.token ? store.state.token.channelID : undefined,
Expand Down Expand Up @@ -151,6 +154,7 @@ export default function(path, ipc) {
}
if ('loginData' in d) {
store.commit('login', d['loginData'])
store.dispatch('hydrateUserLogin')
}
if ('vote' in d) {
store.dispatch('addDraftVote', d['vote'])
Expand Down
5 changes: 5 additions & 0 deletions client/src/main/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,9 @@ export default {
let active = !!d.data && !!d.data.overlay['1'].active && d.data.overlay['1'].id === client_id
commit('statusUpdate', { extactive: active })
},
async hydrateUserLogin(ctx) {
if (!ctx.state.token) return
let d = await kraken(ctx, `users/${ctx.state.token.channelID}`)
ctx.commit('hydrateUserLogin', d.name)
},
}
4 changes: 4 additions & 0 deletions client/src/main/store/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const mutations = {
})
})
},
hydrateUserLogin(state, login) {
if (!state.token) return
state.token.login = login
},
loginState(state, loginState) {
state.loginState = loginState
state.loginNonce = nanoid()
Expand Down
4 changes: 2 additions & 2 deletions client/src/renderer/pages/arena/positioning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
},
computed: {
previewImage() {
let login = this.$store.state.oauth ? this.$store.state.oauth.username.toLowerCase() : ''
let login = this.$store.state.token ? this.$store.state.token.login : ''
return `https://static-cdn.jtvnw.net/previews-ttv/live_user_${login}-1424x800.jpg?ts=${+this.now}`
},
},
Expand Down Expand Up @@ -77,7 +77,7 @@ export default {
this.movefns[1](e, true)
},
distance(e, vertical) {
return vertical ? 100 * (e['pageY'] - this['startY']) / this.$refs.container['clientHeight'] : 100 * (e['pageX'] - this['startX']) / this.$refs.container['clientWidth']
return vertical ? (100 * (e['pageY'] - this['startY'])) / this.$refs.container['clientHeight'] : (100 * (e['pageX'] - this['startX'])) / this.$refs.container['clientWidth']
},
null(e, vertical) {},
Expand Down

0 comments on commit cb10500

Please sign in to comment.