Skip to content

Commit eff972f

Browse files
committed
fix: draggable lists not closing properly
1 parent 47aed64 commit eff972f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

common/src/main/java/io/github/notenoughupdates/moulconfig/gui/editors/GuiOptionEditorDraggableList.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ public boolean mouseEvent(@NotNull MouseEvent mouseEvent, @NotNull GuiImmediateC
360360
}
361361
dropdownY += 12;
362362
}
363+
} else if (click.getMouseState()) {
364+
closeOverlay();
363365
}
364366
}
365367
return super.mouseEvent(mouseEvent, context);

modern/templates/java/io/github/notenoughupdates/moulconfig/test/TestCategoryA.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import io.github.notenoughupdates.moulconfig.ChromaColour
55
import io.github.notenoughupdates.moulconfig.annotations.*
66
import io.github.notenoughupdates.moulconfig.observer.Property
77
import org.lwjgl.glfw.GLFW
8-
import java.util.Arrays
8+
import java.util.*
99

1010
class TestCategoryA {
1111

@@ -44,6 +44,11 @@ class TestCategoryA {
4444
@ConfigEditorDropdown(values = ["0", "1", "2", "3"])
4545
var numberDropdown: Int = 0
4646

47+
@Expose
48+
@ConfigOption(name = "Drop Down", desc = "Using strings")
49+
@ConfigEditorDropdown(values = ["A", "B", "C"])
50+
var dropDownUisngStrings: String = "A"
51+
4752

4853
@ConfigOption(name = "Enum Dropdown", desc = "1, 2, 3, 4")
4954
@ConfigEditorDropdown
@@ -72,15 +77,15 @@ class TestCategoryA {
7277
)
7378
var notice: String = ""
7479

75-
@ConfigOption(name = "Text Box", desc = "Lets you put strings.\nLets you put strings.\nLets you put strings.\nLets you put strings.\nLets you put strings.\nLets you put strings.\nLets you put strings.\nLets you put strings.")
80+
@ConfigOption(name = "Text Box", desc = "Lets you put strings.")
7681
@ConfigEditorText
7782
var customText: Property<String> = Property.of("abc")
7883

7984
@ConfigOption(name = "Draggable List", desc = "§eDrag text to change the order of the list.")
8085
@ConfigEditorDraggableList(
8186
exampleText = ["abc", "dec", "blah", "surel it works really cool and great :))"]
8287
)
83-
var draggableList: List<Int> = ArrayList(mutableListOf(0))
88+
var draggableList: List<Int> = ArrayList(mutableListOf(0, 1, 2, 3))
8489

8590
@Expose
8691
@ConfigOption(name = "Enum Draggable List", desc = "Draggable list but doesnt work properly.")

0 commit comments

Comments
 (0)