-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds some basic kotlin ext functionality to various api members such as NPC, TileObject, etc to allow for interactions directly from them as opposed to calling the static functions in Ethans and passing the member as a paramater. This is how we will modify/extend runelite api instead of direct changes to maintain api integrity
- Loading branch information
Showing
6 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package hotlite.ext | ||
|
||
import com.example.InteractionApi.NPCInteraction | ||
import net.runelite.api.NPC | ||
|
||
object NPCExt { | ||
fun NPC.interact(vararg actions: String) { | ||
NPCInteraction.interact(this, *actions) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package hotlite.ext | ||
|
||
import com.example.InteractionApi.PlayerInteractionHelper | ||
import net.runelite.api.Player | ||
|
||
object PlayerExt { | ||
fun Player.interact(vararg actions: String) { | ||
PlayerInteractionHelper.interact(this, *actions) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package hotlite.ext | ||
|
||
import com.example.InteractionApi.PrayerInteraction | ||
import net.runelite.api.Prayer | ||
|
||
object PrayerExt { | ||
fun Prayer.toggle() { | ||
PrayerInteraction.togglePrayer(this) | ||
} | ||
|
||
fun Prayer.setEnabled(enabled: Boolean) { | ||
PrayerInteraction.setPrayerState(this, enabled) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
runelite-client/src/main/java/hotlite/ext/TileObjectExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package hotlite.ext | ||
|
||
import com.example.InteractionApi.TileObjectInteraction | ||
import net.runelite.api.TileObject | ||
|
||
object TileObjectExt { | ||
fun TileObject.interact(vararg actions: String) { | ||
TileObjectInteraction.interact(this, *actions) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package hotlite.ext | ||
|
||
import com.example.InteractionApi.InventoryInteraction | ||
import net.runelite.api.widgets.Widget | ||
|
||
object WidgetExt { | ||
fun Widget.useItem(vararg actions: String) { | ||
InventoryInteraction.useItem(this, *actions) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters