@@ -32,51 +32,53 @@ public class CDKCommand : IRocketCommand
3232
3333 public void Execute ( IRocketPlayer caller , string [ ] args )
3434 {
35+ var isRich = Main . Instance . Configuration . Instance . EnableRichText ;
3536 if ( args . Length == 1 )
3637 {
3738 if ( ! Main . Instance . Database . IsPurchased ( UnturnedPlayer . FromName ( caller . DisplayName ) , args [ 0 ] ) )
3839 {
3940 switch ( RedeemCDK ( UnturnedPlayer . FromName ( caller . DisplayName ) , args [ 0 ] ) )
4041 {
4142 case EKeyReemeResult . Success :
42- UnturnedChat . Say ( caller , Main . Instance . Translate ( "success" ) ) ;
43+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "success" ) , isRich ) ;
4344 break ;
4445 case EKeyReemeResult . Redeemed :
45- UnturnedChat . Say ( caller , Main . Instance . Translate ( "already_redeemed" ) , UnityEngine . Color . red ) ;
46+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "already_redeemed" ) , UnityEngine . Color . red , isRich ) ;
4647 break ;
4748 case EKeyReemeResult . KeyNotFound :
48- UnturnedChat . Say ( caller , Main . Instance . Translate ( "key_dones't_exist" ) , UnityEngine . Color . red ) ;
49+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "key_dones't_exist" ) , UnityEngine . Color . red , isRich ) ;
4950 break ;
5051 case EKeyReemeResult . MaxRedeemed :
51- UnturnedChat . Say ( caller , Main . Instance . Translate ( "maxcount_reached" ) , UnityEngine . Color . red ) ;
52+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "maxcount_reached" ) , UnityEngine . Color . red , isRich ) ;
5253 break ;
5354 case EKeyReemeResult . Renewed :
54- UnturnedChat . Say ( caller , Main . Instance . Translate ( "key_renewed" ) ) ;
55+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "key_renewed" ) , isRich ) ;
5556 break ;
5657 case EKeyReemeResult . Error :
57- UnturnedChat . Say ( caller , Main . Instance . Translate ( "error" ) , UnityEngine . Color . red ) ;
58+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "error" ) , UnityEngine . Color . red , isRich ) ;
5859 break ;
5960 case EKeyReemeResult . PlayerNotMatch :
60- UnturnedChat . Say ( caller , Main . Instance . Translate ( "player_not_match" ) , UnityEngine . Color . red ) ;
61+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "player_not_match" ) , UnityEngine . Color . red , isRich ) ;
6162 break ;
6263 case EKeyReemeResult . KeyNotValid :
63- UnturnedChat . Say ( caller , Main . Instance . Translate ( "cdk_config_error" ) , UnityEngine . Color . red ) ;
64+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "cdk_config_error" ) , UnityEngine . Color . red , isRich ) ;
6465 break ;
6566 }
6667 }
6768 else
6869 {
69- UnturnedChat . Say ( caller , Main . Instance . Translate ( "already_purchased" ) , UnityEngine . Color . red ) ;
70+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "already_purchased" ) , UnityEngine . Color . red , isRich ) ;
7071 }
7172 }
7273 else
7374 {
74- UnturnedChat . Say ( caller , Main . Instance . Translate ( "invaild_param " , Syntax ) , UnityEngine . Color . red ) ;
75+ UnturnedChat . Say ( caller , Main . Instance . Translate ( "invalid_param " , Syntax ) , UnityEngine . Color . red , isRich ) ;
7576 }
7677 }
7778
7879 private EKeyReemeResult RedeemCDK ( UnturnedPlayer player , string CDK )
7980 {
81+ var isRich = Main . Instance . Configuration . Instance . EnableRichText ;
8082 var Database = Main . Instance . Database ;
8183 try
8284 {
@@ -123,7 +125,7 @@ private EKeyReemeResult RedeemCDK(UnturnedPlayer player, string CDK)
123125 if ( ! player . GiveItem ( Convert . ToUInt16 ( listItem [ i ] ) , Convert . ToByte ( listAmount [ i ] ) ) )
124126 {
125127 UnturnedChat . Say ( player , Main . Instance . Translate ( "items_give_fail" ) ,
126- UnityEngine . Color . red ) ;
128+ UnityEngine . Color . red , isRich ) ;
127129 }
128130 }
129131 }
@@ -154,16 +156,16 @@ private EKeyReemeResult RedeemCDK(UnturnedPlayer player, string CDK)
154156 {
155157 case Rocket . API . RocketPermissionsProviderResult . Success :
156158 UnturnedChat . Say ( player ,
157- Main . Instance . Translate ( "permission_granted" , cdkdata . GrantPermissionGroup ) ) ;
159+ Main . Instance . Translate ( "permission_granted" , cdkdata . GrantPermissionGroup ) , isRich ) ;
158160 break ;
159161 case Rocket . API . RocketPermissionsProviderResult . DuplicateEntry :
160162 UnturnedChat . Say ( player ,
161163 Main . Instance . Translate ( "permission_duplicate_entry" ,
162- cdkdata . GrantPermissionGroup ) , UnityEngine . Color . yellow ) ;
164+ cdkdata . GrantPermissionGroup ) , UnityEngine . Color . yellow , isRich ) ;
163165 break ;
164166 default :
165167 UnturnedChat . Say ( player , Main . Instance . Translate ( "permission_grant_error" , cdkdata . GrantPermissionGroup ) ,
166- UnityEngine . Color . red ) ;
168+ UnityEngine . Color . red , isRich ) ;
167169 break ;
168170 }
169171 }
0 commit comments