Add: Enter charcter
This commit is contained in:
@@ -15,7 +15,7 @@ function AnimalRecordList(type) {
|
||||
this.posY = AnimalRecordList.ANIMAL_LIST_MENU_POS_Y;
|
||||
}
|
||||
else {
|
||||
bgColor = TypingExamination.STAGE_BACKGROUND_COLOR_HEX;
|
||||
bgColor = AnimalRecordList.COLOR_TYPING_EXAM_STAGE_BACKGROUND_HEX;
|
||||
this.posY = AnimalRecordList.ANIMAL_LIST_EXAM_POS_Y;
|
||||
}
|
||||
game.add.graphics()
|
||||
@@ -169,6 +169,8 @@ AnimalRecordList.ANIMAL_OFFSET_Y = 30;
|
||||
AnimalRecordList.RECORD_TEXT_MENU_OFFSET_Y = 35;
|
||||
AnimalRecordList.COLOR_SCORE_MENU_DEFAULT_TEXT = MainColor.OLD_LACE_STRING;
|
||||
|
||||
AnimalRecordList.COLOR_BG = MainColor.CHOCO_HEX; // 0x77aadd; //0x99ccff;
|
||||
AnimalRecordList.COLOR_BG = MainColor.CHOCO_HEX;
|
||||
AnimalRecordList.COLOR_TYPING_EXAM_STAGE_BACKGROUND_HEX = MainColor.DARKER_CHOCO_HEX;
|
||||
|
||||
AnimalRecordList.COLOR_SCORE_DEFAULT_TEXT = "#bbddff";
|
||||
AnimalRecordList.COLOR_SCORE_CLEARED_TEXT = "#ffffff";
|
||||
@@ -373,14 +373,12 @@ TypingExamination.prototype.completeLoadingWriting = function() {
|
||||
var count = examinationContent.length;
|
||||
for(var i = 0; i < count; i++) {
|
||||
// add enter character
|
||||
examinationContent[i] = examinationContent[i].replace(/\r/g, "");
|
||||
/*
|
||||
console.log(examinationContent[i]);
|
||||
// examinationContent[i] = examinationContent[i].replace(/\r/g, "");
|
||||
// console.log(examinationContent[i]);
|
||||
if(examinationContent[i] == "\r")
|
||||
examinationContent[i] = examinationContent[i].replace(/\r/g, "");
|
||||
else
|
||||
examinationContent[i] = examinationContent[i].replace(/\r/g, TypingExamination.ENTER_INDICATOR);
|
||||
*/
|
||||
|
||||
// add space indicator character
|
||||
// examinationContent[i] = examinationContent[i].replace(/ /g, TypingExamination.SPACE_INDICATOR);
|
||||
@@ -393,11 +391,16 @@ TypingExamination.prototype.completeLoadingWriting = function() {
|
||||
var typingTextMan = new TypingTextManager();
|
||||
typingTextMan.makeExaminationContents(examinationContent);
|
||||
this.typingExaminationContents = typingTextMan.getContents();
|
||||
// console.log(this.typingExaminationContents.length);
|
||||
// console.log(this.typingExaminationContents[this.typingExaminationContents.length - 1]);
|
||||
var lastSentence = this.typingExaminationContents[this.typingExaminationContents.length - 1];
|
||||
if(lastSentence[lastSentence.length - 1] !== TypingExamination.ENTER_INDICATOR)
|
||||
this.typingExaminationContents[this.typingExaminationContents.length - 1] += TypingExamination.ENTER_INDICATOR;
|
||||
// console.log(this.typingExaminationContents);
|
||||
this.typingContentLength = this.typingExaminationContents.length;
|
||||
|
||||
this.typingRecordForLines = [];
|
||||
this.typingElapsedTime = [];
|
||||
this.typingContentLength = this.typingExaminationContents.length;
|
||||
for(var i = 0; i < this.typingContentLength; i++) {
|
||||
this.typingRecordForLines[i] = 0;
|
||||
this.typingElapsedTime[i] = 0;
|
||||
@@ -422,6 +425,7 @@ TypingExamination.prototype.showTypingExaminationContents = function() {
|
||||
this.textTypingContentsDone[i].text = "";
|
||||
this.textDoneLineNumber[i].text = "";
|
||||
} else {
|
||||
// console.log(this.typingExaminationContents[doneIndex] + "/");
|
||||
this.textTypingContentsDone[i].text = this.typingExaminationContents[doneIndex];
|
||||
// this.textDoneLineNumber[i].text = NumberUtil.getRecordText(Math.floor(this.typingRecordForLines[doneIndex]));
|
||||
|
||||
@@ -442,8 +446,7 @@ TypingExamination.prototype.showTypingExaminationContents = function() {
|
||||
for(var i = 0; i < TypingExamination.TYPING_CONTENT_PREVIEW_COUNT; i++) {
|
||||
var previewIndex = this.typingIndex + i + 1;
|
||||
if(previewIndex < this.typingExaminationContents.length) {
|
||||
var previewText = this.typingExaminationContents[previewIndex];
|
||||
this.textTypingContentPreview[i].text = previewText;
|
||||
this.textTypingContentPreview[i].text = this.typingExaminationContents[previewIndex];
|
||||
|
||||
var lineNumber = this.typingContentLength - this.typingIndex - 1 - i;
|
||||
this.textPreviewLineNumber[i].text = NumberUtil.numberWithCommas(lineNumber) + " ";
|
||||
@@ -468,6 +471,7 @@ TypingExamination.prototype.checkTypingContents = function(event) {
|
||||
var inputContent = this.inputTextContent.canvasInput.value();
|
||||
var trimmedInputContent = inputContent.trim();
|
||||
var typingContent = this.typingExaminationContents[this.typingIndex].trim();
|
||||
typingContent = typingContent.replace(TypingExamination.ENTER_INDICATOR, "");
|
||||
|
||||
if(event.keyCode == Phaser.Keyboard.ENTER ||
|
||||
event.keyCode == Phaser.Keyboard.SPACEBAR) {
|
||||
@@ -498,7 +502,9 @@ TypingExamination.prototype.checkTypingContents = function(event) {
|
||||
this.setTimeTypingStart();
|
||||
}
|
||||
|
||||
this.showTypingContentHighlight(inputContent, typingContent);
|
||||
var notTrimmedInputContent = this.inputTextContent.canvasInput.value();
|
||||
var notTrimmedTypingContent = this.typingExaminationContents[this.typingIndex];
|
||||
this.showTypingContentHighlight(notTrimmedInputContent, notTrimmedTypingContent);
|
||||
}
|
||||
|
||||
TypingExamination.prototype.showTypingContentHighlight = function(inputContent, typingContent) {
|
||||
@@ -624,5 +630,6 @@ TypingExamination.COLOR_CORRECT_INPUT_STRING = MainColor.YELLOW_STRING;
|
||||
TypingExamination.COLOR_DONE_INPUT_STRING = MainColor.MOCCASIN_STRING;
|
||||
|
||||
TypingExamination.COLOR_STAGE_BACKGROUND_STRING = "#4d4d4d";
|
||||
|
||||
TypingExamination.COLOR_NEXT_INPUT_BACKGROUND_STRING = MainColor.DARKER_CHOCO_STRING;
|
||||
TypingExamination.COLOR_CORRECT_INPUT_BACKGROUND_STRING = MainColor.DARK_CHOCO_STRING;
|
||||
Reference in New Issue
Block a user