@@ -128,11 +128,19 @@ class CodeXPService : PersistentStateComponent<CodeXPState>, CodeXPEventListener
128
128
val currentLevelInfo = CodeXPLevel .createLevelInfo(codeXPState.xp)
129
129
130
130
if (beforeLevelInfo.level != currentLevelInfo.level && beforeLevelInfo.level != 0 && codeXPState.codeXPConfiguration.showLevelUpNotification) {
131
- CodeXPNotificationManager .notifyLevelUp(
132
- codeXPState.nickname,
133
- currentLevelInfo.level,
134
- currentLevelInfo.totalXPForNextLevel
135
- )
131
+ if (codeXPState.codeXPConfiguration.showLevelUpNotification) {
132
+ when (codeXPState.codeXPConfiguration.notificationType) {
133
+ " Intellij Notification" ->
134
+ CodeXPNotificationManager .notifyLevelUp(
135
+ codeXPState.nickname,
136
+ currentLevelInfo.level,
137
+ currentLevelInfo.totalXPForNextLevel
138
+ )
139
+
140
+ " CodeXP Notification" ->
141
+ messageBus.syncPublisher(CodeXPListener .CODEXP ).levelUp(currentLevelInfo)
142
+ }
143
+ }
136
144
}
137
145
138
146
messageBus.syncPublisher(CodeXPListener .CODEXP ).xpUpdated(currentLevelInfo)
@@ -150,11 +158,17 @@ class CodeXPService : PersistentStateComponent<CodeXPState>, CodeXPEventListener
150
158
if (challenge.progress >= challenge.goal) {
151
159
increaseXP(challenge.rewardXP)
152
160
replaceChallengeWithNew(challenge, event)
153
- CodeXPUIManager .showCodeXPDialog()
154
161
155
- if (codeXPState.codeXPConfiguration.showCompleteChallengeNotification)
156
- CodeXPNotificationManager .notifyChallengeComplete(challenge)
162
+ if (codeXPState.codeXPConfiguration.showCompleteChallengeNotification) {
163
+ when (codeXPState.codeXPConfiguration.notificationType) {
164
+ " Intellij Notification" -> CodeXPNotificationManager .notifyChallengeComplete(
165
+ challenge
166
+ )
157
167
168
+ " CodeXP Notification" ->
169
+ messageBus.syncPublisher(CodeXPListener .CODEXP ).challengeCompleted(event, challenge)
170
+ }
171
+ }
158
172
messageBus.syncPublisher(CodeXPListener .CODEXP )
159
173
.challengeUpdated(event, challenge, state.challenges[event])
160
174
} else {
0 commit comments