File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
kotlin/com/github/ilovegamecoding/intellijcodexp/manager Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com.github.ilovegamecoding.intellijcodexp.manager
2
+
3
+ import com.github.ilovegamecoding.intellijcodexp.model.CodeXPChallenge
4
+ import com.intellij.notification.NotificationGroup
5
+ import com.intellij.notification.NotificationGroupManager
6
+ import com.intellij.notification.NotificationType
7
+
8
+ object CodeXPNotificationManager {
9
+ private val notifiationGroup: NotificationGroup =
10
+ NotificationGroupManager .getInstance().getNotificationGroup(" CodeXP" )
11
+
12
+ fun notify (title : String , content : String ) {
13
+ notifiationGroup.createNotification(title, content, NotificationType .INFORMATION ).notify(null )
14
+ }
15
+
16
+ fun notifyChallengeComplete (codeXPChallenge : CodeXPChallenge ) {
17
+ notify(" ${codeXPChallenge.name} completed!" , " Reward: ${codeXPChallenge.rewardXP} XP" )
18
+ }
19
+
20
+ fun notifyLevelUp (level : Int , xpToNextLevel : Long ) {
21
+ notify(" Level up!" , " Congratulations! You are now level $level . You need $xpToNextLevel XP to reach the next level." )
22
+ }
23
+ }
Original file line number Diff line number Diff line change 12
12
<toolWindow factoryClass =" com.github.ilovegamecoding.intellijcodexp.toolWindow.CodeXPToolWindowFactory"
13
13
id =" CodeXPToolWindow" />
14
14
<applicationService serviceImplementation =" com.github.ilovegamecoding.intellijcodexp.services.CodeXPService" />
15
+ <notificationGroup displayType =" BALLOON" id =" CodeXP" />
15
16
</extensions >
16
17
17
18
<application-components >
You can’t perform that action at this time.
0 commit comments