mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-20 13:30:30 -07:00
rollback unrelated changes
This commit is contained in:
parent
5790dc3fb9
commit
39ac51b109
1 changed files with 51 additions and 0 deletions
51
plugin-playground/src/main/kotlin/BetterShiftDrop/plugin.kt
Normal file
51
plugin-playground/src/main/kotlin/BetterShiftDrop/plugin.kt
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
package BetterShiftDrop
|
||||||
|
|
||||||
|
import plugin.Plugin
|
||||||
|
import plugin.annotations.PluginMeta
|
||||||
|
import plugin.api.API
|
||||||
|
import plugin.api.MiniMenuEntry
|
||||||
|
import rt4.Cheat
|
||||||
|
import rt4.Keyboard
|
||||||
|
|
||||||
|
@PluginMeta(
|
||||||
|
author = "bushtail",
|
||||||
|
description = "Better dropping and destroying while holding shift. Use ::bsd command to toggle. If for some reason after installing the plugin, Better Shift Drop does not activate, run the command to activate it.",
|
||||||
|
version = 2.0
|
||||||
|
)
|
||||||
|
class plugin : Plugin() {
|
||||||
|
override fun Init() {
|
||||||
|
if(API.GetData("bsd-toggle") == null) {
|
||||||
|
API.StoreData("bsd-toggle", true)
|
||||||
|
Cheat.shiftClick = false
|
||||||
|
} else if(API.GetData("bsd-toggle") == true) {
|
||||||
|
Cheat.shiftClick = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
override fun OnMiniMenuCreate(currentEntries: Array<out MiniMenuEntry>?) {
|
||||||
|
if(currentEntries == null) return
|
||||||
|
if(API.GetData("bsd-toggle") == true) {
|
||||||
|
if(API.IsKeyPressed(Keyboard.KEY_SHIFT)) {
|
||||||
|
for(entry in currentEntries) {
|
||||||
|
if(entry.verb.toLowerCase() == "drop" || entry.verb.toLowerCase() == "destroy") continue
|
||||||
|
if(!entry.isStrictlySecondary) entry.toggleStrictlySecondary()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun ProcessCommand(commandStr: String?, args: Array<out String>?) {
|
||||||
|
super.ProcessCommand(commandStr, args)
|
||||||
|
when(commandStr) {
|
||||||
|
"::bsd" -> {
|
||||||
|
if(API.GetData("bsd-toggle") == true) {
|
||||||
|
API.StoreData("bsd-toggle", false)
|
||||||
|
} else if(API.GetData("bsd-toggle") == false) {
|
||||||
|
API.StoreData("bsd-toggle", true)
|
||||||
|
} else {
|
||||||
|
API.StoreData("bsd-toggle", true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue