project: wrap up loose ends in api, upstream to fix the broken things

This commit is contained in:
TheRealNull
2021-01-04 01:52:35 -05:00
parent 02b856556c
commit d62af89798
8 changed files with 52 additions and 14 deletions

View File

@@ -2071,4 +2071,6 @@ public interface Client extends GameShell
Widget getWidget(int param1);
Widget getScriptActiveWidget();
ScriptEvent createScriptEvent(Object[] args);
}

View File

@@ -40,13 +40,19 @@ public interface ScriptEvent
String NAME = "event_opbase";
/**
* Gets the widget of the event.
*
* @return the widget
* @see Widget
* Gets the widget the {@link #WIDGET_ID} and {@link #WIDGET_INDEX} args
* are substituted with
*/
Widget getSource();
/**
* Sets the widget the {@link #WIDGET_ID} and {@link #WIDGET_INDEX} args
* are substituted with. This is useful for running widget listeners
*
* @see Widget#getOnLoadListener()
*/
ScriptEvent setSource(Widget widget);
/**
* Gets the menu index of the event
*
@@ -80,4 +86,11 @@ public interface ScriptEvent
* @return
*/
int getTypedKeyChar();
}
/**
* Executes a cs2 script specified by this event
*
* This method must be ran on the client thread and is not reentrant
*/
void run();
}

View File

@@ -25,15 +25,16 @@
package net.runelite.api.events;
import lombok.Value;
import net.runelite.api.Nameable;
/**
* An event where a request to remove a friend is sent to the server.
* An event trigger when a player is removed from the friend or ignore list.
*/
@Value
public class RemovedFriend implements Event
public class RemovedFriend
{
/**
* The name of the removed friend.
* The removed friend or ignore entry
*/
String name;
}
private final Nameable nameable;
}