mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-05 16:49:06 +00:00
Plugins Fixup / Conversion(#511)
* Server: Ripped PluginService From Astreaus-V2 This Removes The Need For Plugin MetaData * Plugins: Handle Emote Tab Run Buttons * Add Some Settings Button Plugins Brightness Buttons Music Volume Buttons Walk/Run Buttons Toggle SplitPrivate-Chat * Fix Player Still Running With 0 Energy Fixes Players Continuing To Run For The Rest Of Their Current Movement Task Even If They Run Out Of Energy
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package plugin.buttons.gameframe
|
||||
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ButtonActionEvent
|
||||
import com.rs2.game.items.impl.LightSources
|
||||
import com.rs2.game.players.Player
|
||||
import plugin.buttons.ButtonClick
|
||||
|
||||
@SubscribesTo(ButtonActionEvent::class)
|
||||
class BrightnessButtons : ButtonClick() {
|
||||
|
||||
override fun execute(player: Player, event: ButtonActionEvent) {
|
||||
when (event.button) {
|
||||
3138 -> LightSources.brightness1(player)
|
||||
3140 -> LightSources.brightness2(player)
|
||||
3142 -> LightSources.brightness3(player)
|
||||
3144 -> LightSources.brightness4(player)
|
||||
}
|
||||
}
|
||||
|
||||
override fun test(event: ButtonActionEvent): Boolean {
|
||||
return event.button == 3138 || event.button == 3140 || event.button == 3142 || event.button == 912
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ class LogoutButton : ButtonClick() {
|
||||
}
|
||||
|
||||
override fun test(event: ButtonActionEvent): Boolean {
|
||||
return event.button == 9154;
|
||||
return event.button == 9154
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package plugin.buttons.gameframe
|
||||
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ButtonActionEvent
|
||||
import com.rs2.game.content.music.Music
|
||||
import com.rs2.game.players.Player
|
||||
import plugin.buttons.ButtonClick
|
||||
|
||||
@SubscribesTo(ButtonActionEvent::class)
|
||||
class MusicVolumeButtons : ButtonClick() {
|
||||
|
||||
override fun execute(player: Player, event: ButtonActionEvent) {
|
||||
when (event.button) {
|
||||
3162 -> {
|
||||
if (player.musicOn) {
|
||||
player.musicOn = false
|
||||
} else {
|
||||
player.packetSender.sendMessage("Your music is already turned off.")
|
||||
}
|
||||
}
|
||||
3163,3164,3165,3166 -> {
|
||||
Music.playMusic(player)
|
||||
player.musicOn = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun test(event: ButtonActionEvent): Boolean {
|
||||
return event.button == 3162 || event.button == 3163 || event.button == 3164 || event.button == 3165 || event.button == 3166
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package plugin.buttons.gameframe
|
||||
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ButtonActionEvent
|
||||
import com.rs2.game.players.Player
|
||||
import plugin.buttons.ButtonClick
|
||||
|
||||
|
||||
@SubscribesTo(ButtonActionEvent::class)
|
||||
class ToggleRunButtons : ButtonClick() {
|
||||
|
||||
override fun execute(player: Player, event: ButtonActionEvent) {
|
||||
when (event.button) {
|
||||
152 -> {
|
||||
player.packetSender.sendConfig(173, 0)
|
||||
player.isRunning = false
|
||||
player.isRunning2 = false
|
||||
|
||||
}
|
||||
|
||||
153 -> {
|
||||
if (player.tutorialProgress == 11) {
|
||||
player.dialogueHandler.sendDialogues(3041, 0)
|
||||
}
|
||||
player.packetSender.sendConfig(173, 1)
|
||||
player.isRunning = true
|
||||
player.isRunning2 = true
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun test(event: ButtonActionEvent): Boolean {
|
||||
return event.button == 152 || event.button == 153
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package plugin.buttons.gameframe
|
||||
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.ButtonActionEvent
|
||||
import com.rs2.game.players.Player
|
||||
import plugin.buttons.ButtonClick
|
||||
|
||||
|
||||
@SubscribesTo(ButtonActionEvent::class)
|
||||
class ToggleSplitChatButtons : ButtonClick() {
|
||||
|
||||
override fun execute(player: Player, event: ButtonActionEvent) {
|
||||
when (event.button) {
|
||||
3189 -> {
|
||||
player.packetSender.sendConfig(502, 1)
|
||||
player.packetSender.sendConfig(287, 1)
|
||||
player.splitChat = true
|
||||
}
|
||||
|
||||
3190 -> {
|
||||
player.packetSender.sendConfig(502, 0)
|
||||
player.packetSender.sendConfig(287, 0)
|
||||
player.splitChat = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun test(event: ButtonActionEvent): Boolean {
|
||||
return event.button == 3189 || event.button == 3190
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "Logout Button",
|
||||
"description": "The button for logging a player out.",
|
||||
"group": "button",
|
||||
"base": "plugin.buttons.gameframe.LogoutButton",
|
||||
"authors": [
|
||||
"Vult-R"
|
||||
],
|
||||
"version": 1.0
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user