11using System ;
22using System . Threading . Tasks ;
33using ModReloader . Common . BuilderToggles ;
4- using ModReloader . UI . Elements . ButtonElements ;
54using ModReloader . UI . Elements . PanelElements ;
65using Terraria . UI ;
76
@@ -18,7 +17,7 @@ public sealed class HerosModIntegration : ModSystem
1817
1918 public override void PostSetupContent ( )
2019 {
21- if ( ModLoader . TryGetMod ( "HEROsMod" , out Mod herosMod ) && ! Main . dedServ )
20+ if ( ModLoader . TryGetMod ( "HEROsMod" , out Mod herosMod ) )
2221 {
2322 RegisterReloadSPButton ( herosMod ) ;
2423 RegisterReloadMPButton ( herosMod ) ;
@@ -30,19 +29,13 @@ public override void PostSetupContent()
3029
3130 private static void RegisterReloadSPButton ( Mod herosMod )
3231 {
33- herosMod . Call ( "AddPermission" , PermReloadSP , "Reloads mods" ) ;
32+ herosMod . Call ( "AddPermission" , PermReloadMP , Loc . Get ( "ReloadButton.HoverText" , string . Join ( ", " , Conf . C . ModsToReload ) ) ) ;
3433 herosMod . Call (
3534 "AddSimpleButton" ,
3635 PermReloadSP ,
3736 Ass . ButtonReloadSPHeros ,
3837 GuardedAsync ( ReloadUtilities . SinglePlayerReload ) ,
39- ( Action < bool > ) ( hasPerm =>
40- {
41- if ( ! hasPerm )
42- {
43- Main . NewText ( $ "⛔ You lost permission to use the { PermReloadSP } button!", ColorHelper . CalamityRed ) ;
44- }
45- } ) ,
38+ ( Action < bool > ) ( hasPerm => PermissionChanged ( hasPerm , PermLogPanel ) ) ,
4639 ( Func < string > ) ( ( ) => GetReloadTooltip ( ) )
4740 ) ;
4841 }
@@ -148,12 +141,12 @@ private static void PermissionChanged(bool hasPerm, string permissionName)
148141 {
149142 if ( ! hasPerm )
150143 {
151- Main . NewText ( $ "⛔ You lost permission to use the { permissionName } button!", ColorHelper . CalamityRed ) ;
144+ // Main.NewText($"⛔ You lost permission to use the {permissionName} button!", ColorHelper.CalamityRed);
152145 Log . Info ( $ "You lost permission for { permissionName } button. You cannot use it anymore.") ;
153146 }
154147 else
155148 {
156- Main . NewText ( $ "✅ You regained permission to use the { permissionName } button!", Color . LightGreen ) ;
149+ // Main.NewText($"✅ You regained permission to use the {permissionName} button!", Color.LightGreen);
157150 Log . Info ( $ "You regained permission for { permissionName } button. You can use it again.") ;
158151 }
159152 }
0 commit comments