Use the xor operator in ButtonImpl.kt, and use "&&" instead of the "and" method in ClickGui.kt
This commit is contained in:
parent
fd4a380acb
commit
8e0848a497
|
@ -18,7 +18,7 @@ object ClickGui: SnowyScreen() {
|
|||
override fun mouseDragged(d: Double, e: Double, i: Int, f: Double, g: Double): Boolean {
|
||||
if (i == 0) {
|
||||
components.forEach {
|
||||
if (it.isWithinBounds(d, e) and !GuiDragging) {
|
||||
if (it.isWithinBounds(d, e) && !GuiDragging) {
|
||||
GuiDragging = true
|
||||
it.x = d.minus(f) + (d - (it.x + it.width))
|
||||
it.y = e.minus(g) + (e - (it.y + it.height))
|
||||
|
|
|
@ -68,7 +68,7 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
|
|||
private var wasWithinBounds: Boolean = false
|
||||
var toggled: Boolean = false; private set(value) {
|
||||
if (value) lightUp() else if (field) lightDown()
|
||||
if ((!(!field && !value))) {
|
||||
if (field xor value) {
|
||||
field = value
|
||||
execAction()
|
||||
} else field = value
|
||||
|
|
Loading…
Reference in New Issue