Установка курсора и BorderSize в инпуте mimgui

sdfy

Известный
Автор темы
349
230
Версия MoonLoader
.026-beta
Существует ли в mimgui функция устанавливающая позицию курсора в инпуте ?

А так же почему размер бордера в чайлде и инпуте разный, несмотря на то, что стоит одно значение
Для примера поставил их вместе. Сверху чайлд, снизу инпут
1672769515429.png

Использую imgui.PushStyleVarFloat(imgui.StyleVar.ChildBorderSize, 1) и imgui.PushStyleVarFloat(imgui.StyleVar.FrameBorderSize, 1)
 
Решение
мейби ответ где-то тут

p.s. адресс GetInputTextState() в cimguidx9 сейчас поищу

p.p.s GetInputTextState() inline функция

дальше вертись сам. Если что, структура неполная, сам ищи определение ImStb::STB_TexteditState
Lua:
local ImGui = require 'mimgui'
local ffi = require 'ffi'

ffi.cdef[[
  struct ImGuiInputTextState {
    void*           Ctx;                    // parent dear imgui context
    unsigned int                 ID;                     // widget id owning the text state
    int...

RedHolms

Известный
Проверенный
617
360
мейби ответ где-то тут

p.s. адресс GetInputTextState() в cimguidx9 сейчас поищу

p.p.s GetInputTextState() inline функция

дальше вертись сам. Если что, структура неполная, сам ищи определение ImStb::STB_TexteditState
Lua:
local ImGui = require 'mimgui'
local ffi = require 'ffi'

ffi.cdef[[
  struct ImGuiInputTextState {
    void*           Ctx;                    // parent dear imgui context
    unsigned int                 ID;                     // widget id owning the text state
    int                     CurLenW, CurLenA;       // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 length is valid even if TextA is not.
    ImVector<ImWchar>       TextW;                  // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
    ImVector<char>          TextA;                  // temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity.
    ImVector<char>          InitialTextA;           // backup of end-user buffer at the time of focus (in UTF-8, unaltered)
    bool                    TextAIsValid;           // temporary UTF8 buffer is not initially valid before we make the widget active (until then we pull the data from user argument)
    int                     BufCapacityA;           // end-user buffer capacity
    float                   ScrollX;                // horizontal scrolling/offset

    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FIXME !!!!!!!!!!!!!!!!!!!!!!!!!!!!
    //ImStb::STB_TexteditState Stb;                   // state for stb_textedit.h
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    float                   CursorAnim;             // timer for cursor blink, reset on every user action so the cursor reappears immediately
    bool                    CursorFollow;           // set when we want scrolling to follow the current cursor position (not always!)
    bool                    SelectedAllMouseLock;   // after a double-click to select all, we ignore further mouse drags to update selection
    bool                    Edited;                 // edited this frame
    int     Flags;
  };
]]

local GImGui = ffi.cast("uintptr_t", getModuleHandle("cimguidx9.dll") + 0x83718)

local InputTextState = ffi.cast("ImGuiInputTextState*", GImGui + 0x4bb8)
 
Последнее редактирование:
  • Влюблен
  • Нравится
Реакции: TastyBread123 и sdfy