From 21fb210439fbe4b63b8f8d3082d520bc8dbac213 Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Sat, 8 Oct 2022 17:39:22 +0000 Subject: [PATCH] Apply tweaks to reflec frontend. --- bemani/frontend/reflec/reflec.py | 36 +-- .../controllers/reflec/allplayers.react.js | 2 +- .../static/controllers/reflec/player.react.js | 6 +- .../controllers/reflec/records.react.js | 214 +++++++++--------- .../static/controllers/reflec/scores.react.js | 12 +- .../controllers/reflec/topscores.react.js | 11 +- 6 files changed, 146 insertions(+), 135 deletions(-) diff --git a/bemani/frontend/reflec/reflec.py b/bemani/frontend/reflec/reflec.py index ab978a5..e5ca28e 100644 --- a/bemani/frontend/reflec/reflec.py +++ b/bemani/frontend/reflec/reflec.py @@ -38,17 +38,17 @@ class ReflecBeatFrontend(FrontendBase): formatted_score['achievement_rate'] = score.data.get_int('achievement_rate', -1) formatted_score['miss_count'] = score.data.get_int('miss_count', -1) formatted_score['clear_type'] = { - ReflecBeatBase.CLEAR_TYPE_NO_PLAY: 'No Play', - ReflecBeatBase.CLEAR_TYPE_FAILED: 'Failed', - ReflecBeatBase.CLEAR_TYPE_CLEARED: 'Cleared', - ReflecBeatBase.CLEAR_TYPE_HARD_CLEARED: 'Hard Cleared', - ReflecBeatBase.CLEAR_TYPE_S_HARD_CLEARED: 'S-Hard Cleared', - }.get(score.data.get_int('clear_type'), 'Failed') + ReflecBeatBase.CLEAR_TYPE_NO_PLAY: 'NO PLAY', + ReflecBeatBase.CLEAR_TYPE_FAILED: 'FAILED', + ReflecBeatBase.CLEAR_TYPE_CLEARED: 'CLEARED', + ReflecBeatBase.CLEAR_TYPE_HARD_CLEARED: 'HARD CLEARED', + ReflecBeatBase.CLEAR_TYPE_S_HARD_CLEARED: 'S-HARD CLEARED', + }.get(score.data.get_int('clear_type'), 'FAILED') formatted_score['combo_type'] = { ReflecBeatBase.COMBO_TYPE_NONE: '', - ReflecBeatBase.COMBO_TYPE_ALMOST_COMBO: 'Almost Full Combo', - ReflecBeatBase.COMBO_TYPE_FULL_COMBO: 'Full Combo', - ReflecBeatBase.COMBO_TYPE_FULL_COMBO_ALL_JUST: 'Full Combo + All Just', + ReflecBeatBase.COMBO_TYPE_ALMOST_COMBO: 'ALMOST FULL COMBO', + ReflecBeatBase.COMBO_TYPE_FULL_COMBO: 'FULL COMBO', + ReflecBeatBase.COMBO_TYPE_FULL_COMBO_ALL_JUST: 'FULL COMBO + ALL JUST', }.get(score.data.get_int('combo_type'), '') formatted_score['medal'] = score.data.get_int('combo_type') * 1000 + score.data.get_int('clear_type') return formatted_score @@ -59,17 +59,17 @@ class ReflecBeatFrontend(FrontendBase): formatted_attempt['achievement_rate'] = attempt.data.get_int('achievement_rate', -1) formatted_attempt['miss_count'] = attempt.data.get_int('miss_count', -1) formatted_attempt['clear_type'] = { - ReflecBeatBase.CLEAR_TYPE_NO_PLAY: 'No Play', - ReflecBeatBase.CLEAR_TYPE_FAILED: 'Failed', - ReflecBeatBase.CLEAR_TYPE_CLEARED: 'Cleared', - ReflecBeatBase.CLEAR_TYPE_HARD_CLEARED: 'Hard Cleared', - ReflecBeatBase.CLEAR_TYPE_S_HARD_CLEARED: 'S-Hard Cleared', - }.get(attempt.data.get_int('clear_type'), 'Failed') + ReflecBeatBase.CLEAR_TYPE_NO_PLAY: 'NO PLAY', + ReflecBeatBase.CLEAR_TYPE_FAILED: 'FAILED', + ReflecBeatBase.CLEAR_TYPE_CLEARED: 'CLEARED', + ReflecBeatBase.CLEAR_TYPE_HARD_CLEARED: 'HARD CLEARED', + ReflecBeatBase.CLEAR_TYPE_S_HARD_CLEARED: 'S-HARD CLEARED', + }.get(attempt.data.get_int('clear_type'), 'FAILED') formatted_attempt['combo_type'] = { ReflecBeatBase.COMBO_TYPE_NONE: '', - ReflecBeatBase.COMBO_TYPE_ALMOST_COMBO: 'Almost Full Combo', - ReflecBeatBase.COMBO_TYPE_FULL_COMBO: 'Full Combo', - ReflecBeatBase.COMBO_TYPE_FULL_COMBO_ALL_JUST: 'Full Combo + All Just', + ReflecBeatBase.COMBO_TYPE_ALMOST_COMBO: 'ALMOST FULL COMBO', + ReflecBeatBase.COMBO_TYPE_FULL_COMBO: 'FULL COMBO', + ReflecBeatBase.COMBO_TYPE_FULL_COMBO_ALL_JUST: 'FULL COMBO + ALL JUST', }.get(attempt.data.get_int('combo_type'), '') formatted_attempt['medal'] = attempt.data.get_int('combo_type') * 1000 + attempt.data.get_int('clear_type') return formatted_attempt diff --git a/bemani/frontend/static/controllers/reflec/allplayers.react.js b/bemani/frontend/static/controllers/reflec/allplayers.react.js index f84bbcf..9dea099 100644 --- a/bemani/frontend/static/controllers/reflec/allplayers.react.js +++ b/bemani/frontend/static/controllers/reflec/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/reflec/player.react.js b/bemani/frontend/static/controllers/reflec/player.react.js index 3cb5867..59e3164 100644 --- a/bemani/frontend/static/controllers/reflec/player.react.js +++ b/bemani/frontend/static/controllers/reflec/player.react.js @@ -59,13 +59,13 @@ var profile_view = React.createClass({
{player.extid} - + - + - + {player.plays}回
diff --git a/bemani/frontend/static/controllers/reflec/records.react.js b/bemani/frontend/static/controllers/reflec/records.react.js index cba385d..216d480 100644 --- a/bemani/frontend/static/controllers/reflec/records.react.js +++ b/bemani/frontend/static/controllers/reflec/records.react.js @@ -57,10 +57,10 @@ var HighScore = React.createClass({ {this.props.score.points} M {this.props.score.miss_count < 0 ? '-' : this.props.score.miss_count} - -
- Combo - {this.props.score.combo < 0 ? '-' : this.props.score.combo} + {this.props.score.combo > 0 ? + Combo + {this.props.score.combo < 0 ? '-' : this.props.score.combo} + : null}
{this.props.score.combo_type} @@ -231,8 +231,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" + } Basic Medium Hard @@ -501,107 +503,109 @@ 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))} + + + + + + +
SongBasicMediumHardSpecial
- -
- {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 / DifficultiesBasicMediumHardSpecial
+ + 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/reflec/scores.react.js b/bemani/frontend/static/controllers/reflec/scores.react.js index 0300a9e..a136e62 100644 --- a/bemani/frontend/static/controllers/reflec/scores.react.js +++ b/bemani/frontend/static/controllers/reflec/scores.react.js @@ -76,10 +76,10 @@ var network_scores = React.createClass({ {score.points} M {score.miss_count < 0 ? '-' : score.miss_count} - -
- Combo - {score.combo < 0 ? '-' : score.combo} + {score.combo > 0 ? + Combo + {score.combo < 0 ? '-' : score.combo} + : null}
{score.combo_type} @@ -98,8 +98,8 @@ var network_scores = React.createClass({ { window.shownames ? Name : null } Timestamp - Song - Chart + Song / Artist + Difficulty Score diff --git a/bemani/frontend/static/controllers/reflec/topscores.react.js b/bemani/frontend/static/controllers/reflec/topscores.react.js index d6b35a6..0b7f7e3 100644 --- a/bemani/frontend/static/controllers/reflec/topscores.react.js +++ b/bemani/frontend/static/controllers/reflec/topscores.react.js @@ -151,11 +151,18 @@ var top_scores = React.createClass({ }, { name: 'Combo', - render: function(topscore) { return topscore.combo > 0 ? topscore.combo : '-'; }, + render: function(topscore) { return topscore.combo > 0 ? topscore.combo : ''; }, + sort: function(a, b) { + return a.combo - b.combo; + }, + reverse: true, }, { name: 'Miss Count', - render: function(topscore) { return topscore.miss_count > 0 ? topscore.miss_count : '-'; }, + render: function(topscore) { return topscore.miss_count; }, + sort: function(a, b) { + return a.miss_count - b.miss_count; + }, }, ]} defaultsort='Score'