mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Guild A/B test and Achievement (#8740)
* WIP(guilds): AB test pester modal * WIP(AB-test): guild pester cont'd * fix(style): linting error * fix(AB-test): markModified and notif enum * fix(tests): update AB expectations * fix(modal): remove extra includes * feat(achievements): add Joined Guild cheevo Also removes unused achievement sprites, and properly saves counter used in A/B testing * fix(style): linting error from conflict
This commit is contained in:
@@ -78,7 +78,7 @@ habitrpg.controller('NotificationCtrl',
|
||||
// Avoid showing the same notiication more than once
|
||||
var lastShownNotifications = [];
|
||||
|
||||
function trasnferGroupNotification(notification) {
|
||||
function transferGroupNotification(notification) {
|
||||
if (!User.user.groupNotifications) User.user.groupNotifications = [];
|
||||
User.user.groupNotifications.push(notification);
|
||||
}
|
||||
@@ -110,6 +110,13 @@ habitrpg.controller('NotificationCtrl',
|
||||
var markAsRead = true;
|
||||
|
||||
switch (notification.type) {
|
||||
case 'GUILD_PROMPT':
|
||||
if (notification.data.textVariant === -1) {
|
||||
$rootScope.openModal('testing');
|
||||
} else {
|
||||
$rootScope.openModal('testingVariant');
|
||||
}
|
||||
break;
|
||||
case 'DROPS_ENABLED':
|
||||
$rootScope.openModal('dropsEnabled');
|
||||
break;
|
||||
@@ -129,12 +136,19 @@ habitrpg.controller('NotificationCtrl',
|
||||
}
|
||||
break;
|
||||
case 'ULTIMATE_GEAR_ACHIEVEMENT':
|
||||
$rootScope.playSound('Achievement_Unlocked');
|
||||
Achievement.displayAchievement('ultimateGear', {size: 'md'});
|
||||
break;
|
||||
case 'REBIRTH_ACHIEVEMENT':
|
||||
$rootScope.playSound('Achievement_Unlocked');
|
||||
Achievement.displayAchievement('rebirth');
|
||||
break;
|
||||
case 'GUILD_JOINED_ACHIEVEMENT':
|
||||
$rootScope.playSound('Achievement_Unlocked');
|
||||
Achievement.displayAchievement('joinedGuild', {size: 'md'});
|
||||
break;
|
||||
case 'NEW_CONTRIBUTOR_LEVEL':
|
||||
$rootScope.playSound('Achievement_Unlocked');
|
||||
Achievement.displayAchievement('contributor', {size: 'md'});
|
||||
break;
|
||||
case 'CRON':
|
||||
@@ -144,11 +158,11 @@ habitrpg.controller('NotificationCtrl',
|
||||
}
|
||||
break;
|
||||
case 'GROUP_TASK_APPROVAL':
|
||||
trasnferGroupNotification(notification);
|
||||
transferGroupNotification(notification);
|
||||
markAsRead = false;
|
||||
break;
|
||||
case 'GROUP_TASK_APPROVED':
|
||||
trasnferGroupNotification(notification);
|
||||
transferGroupNotification(notification);
|
||||
markAsRead = false;
|
||||
break;
|
||||
case 'SCORED_TASK':
|
||||
|
||||
Reference in New Issue
Block a user