Merge branch 'emojiAppAdd' of github.com:MiladNazeri/hifi into emojiAppAdd

This commit is contained in:
Zach Fox 2019-08-16 12:14:52 -07:00
commit 301dca6937
2 changed files with 36 additions and 15 deletions

View file

@ -197,13 +197,6 @@ function endReactionWrapper(reaction) {
} }
/*
MILAD NOTE:
Right now you can do more than one reaction at a time so it has to be handled here.
I might see about adding a small flag to the engine so that if a reaction is currently playing it will end it.
This will cut down on a lot of boiler code below checking to see if another reaction is playing. Also because it doesn't
make sense for more than one reaction to be playing.
*/
var EMOTE_APP_BAR_MESSAGE_SOURCE = "EmoteAppBar.qml"; var EMOTE_APP_BAR_MESSAGE_SOURCE = "EmoteAppBar.qml";
function onMessageFromEmoteAppBar(message) { function onMessageFromEmoteAppBar(message) {
console.log("MESSAGE From emote app bar: ", JSON.stringify(message)); console.log("MESSAGE From emote app bar: ", JSON.stringify(message));
@ -213,9 +206,23 @@ function onMessageFromEmoteAppBar(message) {
switch (message.method) { switch (message.method) {
case "positive": case "positive":
triggerReactionWrapper("positive"); triggerReactionWrapper("positive");
emoteAppBarWindow.sendToQml({
"source": "simplifiedEmote.js",
"method": "updateEmoteIndicator",
"data": {
"icon": message.method
}
});
break; break;
case "negative": case "negative":
triggerReactionWrapper("negative"); triggerReactionWrapper("negative");
emoteAppBarWindow.sendToQml({
"source": "simplifiedEmote.js",
"method": "updateEmoteIndicator",
"data": {
"icon": message.method
}
});
break; break;
case "raiseHand": case "raiseHand":
case "applaud": case "applaud":

View file

@ -84,6 +84,8 @@ Rectangle {
Tablet.playSound(TabletEnums.ButtonHover); Tablet.playSound(TabletEnums.ButtonHover);
} }
} }
} }
Row { Row {
@ -98,12 +100,12 @@ Rectangle {
id: emoteButtonsRepeater id: emoteButtonsRepeater
model: ListModel { model: ListModel {
id: buttonsModel id: buttonsModel
ListElement { imageURL: "images/positive_Icon.svg"; method: "positive" } ListElement { imageURL: "images/positive_Icon.svg"; hotkey: "Z"; method: "positive" }
ListElement { imageURL: "images/negative_Icon.svg"; method: "negative" } ListElement { imageURL: "images/negative_Icon.svg"; hotkey: "X"; method: "negative" }
ListElement { imageURL: "images/raiseHand_Icon.svg"; method: "raiseHand" } ListElement { imageURL: "images/raiseHand_Icon.svg"; hotkey: "C"; method: "raiseHand" }
ListElement { imageURL: "images/applaud_Icon.svg"; method: "applaud" } ListElement { imageURL: "images/applaud_Icon.svg"; hotkey: "V"; method: "applaud" }
ListElement { imageURL: "images/point_Icon.svg"; method: "point" } ListElement { imageURL: "images/point_Icon.svg"; hotkey: "B"; method: "point" }
ListElement { imageURL: "images/emote_Icon.svg"; method: "toggleEmojiApp" } ListElement { imageURL: "images/emote_Icon.svg"; hotkey: "N"; method: "toggleEmojiApp" }
} }
Rectangle { Rectangle {
@ -137,6 +139,19 @@ Rectangle {
onEntered: { onEntered: {
Tablet.playSound(TabletEnums.ButtonHover); Tablet.playSound(TabletEnums.ButtonHover);
} }
Rectangle {
anchors.bottom: parent.bottom
anchors.right: parent.right
height: 1
width: 20
color: "transparent"
ToolTip {
text: model.hotkey
visible: emoteTrayMouseArea.containsMouse
}
}
} }
ColorOverlay { ColorOverlay {
@ -157,14 +172,13 @@ Rectangle {
switch (message.method) { switch (message.method) {
case "updateEmoteIndicator": case "updateEmoteIndicator":
if (message.data.icon) { if (message.data.icon) {
print("CHANGING INDICATOR TO: ", message.data.icon); print("CHANGING INDICATOR TO: ", message.data.icon);
var imageURL = "images/" + message.data.icon + "_Icon.svg"; var imageURL = "images/" + message.data.icon + "_Icon.svg";
emoteIndicator.source = imageURL; emoteIndicator.source = imageURL;
} }
break; break;
default: default:
print("MESSAGE TO THE EMOTE INDICATOR QML RECEIVED: ", JSON.stringify(message));
console.log('SimplifiedEmoteIndicator.qml: Unrecognized message from JS'); console.log('SimplifiedEmoteIndicator.qml: Unrecognized message from JS');
break; break;
} }