Commit 5b2e5992 authored by Akshat Tandon's avatar Akshat Tandon Committed by Johnny Jazeix
Browse files

letter-in-word, disable clicks until the level changes.

parent 6a110497
......@@ -29,6 +29,7 @@ Item {
id: cardItem
//width: cardImage.width
height: wordPic.height + cardImage.height - 30 * ApplicationInfo.ratio
property bool mouseActive: true
Image{
id: wordPic
......@@ -79,14 +80,15 @@ Item {
clip: false
}
states: State {
name: "scaled"; when: mouseArea.containsMouse
PropertyChanges {
target: cardItem
scale: /*carriageImage.scale * */ 1.2
z: 2
states:
State {
name: "scaled"; when: mouseArea.containsMouse && mouseActive
PropertyChanges {
target: cardItem
scale: /*carriageImage.scale * */ 1.2
z: 2
}
}
}
transitions: Transition {
NumberAnimation { properties: "scale"; easing.type: Easing.OutCubic }
......@@ -149,31 +151,34 @@ Item {
anchors.fill: parent
hoverEnabled: ApplicationInfo.isMobile ? false : true
onClicked: {
if (Activity.checkWord(index)) {
successAnimation.restart();
particle.burst(30)
components.clear();
var tempword;
var j = 0;
for(var i = 0; i < spelling.length; i++) {
if(spelling.charAt(i) == Activity.currentLetter) {
tempword = spelling.substring(j, i);
if(i != j) {
components.append({"textdata": tempword})
if(mouseActive){
if (Activity.checkWord(index)) {
successAnimation.restart();
particle.burst(30)
components.clear();
var tempword;
var j = 0;
for(var i = 0; i < spelling.length; i++) {
if(spelling.charAt(i) == Activity.currentLetter) {
tempword = spelling.substring(j, i);
if(i != j) {
components.append({"textdata": tempword})
}
components.append({"textdata": Activity.currentLetter});
j = i + 1;
}
components.append({"textdata": Activity.currentLetter});
}
if(j < spelling.length) {
tempword = spelling.substring(j, spelling.length);
components.append({"textdata": tempword})
j = i + 1;
}
}
if(j < spelling.length) {
tempword = spelling.substring(j, spelling.length);
components.append({"textdata": tempword})
} else {
failureAnimation.restart()
}
} else {
failureAnimation.restart()
}
}
}
......
......@@ -120,7 +120,7 @@ ActivityBase {
onSaveData: {
var oldLocale = background.locale;
var newLocale =
dialogActivityConfig.configItem.availableLangs[dialogActivityConfig.loader.item.localeBox.currentIndex].locale;
dialogActivityConfig.configItem.availableLangs[dialogActivityConfig.loader.item.localeBox.currentIndex].locale;
// Remove .UTF-8
if(newLocale.indexOf('.') != -1) {
newLocale = newLocale.substring(0, newLocale.indexOf('.'))
......@@ -184,7 +184,7 @@ ActivityBase {
Bonus {
id: bonus
interval: 1000
interval: 100
Component.onCompleted: {
win.connect(Activity.nextSubLevel);
loose.connect(Activity.incorrectSelection);
......@@ -211,7 +211,7 @@ ActivityBase {
GCText {
id: questionItem
anchors.right: planeText.right
anchors.right: planeText.right
anchors.rightMargin: 2 * plane.width / 3
anchors.verticalCenter: planeText.verticalCenter
anchors.bottomMargin: 10 * ApplicationInfo.ratio
......@@ -277,6 +277,17 @@ ActivityBase {
model: wordsModel
delegate: Card {
width: background.itemWidth
Connections {
target: bonus
onStart: {
mouseActive = false;
}
onStop: {
mouseActive = true;
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment