@@ -18,7 +18,7 @@ public partial class Deathmatch : BasePlugin, IPluginConfig<DeathmatchConfig>
1818{
1919 public override string ModuleName => "Deathmatch Core" ;
2020 public override string ModuleAuthor => "Nocky" ;
21- public override string ModuleVersion => "1.2.3 " ;
21+ public override string ModuleVersion => "1.2.4 " ;
2222
2323 public void OnConfigParsed ( DeathmatchConfig config )
2424 {
@@ -110,7 +110,7 @@ public override void Load(bool hotReload)
110110 }
111111 SetupCustomMode ( NextMode . ToString ( ) ) ;
112112 }
113- if ( ! string . IsNullOrEmpty ( ActiveMode . CenterMessageText ) && Config . CustomModes . TryGetValue ( NextMode . ToString ( ) , out var modeData ) )
113+ if ( ! string . IsNullOrEmpty ( ActiveMode . CenterMessageText ) && Config . CustomModes . TryGetValue ( NextMode . ToString ( ) , out var modeData ) )
114114 {
115115 var time = TimeSpan . FromSeconds ( RemainingTime ) ;
116116 var formattedTime = $ "{ time . Minutes } :{ time . Seconds : D2} "; //RemainingTime > 60 ? $"{time.Minutes}:{time.Seconds:D2}" : $"{time.Seconds}";
@@ -137,7 +137,7 @@ public override void Load(bool hotReload)
137137 }
138138 else
139139 {
140- if ( ! GetPrefsValue ( p . Slot , "HudMessages" ) || MenuManager . GetActiveMenu ( p ) != null )
140+ if ( ( Config . PlayersPreferences . HudMessages . Enabled && ! GetPrefsValue ( p . Slot , "HudMessages" ) ) || MenuManager . GetActiveMenu ( p ) != null )
141141 continue ;
142142
143143 if ( ! string . IsNullOrEmpty ( ActiveMode . CenterMessageText ) )
@@ -179,6 +179,29 @@ public override void Load(bool hotReload)
179179 } , HookMode . Pre ) ;
180180 }
181181
182+ if ( Config . General . RemovePointsMessage )
183+ {
184+ HookUserMessage ( 124 , um =>
185+ {
186+ if ( IsCasualGamemode )
187+ return HookResult . Continue ;
188+
189+ for ( int i = 0 ; i < um . GetRepeatedFieldCount ( "param" ) ; i ++ )
190+ {
191+ var message = um . ReadString ( "param" , i ) ;
192+ foreach ( var msg in PointsMessagesArray )
193+ {
194+ if ( message . Contains ( msg ) )
195+ {
196+ return HookResult . Stop ;
197+ }
198+ }
199+
200+ }
201+ return HookResult . Continue ;
202+ } , HookMode . Pre ) ;
203+ }
204+
182205 if ( hotReload )
183206 {
184207 Server . ExecuteCommand ( $ "map { Server . MapName } ") ;
@@ -206,7 +229,7 @@ public void SetupCustomMode(string modeId)
206229 ActiveCustomMode = modeId ;
207230 NextMode = GetModeType ( ) ;
208231
209- if ( Config . CustomModes . TryGetValue ( NextMode . ToString ( ) , out var modeData ) && ! string . IsNullOrEmpty ( ActiveMode . CenterMessageText ) )
232+ if ( Config . CustomModes . TryGetValue ( NextMode . ToString ( ) , out var modeData ) && ! string . IsNullOrEmpty ( ActiveMode . CenterMessageText ) )
210233 {
211234 ModeCenterMessage = ActiveMode . CenterMessageText . Replace ( "{NEXTMODE}" , modeData . Name ) ;
212235 ModeCenterMessage = ModeCenterMessage . Replace ( "{REMAININGTIME}" , RemainingTime . ToString ( ) ) ;
@@ -215,7 +238,7 @@ public void SetupCustomMode(string modeId)
215238
216239 Server . NextFrame ( ( ) =>
217240 {
218- DeathmatchAPI . Get ( ) ? . TriggerEvent ( new OnCustomModeStarted ( int . Parse ( ActiveCustomMode ) ) ) ;
241+ DeathmatchAPI . Get ( ) ? . TriggerEvent ( new OnCustomModeStarted ( int . Parse ( ActiveCustomMode ) , ActiveMode ) ) ;
219242 } ) ;
220243 }
221244
0 commit comments