user-grinch / ImGuiRedux

ImGui bindings for CLEO5 & CLEORedux
GNU General Public License v3.0
15 stars 4 forks source link

GTA:SA - DE problem with CollapsingHeader and Selectable #16

Open mateusz-korbut opened 11 months ago

mateusz-korbut commented 11 months ago

Hi,

I tried to use ImGui and the collapsing header and selectable are not working for me. I debugged and logged returning values:

18:40:25 [INFO] ["cheat-m"] wait(0)
18:40:25 [INFO] ["cheat-m"] 000000: IMGUI_BEGIN_FRAME
18:40:25 [INFO] ["cheat-m"] 000005: IMGUI_SET_CURSOR_VISIBLE
18:40:25 [INFO] ["cheat-m"] 000009: IMGUI_SET_NEXT_WINDOW_SIZE
18:40:25 [INFO] ["cheat-m"] 000019: IMGUI_BEGIN
18:40:25 [INFO] ["cheat-m"] 000084: IMGUI_COLLAPSING_HEADER
18:40:25 [INFO] ["cheat-m"] { "collapsingHeader": 7597125509927150000 }
18:40:25 [INFO] ["cheat-m"] 000008: IMGUI_SELECTABLE
18:40:25 [INFO] ["cheat-m"] 000012: IMGUI_SELECTABLE
18:40:25 [INFO] ["cheat-m"] { "selectable1": 7311146993788545000, "selectable2": 7311146993788545000 }
18:40:25 [INFO] ["cheat-m"] 000012: IMGUI_END
18:40:25 [INFO] ["cheat-m"] 000000: IMGUI_END_FRAME
18:40:25 [INFO] ["cheat-m"] wait(0)

So I can click the collapsing header and it's not closing anything at all because it always returns some weird numbers.

I've installed CLEO Redux 1.2.2:

Setup type:
      Full

Selected components:
      CLEO Redux
         API files (unselect if you prefer to download the latest API files during the first game run)
      Extensions
         IniFiles 1.2
         Dylib 2.0
         ImGuiRedux (by Grinch_)
         MemoryOperations (by ThirteenAG)
         Input 1.3
         Events 1.1
      File Loaders
         *.txt, *.text (Text files)
         *.ide (Item Definition files)
      Ultimate ASI Loader (by ThirteenAG)

Test script:

/// <reference path='../.config/sa.d.ts' />
import { ImGuiCond } from '../.config/enums';

CLEO.debug.trace(true);

while (true) {
    wait(0);

    ImGui.BeginFrame('gui');
    ImGui.SetCursorVisible(true);

    ImGui.SetNextWindowSize(500, 500, ImGuiCond.FirstUseEver);
    ImGui.Begin('GTA: SA - Definitive Edition', true, false, false, false, false);

    const collapsingHeader = ImGui.CollapsingHeader('Test 1');
    log({ collapsingHeader });

    if (collapsingHeader) {
        const selectable1 = ImGui.Selectable('1', false);
        const selectable2 = ImGui.Selectable('2', false);

        log( { selectable1, selectable2 });
    }

    ImGui.End();
    ImGui.EndFrame();
}
user-grinch commented 11 months ago

What's the version of your sa.json file?

mateusz-korbut commented 11 months ago

0.263 from CLEO-Redux 1.2.2 same as in the docs

"meta": {
    "last_update": 1691888251192,
    "version": "0.263",
    "url": "https://library.sannybuilder.com/#/sa_unreal"
  },

unknown_x64.json where IMGUI is, is also the latest version 0.228

user-grinch commented 11 months ago

0.263 from CLEO-Redux 1.2.2 same as in the docs

"meta": {
    "last_update": 1691888251192,
    "version": "0.263",
    "url": "https://library.sannybuilder.com/#/sa_unreal"
  },

unknown_x64.json where IMGUI is, is also the latest version 0.228

Update the unknown_x64.json and try.

mateusz-korbut commented 11 months ago

So the CLEO installation is outdated but still after downloading the newest unknown_x64:

"meta": {
    "last_update": 1700767206171,
    "version": "0.230",
    "url": "https://library.sannybuilder.com/#/unknown_x64"
  },

the problem still occurs.

mateusz-korbut commented 10 months ago

@user-grinch I see the breaking changes maybe there is a problem in wUpdateCompareFlag method?

user-grinch commented 10 months ago

@user-grinch I see the breaking changes maybe there is a problem in wUpdateCompareFlag method?

The breaking changes are with the CLEORedux json files. I've already updated the JSON file. If you've updated the redux files, there shouldn't be any changes required from the script side.