1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Added notifications for achievements

This commit is contained in:
DJ1TJOO 2021-03-12 19:04:09 +01:00
parent a61b2b0ef0
commit 5f0cd2c675
3 changed files with 6 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -58,7 +58,7 @@ $buildingsAndVariants: belt, balancer, underground_belt, underground_belt-tier2,
background-image: uiResource("res/ui/building_tutorials/virtual_processor-cutter.png") !important;
}
$icons: notification_saved, notification_success, notification_upgrade;
$icons: notification_saved, notification_success, notification_upgrade, notification_achievement;
@each $icon in $icons {
[data-icon="icons/#{$icon}.png"] {
/* @load-async */

View File

@ -7,6 +7,7 @@ export const enumNotificationType = {
saved: "saved",
upgrade: "upgrade",
success: "success",
achievement: "achievement",
};
const notificationDuration = 3;
@ -26,6 +27,10 @@ export class HUDNotifications extends BaseHUDPart {
this.root.signals.gameSaved.add(() =>
this.onNotification(T.ingame.notifications.gameSaved, enumNotificationType.saved)
);
this.root.signals.achievementCompleted.add(key =>
this.onNotification(T.achievements[key].title, enumNotificationType.achievement)
);
}
/**