addFriend() and removeFriend() functionality
This commit is contained in:
@@ -1685,4 +1685,13 @@ public interface Client extends GameShell
|
||||
*/
|
||||
void sortMenuEntries();
|
||||
|
||||
/**
|
||||
* Add player to friendlist
|
||||
*/
|
||||
void addFriend(String name);
|
||||
|
||||
/**
|
||||
* Remove player from friendlist
|
||||
*/
|
||||
void removeFriend(String name);
|
||||
}
|
||||
|
||||
@@ -1607,4 +1607,20 @@ public abstract class RSClientMixin implements RSClient
|
||||
|
||||
return hideFriendAttackOptions && (p.isFriended() || p.isClanMember());
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void addFriend(String friend)
|
||||
{
|
||||
RSFriendSystem friendSystem = getFriendManager();
|
||||
friendSystem.addFriend(friend);
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
public void removeFriend(String friend)
|
||||
{
|
||||
RSFriendSystem friendSystem = getFriendManager();
|
||||
friendSystem.removeFriend(friend);
|
||||
}
|
||||
}
|
||||
@@ -13,4 +13,10 @@ public interface RSFriendSystem extends FriendManager
|
||||
|
||||
@Import("isFriended")
|
||||
boolean isFriended(RSUsername var1, boolean var2);
|
||||
|
||||
@Import("addFriend")
|
||||
void addFriend(String username);
|
||||
|
||||
@Import("removeFriend")
|
||||
void removeFriend(String username);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public class FontName {
|
||||
return 1;
|
||||
} else if (var0 == 3605) {
|
||||
var4 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize];
|
||||
WorldMapArea.friendSystem.method103(var4);
|
||||
WorldMapArea.friendSystem.addFriend(var4);
|
||||
return 1;
|
||||
} else if (var0 == 3606) {
|
||||
var4 = Interpreter.Interpreter_stringStack[--Interpreter.Interpreter_stringStackSize];
|
||||
|
||||
@@ -129,7 +129,8 @@ public class FriendSystem {
|
||||
signature = "(Ljava/lang/String;I)V",
|
||||
garbageValue = "-1721017960"
|
||||
)
|
||||
final void method103(String var1) {
|
||||
@Export("addFriend")
|
||||
final void addFriend(String var1) {
|
||||
if (var1 != null) {
|
||||
Username var2 = new Username(var1, this.loginType);
|
||||
if (var2.hasCleanName()) {
|
||||
|
||||
Reference in New Issue
Block a user