|
10 | 10 | import meteordevelopment.meteorclient.events.meteor.MouseClickEvent; |
11 | 11 | import meteordevelopment.meteorclient.events.packets.PacketEvent; |
12 | 12 | import meteordevelopment.meteorclient.events.world.TickEvent; |
13 | | -import meteordevelopment.meteorclient.settings.BoolSetting; |
14 | | -import meteordevelopment.meteorclient.settings.EnumSetting; |
15 | | -import meteordevelopment.meteorclient.settings.Setting; |
16 | | -import meteordevelopment.meteorclient.settings.SettingGroup; |
| 13 | +import meteordevelopment.meteorclient.settings.*; |
17 | 14 | import meteordevelopment.meteorclient.systems.friends.Friend; |
18 | 15 | import meteordevelopment.meteorclient.systems.friends.Friends; |
19 | 16 | import meteordevelopment.meteorclient.systems.modules.Categories; |
@@ -44,13 +41,21 @@ public class MiddleClickExtra extends Module { |
44 | 41 | ); |
45 | 42 |
|
46 | 43 | private final Setting<Boolean> message = sgGeneral.add(new BoolSetting.Builder() |
47 | | - .name("message") |
48 | | - .description("Sends a message to the player when you add them as a friend.") |
| 44 | + .name("send-message") |
| 45 | + .description("Sends a message when you add a player as a friend.") |
49 | 46 | .defaultValue(false) |
50 | 47 | .visible(() -> mode.get() == Mode.AddFriend) |
51 | 48 | .build() |
52 | 49 | ); |
53 | 50 |
|
| 51 | + private final Setting<String> friendMessage = sgGeneral.add(new StringSetting.Builder() |
| 52 | + .name("message-to-send") |
| 53 | + .description("Message to send when you add a player as a friend (use %player for the player's name)") |
| 54 | + .defaultValue("/msg %player I just friended you on Meteor.") |
| 55 | + .visible(() -> mode.get() == Mode.AddFriend) |
| 56 | + .build() |
| 57 | + ); |
| 58 | + |
54 | 59 | private final Setting<Boolean> quickSwap = sgGeneral.add(new BoolSetting.Builder() |
55 | 60 | .name("quick-swap") |
56 | 61 | .description("Allows you to use items in your inventory by simulating hotbar key presses. May get flagged by anticheats.") |
@@ -109,7 +114,11 @@ private void onMouseClick(MouseClickEvent event) { |
109 | 114 | if (!Friends.get().isFriend(player)) { |
110 | 115 | Friends.get().add(new Friend(player)); |
111 | 116 | info("Added %s to friends", player.getName().getString()); |
112 | | - if (message.get()) ChatUtils.sendPlayerMsg("/msg " + player.getName() + " I just friended you on Meteor."); |
| 117 | + if (message.get()) { |
| 118 | + String messageNotify = friendMessage.get().replace("%player", player.getName().getString()); |
| 119 | + ChatUtils.sendPlayerMsg(messageNotify); |
| 120 | + } |
| 121 | + |
113 | 122 | } else { |
114 | 123 | Friends.get().remove(Friends.get().get(player)); |
115 | 124 | info("Removed %s from friends", player.getName().getString()); |
|
0 commit comments