diff --git a/src/main/kotlin/imgui/enums.kt b/src/main/kotlin/imgui/enums.kt index f66790875..716f4a3c1 100644 --- a/src/main/kotlin/imgui/enums.kt +++ b/src/main/kotlin/imgui/enums.kt @@ -353,9 +353,9 @@ enum class Key { Tab, LeftArrow, RightArrow, UpArrow, DownArrow, PageUp, PageDow * Read instructions in imgui.cpp for more details. */ enum class NavInput { // Gamepad Mapping - /** activate / open / toggle / tweak value // e.g. Circle (PS4), A (Xbox), B (Switch), Space (Keyboard) */ + /** activate / open / toggle / tweak value // e.g. Cross (PS4), A (Xbox), B (Switch), Space (Keyboard) */ Activate, - /** cancel / close / exit // e.g. Cross (PS4), B (Xbox), A (Switch), Escape (Keyboard) */ + /** cancel / close / exit // e.g. Circle (PS4), B (Xbox), A (Switch), Escape (Keyboard) */ Cancel, /** text input / on-screen keyboard // e.g. Triang.(PS4), Y (Xbox), X (Switch), Return (Keyboard) */ Input, diff --git a/src/main/kotlin/imgui/font.kt b/src/main/kotlin/imgui/font.kt index 99192a2d2..4b38c12b1 100644 --- a/src/main/kotlin/imgui/font.kt +++ b/src/main/kotlin/imgui/font.kt @@ -512,6 +512,7 @@ class FontAtlas { if (flags has FontAtlasFlag.NoMouseCursors) return false + assert(customRectIds[0] != -1) val r = customRects[customRectIds[0]] assert(r.id == DefaultTexData.id) val pos = DefaultTexData.cursorDatas[cursor.i][0] + Vec2(r.x, r.y) diff --git a/src/main/kotlin/imgui/imgui.kt b/src/main/kotlin/imgui/imgui.kt index 7b25fcb94..ba43e260c 100644 --- a/src/main/kotlin/imgui/imgui.kt +++ b/src/main/kotlin/imgui/imgui.kt @@ -74,8 +74,8 @@ object ImGui : imgui_internal { - val beta = 3 - val version = "1.60.0$beta WIP" + val beta = 4 + val version = "1.60.0$beta" } var ptrIndices = 0 diff --git a/src/main/kotlin/imgui/imgui/internal.kt b/src/main/kotlin/imgui/imgui/internal.kt index be07ab38d..6594fad40 100644 --- a/src/main/kotlin/imgui/imgui/internal.kt +++ b/src/main/kotlin/imgui/imgui/internal.kt @@ -1369,26 +1369,6 @@ interface imgui_internal { return pressed } - /** [Internal] - * @param flags: ButtonFlag */ - fun arrowButton(id: ID, dir: Dir, padding: Vec2, flags: Int = 0): Boolean { - val window = g.currentWindow!! - if (window.skipItems) return false - - val bb = Rect(window.dc.cursorPos, window.dc.cursorPos + g.fontSize + padding * 2f) - itemSize(bb, style.framePadding.y) - if (!itemAdd(bb, id)) return false - - val (pressed, hovered, held) = buttonBehavior(bb, id, flags) - - val col = (if (hovered && held) Col.ButtonActive else if (hovered) Col.ButtonHovered else Col.Button).u32 - renderNavHighlight(bb, id) - renderFrame(bb.min, bb.max, col, true, style.frameRounding) - renderArrow(bb.min + padding, dir, 1f) - return pressed - } - - fun sliderBehavior(frameBb: Rect, id: ID, v: FloatArray, vMin: Float, vMax: Float, power: Float, decimalPrecision: Int, flags: SliderFlags = 0) = sliderBehavior(frameBb, id, v, 0, vMin, vMax, power, decimalPrecision, flags) diff --git a/src/main/kotlin/imgui/imgui/main.kt b/src/main/kotlin/imgui/imgui/main.kt index 63416d1ba..fb882b2c3 100644 --- a/src/main/kotlin/imgui/imgui/main.kt +++ b/src/main/kotlin/imgui/imgui/main.kt @@ -148,9 +148,8 @@ interface imgui_main { newFrameUpdateMovingWindow() newFrameUpdateHoveredWindowAndCaptureFlags() - val modalWindow = frontMostModalRootWindow - g.modalWindowDarkeningRatio = when { - modalWindow == null -> 0f + g.modalWindowDarkeningRatio = when (frontMostModalRootWindow) { + null -> 0f else -> min(g.modalWindowDarkeningRatio + io.deltaTime * 6f, 1f) } g.mouseCursor = MouseCursor.Arrow