fixed cooking make-x UI issues introduced by !464
This commit is contained in:
@@ -61,18 +61,8 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
|
|||||||
end()
|
end()
|
||||||
val amount = getAmount(buttonID)
|
val amount = getAmount(buttonID)
|
||||||
when (amount) {
|
when (amount) {
|
||||||
-1 -> {
|
-1 -> sendInputDialogue(player!!, true, "Enter the amount:") { value -> cook(player!!, `object`, initial, product, value as Int) }
|
||||||
val handler: SkillDialogueHandler =
|
|
||||||
object : SkillDialogueHandler(player!!, SkillDialogue.ONE_OPTION, Item(product)) {
|
|
||||||
override fun create(amount: Int, index: Int) {
|
|
||||||
cook(player, `object`, initial, product, amount)
|
|
||||||
}
|
|
||||||
override fun getAll(index: Int) : Int {
|
|
||||||
return getAmount(amountInInventory(player, initial))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
handler.open()
|
|
||||||
}
|
|
||||||
else -> {
|
else -> {
|
||||||
end()
|
end()
|
||||||
cook(player!!, `object`, initial, product, amount)
|
cook(player!!, `object`, initial, product, amount)
|
||||||
@@ -83,28 +73,12 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
|
|||||||
100 -> {
|
100 -> {
|
||||||
when (buttonID) {
|
when (buttonID) {
|
||||||
1 -> {
|
1 -> {
|
||||||
val handler: SkillDialogueHandler =
|
product = Items.SINEW_9436
|
||||||
object : SkillDialogueHandler(player!!, SkillDialogue.ONE_OPTION, Item(Items.SINEW_9436)) {
|
display(Items.COOKED_MEAT_2142)
|
||||||
override fun create(amount: Int, index: Int) {
|
|
||||||
cook(player, `object`, initial, Items.SINEW_9436, amount)
|
|
||||||
}
|
|
||||||
override fun getAll(index: Int) : Int {
|
|
||||||
return getAmount(amountInInventory(player, initial))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
handler.open()
|
|
||||||
}
|
}
|
||||||
2 -> {
|
2 -> {
|
||||||
val handler: SkillDialogueHandler =
|
product = CookableItems.forId(initial).cooked
|
||||||
object : SkillDialogueHandler(player!!, SkillDialogue.ONE_OPTION, Item(CookableItems.forId(itemid).cooked)) {
|
display()
|
||||||
override fun create(amount: Int, index: Int) {
|
|
||||||
cook(player, `object`, initial, CookableItems.forId(itemid).cooked, amount)
|
|
||||||
}
|
|
||||||
override fun getAll(index: Int) : Int {
|
|
||||||
return getAmount(amountInInventory(player, itemid))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
handler.open()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,13 +95,12 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
fun display() {
|
fun display(vararg args : Int) {
|
||||||
player!!.interfaceManager.openChatbox(307)
|
player!!.interfaceManager.openChatbox(307)
|
||||||
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 3, 60, 90))
|
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 3, 60, 90))
|
||||||
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 2, 208, 20))
|
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 2, 208, 20))
|
||||||
player!!.packetDispatch.sendItemZoomOnInterface(product, 160, 307, 2)
|
player!!.packetDispatch.sendItemZoomOnInterface(if(args.size == 1) args[0] else product, 160, 307, 2)
|
||||||
player!!.packetDispatch.sendString(ItemDefinition.forId(product).name, 307, 3)
|
player!!.packetDispatch.sendString(ItemDefinition.forId(product).name, 307, 3)
|
||||||
stage = 1
|
stage = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user