diff --git a/bemani/frontend/museca/museca.py b/bemani/frontend/museca/museca.py index c0e2db2..cf029c8 100644 --- a/bemani/frontend/museca/museca.py +++ b/bemani/frontend/museca/museca.py @@ -45,10 +45,10 @@ class MusecaFrontend(FrontendBase): MusecaBase.GRADE_PERFECT: 'Perfect (傑)', }.get(score.data.get_int('grade'), 'No Play') formatted_score['clear_type'] = { - MusecaBase.CLEAR_TYPE_FAILED: 'Failed', - MusecaBase.CLEAR_TYPE_CLEARED: 'Cleared', - MusecaBase.CLEAR_TYPE_FULL_COMBO: 'Full Combo', - }.get(score.data.get_int('clear_type'), 'Failed') + MusecaBase.CLEAR_TYPE_FAILED: 'FAILED', + MusecaBase.CLEAR_TYPE_CLEARED: 'CLEARED', + MusecaBase.CLEAR_TYPE_FULL_COMBO: 'FULL COMBO', + }.get(score.data.get_int('clear_type'), 'FAILED') formatted_score['medal'] = score.data.get_int('clear_type') formatted_score['stats'] = score.data.get_dict('stats') return formatted_score @@ -68,10 +68,10 @@ class MusecaFrontend(FrontendBase): MusecaBase.GRADE_PERFECT: 'Perfect (傑)', }.get(attempt.data.get_int('grade'), 'No Play') formatted_attempt['clear_type'] = { - MusecaBase.CLEAR_TYPE_FAILED: 'Failed', - MusecaBase.CLEAR_TYPE_CLEARED: 'Cleared', - MusecaBase.CLEAR_TYPE_FULL_COMBO: 'Full Combo', - }.get(attempt.data.get_int('clear_type'), 'Failed') + MusecaBase.CLEAR_TYPE_FAILED: 'FAILED', + MusecaBase.CLEAR_TYPE_CLEARED: 'CLEARED', + MusecaBase.CLEAR_TYPE_FULL_COMBO: 'FULL COMBO', + }.get(attempt.data.get_int('clear_type'), 'FAILED') formatted_attempt['medal'] = attempt.data.get_int('clear_type') formatted_attempt['stats'] = attempt.data.get_dict('stats') return formatted_attempt diff --git a/bemani/frontend/popn/popn.py b/bemani/frontend/popn/popn.py index 36e8b59..71f81be 100644 --- a/bemani/frontend/popn/popn.py +++ b/bemani/frontend/popn/popn.py @@ -39,39 +39,41 @@ class PopnMusicFrontend(FrontendBase): formatted_score = super().format_score(userid, score) formatted_score['combo'] = score.data.get_int('combo', -1) formatted_score['medal'] = score.data.get_int('medal') + formatted_score['stats'] = score.data.get_dict('stats') formatted_score['status'] = { - PopnMusicBase.PLAY_MEDAL_NO_PLAY: "No Play", - PopnMusicBase.PLAY_MEDAL_CIRCLE_FAILED: "○ Failed", - PopnMusicBase.PLAY_MEDAL_DIAMOND_FAILED: "◇ Failed", - PopnMusicBase.PLAY_MEDAL_STAR_FAILED: "☆ Failed", - PopnMusicBase.PLAY_MEDAL_EASY_CLEAR: "Easy Clear", - PopnMusicBase.PLAY_MEDAL_CIRCLE_CLEARED: "○ Cleared", - PopnMusicBase.PLAY_MEDAL_DIAMOND_CLEARED: "◇ Cleared", - PopnMusicBase.PLAY_MEDAL_STAR_CLEARED: "☆ Cleared", - PopnMusicBase.PLAY_MEDAL_CIRCLE_FULL_COMBO: "○ Full Combo", - PopnMusicBase.PLAY_MEDAL_DIAMOND_FULL_COMBO: "◇ Full Combo", - PopnMusicBase.PLAY_MEDAL_STAR_FULL_COMBO: "☆ Full Combo", - PopnMusicBase.PLAY_MEDAL_PERFECT: "Perfect", - }.get(score.data.get_int('medal'), 'No Play') + PopnMusicBase.PLAY_MEDAL_NO_PLAY: "NO PLAY", + PopnMusicBase.PLAY_MEDAL_CIRCLE_FAILED: "○ FAILED", + PopnMusicBase.PLAY_MEDAL_DIAMOND_FAILED: "◇ FAILED", + PopnMusicBase.PLAY_MEDAL_STAR_FAILED: "☆ FAILED", + PopnMusicBase.PLAY_MEDAL_EASY_CLEAR: "EASY CLEAR", + PopnMusicBase.PLAY_MEDAL_CIRCLE_CLEARED: "○ CLEARED", + PopnMusicBase.PLAY_MEDAL_DIAMOND_CLEARED: "◇ CLEARED", + PopnMusicBase.PLAY_MEDAL_STAR_CLEARED: "☆ CLEARED", + PopnMusicBase.PLAY_MEDAL_CIRCLE_FULL_COMBO: "○ FULL COMBO", + PopnMusicBase.PLAY_MEDAL_DIAMOND_FULL_COMBO: "◇ FULL COMBO", + PopnMusicBase.PLAY_MEDAL_STAR_FULL_COMBO: "☆ FULL COMBO", + PopnMusicBase.PLAY_MEDAL_PERFECT: "PERFECT", + }.get(score.data.get_int('medal'), 'NO PLAY') return formatted_score def format_attempt(self, userid: UserID, attempt: Attempt) -> Dict[str, Any]: formatted_attempt = super().format_attempt(userid, attempt) formatted_attempt['combo'] = attempt.data.get_int('combo', -1) formatted_attempt['medal'] = attempt.data.get_int('medal') + formatted_attempt['stats'] = attempt.data.get_dict('stats') formatted_attempt['status'] = { - PopnMusicBase.PLAY_MEDAL_CIRCLE_FAILED: "○ Failed", - PopnMusicBase.PLAY_MEDAL_DIAMOND_FAILED: "◇ Failed", - PopnMusicBase.PLAY_MEDAL_STAR_FAILED: "☆ Failed", - PopnMusicBase.PLAY_MEDAL_EASY_CLEAR: "Easy Clear", - PopnMusicBase.PLAY_MEDAL_CIRCLE_CLEARED: "○ Cleared", - PopnMusicBase.PLAY_MEDAL_DIAMOND_CLEARED: "◇ Cleared", - PopnMusicBase.PLAY_MEDAL_STAR_CLEARED: "☆ Cleared", - PopnMusicBase.PLAY_MEDAL_CIRCLE_FULL_COMBO: "○ Full Combo", - PopnMusicBase.PLAY_MEDAL_DIAMOND_FULL_COMBO: "◇ Full Combo", - PopnMusicBase.PLAY_MEDAL_STAR_FULL_COMBO: "☆ Full Combo", - PopnMusicBase.PLAY_MEDAL_PERFECT: "Perfect", - }.get(attempt.data.get_int('medal'), 'No Play') + PopnMusicBase.PLAY_MEDAL_CIRCLE_FAILED: "○ FAILED", + PopnMusicBase.PLAY_MEDAL_DIAMOND_FAILED: "◇ FAILED", + PopnMusicBase.PLAY_MEDAL_STAR_FAILED: "☆ FAILED", + PopnMusicBase.PLAY_MEDAL_EASY_CLEAR: "EASY CLEAR", + PopnMusicBase.PLAY_MEDAL_CIRCLE_CLEARED: "○ CLEARED", + PopnMusicBase.PLAY_MEDAL_DIAMOND_CLEARED: "◇ CLEARED", + PopnMusicBase.PLAY_MEDAL_STAR_CLEARED: "☆ CLEARED", + PopnMusicBase.PLAY_MEDAL_CIRCLE_FULL_COMBO: "○ FULL COMBO", + PopnMusicBase.PLAY_MEDAL_DIAMOND_FULL_COMBO: "◇ FULL COMBO", + PopnMusicBase.PLAY_MEDAL_STAR_FULL_COMBO: "☆ FULL COMBO", + PopnMusicBase.PLAY_MEDAL_PERFECT: "PERFECT", + }.get(attempt.data.get_int('medal'), 'NO PLAY') return formatted_attempt def format_profile(self, profile: Profile, playstats: ValidatedDict) -> Dict[str, Any]: diff --git a/bemani/frontend/static/components/gamesettings.react.js b/bemani/frontend/static/components/gamesettings.react.js index 6900ab7..44abb6d 100644 --- a/bemani/frontend/static/components/gamesettings.react.js +++ b/bemani/frontend/static/components/gamesettings.react.js @@ -6,7 +6,6 @@ function makeGameSettingName(game_settings) { var GameSettings = React.createClass({ getInitialState: function() { - console.log(this.props); var valid_settings = this.props.game_settings.map(function(setting) { return makeGameSettingName(setting); }); diff --git a/bemani/frontend/static/controllers/arcade/arcade.react.js b/bemani/frontend/static/controllers/arcade/arcade.react.js index af54b28..34e43d8 100644 --- a/bemani/frontend/static/controllers/arcade/arcade.react.js +++ b/bemani/frontend/static/controllers/arcade/arcade.react.js @@ -166,7 +166,6 @@ var arcade_management = React.createClass({ Object.keys(response.users).map(function(userid) { credits[userid] = ''; }); - console.log('huh?'); this.setState({ users: response.users, balances: response.balances, diff --git a/bemani/frontend/static/controllers/jubeat/records.react.js b/bemani/frontend/static/controllers/jubeat/records.react.js index 6baba3c..095b45e 100644 --- a/bemani/frontend/static/controllers/jubeat/records.react.js +++ b/bemani/frontend/static/controllers/jubeat/records.react.js @@ -47,13 +47,13 @@ var HighScore = React.createClass({ : null} {has_stats ?
{this.props.score.stats.perfect} - / + / {this.props.score.stats.great} - / + / {this.props.score.stats.good} - / + / {this.props.score.stats.poor} - / + / {this.props.score.stats.miss}
: null}
diff --git a/bemani/frontend/static/controllers/museca/records.react.js b/bemani/frontend/static/controllers/museca/records.react.js index 404a303..e0b5ca0 100644 --- a/bemani/frontend/static/controllers/museca/records.react.js +++ b/bemani/frontend/static/controllers/museca/records.react.js @@ -52,7 +52,7 @@ var HighScore = React.createClass({ {this.props.score.stats.error}
: null}
- {this.props.score.clear_type.toUpperCase()} + {this.props.score.clear_type}
{ this.props.score.userid && window.shownames ?
{ diff --git a/bemani/frontend/static/controllers/museca/scores.react.js b/bemani/frontend/static/controllers/museca/scores.react.js index b8e9075..d6db616 100644 --- a/bemani/frontend/static/controllers/museca/scores.react.js +++ b/bemani/frontend/static/controllers/museca/scores.react.js @@ -80,7 +80,7 @@ var network_scores = React.createClass({ {score.stats.error}
: null}
- {score.clear_type.toUpperCase()} + {score.clear_type}
); diff --git a/bemani/frontend/static/controllers/museca/topscores.react.js b/bemani/frontend/static/controllers/museca/topscores.react.js index 815dcee..2211e68 100644 --- a/bemani/frontend/static/controllers/museca/topscores.react.js +++ b/bemani/frontend/static/controllers/museca/topscores.react.js @@ -112,7 +112,7 @@ var top_scores = React.createClass({ }, { name: 'Clear Type', - render: function(topscore) { return topscore.clear_type.toUpperCase(); }, + render: function(topscore) { return topscore.clear_type; }, }, { name: 'Score', diff --git a/bemani/frontend/static/controllers/popn/allplayers.react.js b/bemani/frontend/static/controllers/popn/allplayers.react.js index 6af4527..2cad457 100644 --- a/bemani/frontend/static/controllers/popn/allplayers.react.js +++ b/bemani/frontend/static/controllers/popn/allplayers.react.js @@ -57,7 +57,7 @@ var all_players = React.createClass({ }.bind(this), }, { - name: 'Play Count', + name: 'Total Rounds', render: function(userid) { var player = this.state.players[userid]; return player.plays; diff --git a/bemani/frontend/static/controllers/popn/player.react.js b/bemani/frontend/static/controllers/popn/player.react.js index 829354e..8395fa7 100644 --- a/bemani/frontend/static/controllers/popn/player.react.js +++ b/bemani/frontend/static/controllers/popn/player.react.js @@ -59,13 +59,13 @@ var profile_view = React.createClass({
{player.extid} - + - + - + {player.plays}回
diff --git a/bemani/frontend/static/controllers/popn/records.react.js b/bemani/frontend/static/controllers/popn/records.react.js index 22c2e1d..9bf3cac 100644 --- a/bemani/frontend/static/controllers/popn/records.react.js +++ b/bemani/frontend/static/controllers/popn/records.react.js @@ -22,6 +22,12 @@ var HighScore = React.createClass({ if (!this.props.score) { return null; } + has_stats = ( + this.props.score.stats.cool > 0 || + this.props.score.stats.great > 0 || + this.props.score.stats.good > 0 || + this.props.score.stats.bad > 0 + ); return (
@@ -31,6 +37,15 @@ var HighScore = React.createClass({ Combo {this.props.score.combo < 0 ? '-' : this.props.score.combo}
+ {has_stats ?
+ {this.props.score.stats.cool} + / + {this.props.score.stats.great} + / + {this.props.score.stats.good} + / + {this.props.score.stats.bad} +
: null}
{this.props.score.status}
@@ -198,8 +213,10 @@ var network_records = React.createClass({ if (paginate && curpage != this.state.subtab) { return null; } return ( - - { this.state.versions[(-songid) - 1] } + + { + !paginate ? this.state.versions[(-songid) - 1] : "Song / Artist / Difficulties" + } Easy Normal Hyper @@ -419,108 +436,110 @@ var network_records = React.createClass({ renderBySongIDList: function(songids, showplays) { return ( - - - - - - - - - - - - {songids.map(function(songid, index) { - if (index < this.state.offset || index >= this.state.offset + this.state.limit) { - return null; - } - - var records = this.state.records[songid]; - if (!records) { - records = {}; - } - - var plays = this.getPlays(records); - var difficulties = this.state.songs[songid].difficulties; - return ( - - - - - - - - ); - }.bind(this))} - - - - + + + + + + + ); + }.bind(this))} + + + + + + +
SongEasyNormalHyperEX
- -
- {this.renderDifficulty(songid, 0)} - / - {this.renderDifficulty(songid, 1)} - / - {this.renderDifficulty(songid, 2)} - / - {this.renderDifficulty(songid, 3)} -
- { showplays ?
#{index + 1} - {plays}{plays == 1 ? ' play' : ' plays'}
: null } -
0 ? "" : "nochart"}> - - 0 ? "" : "nochart"}> - - 0 ? "" : "nochart"}> - - 0 ? "" : "nochart"}> - -
- { this.state.offset > 0 ? - : null +
+ + + + + + + + + + + + {songids.map(function(songid, index) { + if (index < this.state.offset || index >= this.state.offset + this.state.limit) { + return null; } - { (this.state.offset + this.state.limit) < songids.length ? - = songids.length) { return } - this.setState({offset: page}); - }.bind(this)}/> : - null + + var records = this.state.records[songid]; + if (!records) { + records = {}; } - - - -
Song / Artist / DifficultiesEasyNormalHyperEX
+ + var plays = this.getPlays(records); + var difficulties = this.state.songs[songid].difficulties; + return ( +
+ +
+ {this.renderDifficulty(songid, 0)} + / + {this.renderDifficulty(songid, 1)} + / + {this.renderDifficulty(songid, 2)} + / + {this.renderDifficulty(songid, 3)} +
+ { showplays ?
#{index + 1} - {plays}{plays == 1 ? ' play' : ' plays'}
: null } +
0 ? "" : "nochart"}> + + 0 ? "" : "nochart"}> + + 0 ? "" : "nochart"}> + + 0 ? "" : "nochart"}> + +
+ { this.state.offset > 0 ? + : null + } + { (this.state.offset + this.state.limit) < songids.length ? + = songids.length) { return } + this.setState({offset: page}); + }.bind(this)}/> : + null + } +
+ ); }, diff --git a/bemani/frontend/static/controllers/popn/scores.react.js b/bemani/frontend/static/controllers/popn/scores.react.js index 4f35b01..ff26466 100644 --- a/bemani/frontend/static/controllers/popn/scores.react.js +++ b/bemani/frontend/static/controllers/popn/scores.react.js @@ -60,6 +60,13 @@ var network_scores = React.createClass({ }, renderScore: function(score) { + has_stats = ( + score.stats.cool > 0 || + score.stats.great > 0 || + score.stats.good > 0 || + score.stats.bad > 0 + ); + return (
@@ -68,6 +75,15 @@ var network_scores = React.createClass({ Combo {score.combo < 0 ? '-' : score.combo}
+ {has_stats ?
+ {score.stats.cool} + / + {score.stats.great} + / + {score.stats.good} + / + {score.stats.bad} +
: null}
{score.status}
@@ -83,8 +99,8 @@ var network_scores = React.createClass({ { window.shownames ? Name : null } Timestamp - Song - Chart + Song / Artist + Difficulty Score diff --git a/bemani/frontend/static/controllers/popn/topscores.react.js b/bemani/frontend/static/controllers/popn/topscores.react.js index 6568aa6..93c12b9 100644 --- a/bemani/frontend/static/controllers/popn/topscores.react.js +++ b/bemani/frontend/static/controllers/popn/topscores.react.js @@ -119,6 +119,30 @@ var top_scores = React.createClass({ { name: 'Combo', render: function(topscore) { return topscore.combo > 0 ? topscore.combo : '-'; }, + sort: function(a, b) { + return a.combo - b.combo; + }, + reverse: true, + }, + { + name: 'Judgement Stats', + render: function(topscore) { + has_stats = ( + topscore.stats.cool > 0 || + topscore.stats.great > 0 || + topscore.stats.good > 0 || + topscore.stats.bad > 0 + ); + return has_stats ?
+ {topscore.stats.cool} + / + {topscore.stats.great} + / + {topscore.stats.good} + / + {topscore.stats.bad} +
: null; + } }, ]} defaultsort='Score'