Skip to content

Commit

Permalink
Fixed emojis + all answers are translatable
Browse files Browse the repository at this point in the history
Need some cleaning of code...
  • Loading branch information
GoAlexander committed Jul 27, 2016
1 parent 8b50f05 commit b533540
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 8 deletions.
2 changes: 2 additions & 0 deletions qml/cover/CoverPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CoverBackground {
return Math.ceil(Math.random() *2);
}

/*
function buttonAnswer() {
var answers = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes — definitely.", "You may rely on it.",
"As I see it, yes.", "Most likely.", "Outlook good.", "Signs point to yes.", "Yes.",
Expand All @@ -16,6 +17,7 @@ CoverBackground {
return answers [Math.ceil(Math.random() * 20)];
}
*/


Label {
Expand Down
Binary file modified qml/emojis/emoji-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified qml/emojis/emoji-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified qml/emojis/emoji-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified qml/emojis/emoji-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified qml/emojis/emoji-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified qml/emojis/emoji-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified qml/emojis/emoji-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified qml/emojis/emoji-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 44 additions & 8 deletions qml/pages/FirstPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,54 @@ Page {

property real number: 0
function answer() {
var answers = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes — definitely.", "You may rely on it.",
"As I see it, yes.", "Most likely.", "Outlook good.", "Signs point to yes.", "Yes.",
"Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.",
"Don’t count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."];
var answers = [
qsTr("It is certain."),
qsTr("It is decidedly so."),
qsTr("Without a doubt."),
qsTr("Yes — definitely."),
qsTr("You may rely on it."),
qsTr("As I see it, yes."),
qsTr("Most likely."),
qsTr("Outlook good."),
qsTr("Signs point to yes."),
qsTr("Yes."),
qsTr("Reply hazy, try again."),
qsTr("Ask again later."),
qsTr("Better not tell you now."),
qsTr("Cannot predict now."),
qsTr("Concentrate and ask again."),
qsTr("Don’t count on it."),
qsTr("My reply is no."),
qsTr("My sources say no."),
qsTr("Outlook not so good."),
qsTr("Very doubtful.")];

number = Math.ceil(shakeSensor.random * 1000) % 20;
return answers [number];
}

function buttonAnswer() {
var answers = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes — definitely.", "You may rely on it.",
"As I see it, yes.", "Most likely.", "Outlook good.", "Signs point to yes.", "Yes.",
"Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.",
"Don’t count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."];
var answers = [
qsTr("It is certain."),
qsTr("It is decidedly so."),
qsTr("Without a doubt."),
qsTr("Yes — definitely."),
qsTr("You may rely on it."),
qsTr("As I see it, yes."),
qsTr("Most likely."),
qsTr("Outlook good."),
qsTr("Signs point to yes."),
qsTr("Yes."),
qsTr("Reply hazy, try again."),
qsTr("Ask again later."),
qsTr("Better not tell you now."),
qsTr("Cannot predict now."),
qsTr("Concentrate and ask again."),
qsTr("Don’t count on it."),
qsTr("My reply is no."),
qsTr("My sources say no."),
qsTr("Outlook not so good."),
qsTr("Very doubtful.")];

number = Math.ceil(Math.random() * 20);
return answers [number];
Expand All @@ -41,6 +75,8 @@ Page {
else
if (number >= 15 && number <= 19)
return getRandomInt(6, 7);
else //quick fix (find a bug)
return 0;
}

// To enable PullDownMenu, place our content in a SilicaFlickable
Expand Down

0 comments on commit b533540

Please sign in to comment.