Fix: show failed record in result, ranking

This commit is contained in:
2019-09-27 08:26:23 +09:00
parent 301a057099
commit 963012978a
14 changed files with 180 additions and 17 deletions
+34 -4
View File
@@ -103,7 +103,8 @@ RankingText.prototype.setTextRankingColor = function(text, ranking) {
}
text.fill = fillColor;
text.stroke = strokeColor;
text.strokeThickness = 2;
text.strokeThickness = 6;
text.setShadow(2, 2, "#333333", 2, false, true);
};
RankingText.prototype.setTopRankingTextColor = function(ranking) {
@@ -131,19 +132,48 @@ RankingText.prototype.setMyRankingTextColor = function() {
this.textRecord.strokeThickness = 2;
};
RankingText.prototype.setRankingMinusTextColor = function(ranking) {
// console.log(ranking);
if(ranking >= 0)
return;
var fillColor = "#ddaaaa"; // yellowgreen
// var strokeColor = "#2e8b57"; // seagreen
this.textRanking.fill = fillColor;
// this.textRanking.stroke = strokeColor;
// this.textRanking.strokeThickness = 2;
this.textPlayerName.fill = fillColor;
// this.textPlayerName.stroke = strokeColor;
// this.textPlayerName.strokeThickness = 2;
this.textRecord.fill = fillColor;
// this.textRecord.stroke = strokeColor;
// this.textRecord.strokeThickness = 2;
};
RankingText.prototype.setContents = function(playerID, ranking, playerName, record) {
this.reset();
this.playerID = playerID;
this.textRanking.text = ranking + "등";
if(record >= 0)
this.textRanking.text = ranking + "등";
else
this.textRanking.text = "실격";
this.textPlayerName.text = playerName;
this.setRecord(record, this.appID);
this.setMyRankingTextColor();
this.setTopRankingTextColor(ranking);
this.setRankingMinusTextColor(ranking);
this.setMyRankingTextColor();
};
RankingText.prototype.setRecord = function(record, appID) {
this.textRecord.text = RecordUtil.getRecordValueWithUnit(record, appID);
// this.textRecord.text = RecordUtil.getRecordValueWithUnit(record, appID);
var recordValue = record >= 0 ? record : -1 * record;
var absRecordValue = RecordUtil.getRecordValueWithUnit(
recordValue,
sessionStorageManager.getPlayingAppID()
);
this.textRecord.text = absRecordValue;
};