Skip to content

Commit cc9afd9

Browse files
committed
update imgui with docking support, fix some crashy windows
1 parent d3d8065 commit cc9afd9

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

code/components/conhost-v2/src/ConsoleHostImpl.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ static InitFunction initFunction([] ()
195195
io.KeyMap[ImGuiKey_Y] = 'Y';
196196
io.KeyMap[ImGuiKey_Z] = 'Z';
197197

198+
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
199+
io.ConfigDockingWithShift = true;
200+
io.ConfigWindowsResizeFromEdges = true;
201+
202+
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors;
198203

199204
static std::string imguiIni = ToNarrow(MakeRelativeCitPath(L"citizen/imgui.ini"));
200205
io.IniFilename = const_cast<char*>(imguiIni.c_str());

code/components/debug-net/src/imguivariouscontrols.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,7 @@ bool InputComboWithAutoCompletion(const char* label, int *current_item, size_t a
24712471
ImGui::SameLine();
24722472
//ImGui::Text("%s",label); // This doesn't cut "##". We must add all this cucumberson and error-prone code to workaround this (for correct alignment and isHovered detection):
24732473
const ImVec2 label_size = CalcTextSize(label, NULL, true);
2474-
if (label_size.x>0) ImGui::RenderText(ImVec2(window->DC.CursorPos.x,window->DC.CursorPos.y+window->DC.CurrentLineTextBaseOffset),label);
2474+
if (label_size.x>0) ImGui::RenderText(ImVec2(window->DC.CursorPos.x,window->DC.CursorPos.y+window->DC.CurrLineTextBaseOffset),label);
24752475
const ImRect label_bb(window->DC.CursorPos,ImVec2(window->DC.CursorPos.x + label_size.x, window->DC.CursorPos.y + label_size.y + ImGui::GetStyle().FramePadding.y*2.0f));
24762476
ImGui::ItemSize(label_bb, ImGui::GetStyle().FramePadding.y);
24772477
const ImGuiID labelID = 0; // is this allowed ?

code/components/devtools-five/src/StreamingDebug.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ static InitFunction initFunction([]()
232232
if (ImGui::Begin("Streaming Memory", &streamingMemoryOpen))
233233
{
234234
static std::vector<StreamingMemoryInfo> entryList(streaming->numEntries);
235+
entryList.resize(streaming->numEntries);
235236

236237
int entryIdx = 0;
237238
size_t lockedMem = 0;
@@ -250,7 +251,12 @@ static InitFunction initFunction([]()
250251
info.virtualMemory = entry.ComputeVirtualSize(i, nullptr, false);
251252
info.physicalMemory = entry.ComputePhysicalSize(i);
252253

253-
entryList[entryIdx] = info;
254+
if (entryIdx < entryList.size())
255+
{
256+
entryList[entryIdx] = info;
257+
258+
entryIdx++;
259+
}
254260

255261
if (!streaming->IsObjectReadyToDelete(i, 0xF1 | 8))
256262
{
@@ -274,8 +280,6 @@ static InitFunction initFunction([]()
274280

275281
usedMem += info.virtualMemory;
276282
usedPhys += info.physicalMemory;
277-
278-
entryIdx++;
279283
}
280284
}
281285

code/components/gta-net-five/src/CloneDebug.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ static InitFunction initFunction([]()
743743

744744
ImGui::SetNextWindowSizeConstraints(ImVec2(1020.0f, 400.0f), ImVec2(1020.0f, 2000.0f));
745745

746-
if (ImGui::Begin("Network Object Viewer", &novOpen))
746+
if (ImGui::Begin("Network Object Viewer", &novOpen) && rage::netObjectMgr::GetInstance())
747747
{
748748
static float treeSize = 400.f;
749749
static float detailSize = 600.f;

vendor/imgui

Submodule imgui updated 59 files

0 commit comments

Comments
 (0)