mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-14 18:40:18 -07:00
Merge branch 'potato-bugfix' into 'master'
Fixed a bug with rotten potato input dialogues See merge request 2009scape/2009scape!157
This commit is contained in:
commit
f6037f2960
2 changed files with 7 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package rs09.game.system.command.rottenpotato
|
package rs09.game.system.command.rottenpotato
|
||||||
|
|
||||||
import api.ContentAPI
|
import api.ContentAPI
|
||||||
|
import api.InputType
|
||||||
import core.game.content.dialogue.DialoguePlugin
|
import core.game.content.dialogue.DialoguePlugin
|
||||||
import core.game.node.entity.npc.NPC
|
import core.game.node.entity.npc.NPC
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
|
|
@ -38,7 +39,7 @@ class RottenPotatoExtraDialogue(player: Player? = null) : DialoguePlugin(player)
|
||||||
//Send Player Notification
|
//Send Player Notification
|
||||||
1 -> {
|
1 -> {
|
||||||
end()
|
end()
|
||||||
ContentAPI.sendInputDialogue(player, false, "Enter the notification message:"){value ->
|
ContentAPI.sendInputDialogue(player, InputType.STRING_LONG, "Enter the notification message:"){ value ->
|
||||||
val message = value as String
|
val message = value as String
|
||||||
for (p in Repository.players) {
|
for (p in Repository.players) {
|
||||||
p ?: continue
|
p ?: continue
|
||||||
|
|
@ -61,7 +62,7 @@ class RottenPotatoExtraDialogue(player: Player? = null) : DialoguePlugin(player)
|
||||||
//Force Area NPC Chat
|
//Force Area NPC Chat
|
||||||
4 -> {
|
4 -> {
|
||||||
end()
|
end()
|
||||||
ContentAPI.sendInputDialogue(player, false,"Enter the chat message:"){value ->
|
ContentAPI.sendInputDialogue(player, InputType.STRING_LONG,"Enter the chat message:"){ value ->
|
||||||
val msg = value as String
|
val msg = value as String
|
||||||
RegionManager.getLocalNpcs(player).forEach {
|
RegionManager.getLocalNpcs(player).forEach {
|
||||||
it.sendChat(msg)
|
it.sendChat(msg)
|
||||||
|
|
@ -81,7 +82,7 @@ class RottenPotatoExtraDialogue(player: Player? = null) : DialoguePlugin(player)
|
||||||
//AME Spawning
|
//AME Spawning
|
||||||
100 -> {
|
100 -> {
|
||||||
end()
|
end()
|
||||||
ContentAPI.sendInputDialogue(player, false, "Enter player name:"){value ->
|
ContentAPI.sendInputDialogue(player, InputType.STRING_SHORT, "Enter player name:"){ value ->
|
||||||
val other = Repository.getPlayerByName(value.toString().toLowerCase().replace(" ", "_"))
|
val other = Repository.getPlayerByName(value.toString().toLowerCase().replace(" ", "_"))
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
player.sendMessage(colorize("%RInvalid player name."))
|
player.sendMessage(colorize("%RInvalid player name."))
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package rs09.game.system.command.rottenpotato
|
package rs09.game.system.command.rottenpotato
|
||||||
|
|
||||||
import api.ContentAPI
|
import api.ContentAPI
|
||||||
|
import api.InputType
|
||||||
import core.game.content.dialogue.DialoguePlugin
|
import core.game.content.dialogue.DialoguePlugin
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.player.info.login.PlayerParser
|
import core.game.node.entity.player.info.login.PlayerParser
|
||||||
|
|
@ -53,7 +54,7 @@ class RottenPotatoRSHDDialogue(player: Player? = null) : DialoguePlugin(player)
|
||||||
//View Bank
|
//View Bank
|
||||||
4 -> {
|
4 -> {
|
||||||
end()
|
end()
|
||||||
ContentAPI.sendInputDialogue(player, false, "Enter player name:"){value ->
|
ContentAPI.sendInputDialogue(player, InputType.STRING_SHORT, "Enter player name:"){ value ->
|
||||||
val other = Repository.getPlayerByName(value.toString().toLowerCase().replace(" ","_"))
|
val other = Repository.getPlayerByName(value.toString().toLowerCase().replace(" ","_"))
|
||||||
if(other == null){
|
if(other == null){
|
||||||
player.sendMessage(colorize("%RInvalid player name."))
|
player.sendMessage(colorize("%RInvalid player name."))
|
||||||
|
|
@ -66,7 +67,7 @@ class RottenPotatoRSHDDialogue(player: Player? = null) : DialoguePlugin(player)
|
||||||
//View Inventory
|
//View Inventory
|
||||||
5 -> {
|
5 -> {
|
||||||
end()
|
end()
|
||||||
ContentAPI.sendInputDialogue(player, false, "Enter player name:"){value ->
|
ContentAPI.sendInputDialogue(player, InputType.STRING_SHORT, "Enter player name:"){ value ->
|
||||||
val other = Repository.getPlayerByName(value.toString().toLowerCase().replace(" ","_"))
|
val other = Repository.getPlayerByName(value.toString().toLowerCase().replace(" ","_"))
|
||||||
if(other == null){
|
if(other == null){
|
||||||
player.sendMessage(colorize("%RInvalid player name."))
|
player.sendMessage(colorize("%RInvalid player name."))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue