Skip to content

Commit

Permalink
block wrong melody fix maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
SubAt0m1c committed Dec 31, 2024
1 parent 97429c7 commit fca6783
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import me.odinmain.events.impl.GuiEvent
import me.odinmain.features.impl.floor7.p3.TerminalSolver
import me.odinmain.features.impl.floor7.p3.TerminalSolver.canClick
import me.odinmain.features.impl.floor7.p3.TerminalSolver.currentTerm
import me.odinmain.features.impl.floor7.p3.TerminalTypes
import me.odinmain.utils.postAndCatch
import me.odinmain.utils.render.Box
import me.odinmain.utils.render.isPointWithin
Expand Down Expand Up @@ -34,7 +35,7 @@ abstract class TermGui {

fun mouseClicked(x: Int, y: Int, button: Int) {
itemIndexMap.entries.find { it.value.isPointWithin(x, y) }?.let { (slot, _) ->
if (System.currentTimeMillis() - currentTerm.timeOpened < 300 || !canClick(slot, button) || (GuiEvent.CustomTermGuiClick(slot, if (button == 0) 3 else 0, button).postAndCatch())) return
if (System.currentTimeMillis() - currentTerm.timeOpened < 300 || (!canClick(slot, button) && currentTerm.type != TerminalTypes.MELODY) || (GuiEvent.CustomTermGuiClick(slot, if (button == 0) 3 else 0, button).postAndCatch())) return
if (currentTerm.clickedSlot?.second?.let { System.currentTimeMillis() - it < 600 } != true) currentTerm.clickedSlot = slot to System.currentTimeMillis()
windowClick(slot, if (button == 1) ClickType.Right else ClickType.Middle, true)
}
Expand Down

0 comments on commit fca6783

Please sign in to comment.