[UI] Resolved issues caused by ImGui uplift.

- Fixed size of default font size
- Added logic to not load nullptr texture to prevent unexpected issues
- Commited out some trace viewer UI logic for now. It should be redesigned with tables in mind
This commit is contained in:
Gliniak 2025-03-19 22:51:04 +01:00
parent f61d52dc46
commit a45a9d8704
3 changed files with 40 additions and 23 deletions

View File

@ -815,10 +815,11 @@ void TraceViewer::DrawVertexFetcher(Shader* shader,
}
ImGui::BeginChild("#indices", ImVec2(0, 300));
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(10, 0));
int display_start, display_end;
ImGui::CalcListClipping(vertex_count, ImGui::GetTextLineHeight(),
&display_start, &display_end);
ImGui::Dummy(ImVec2(0, (display_start)*ImGui::GetTextLineHeight()));
int display_start = 0;
int display_end = 0;
// ImGui::CalcListClipping(vertex_count, ImGui::GetTextLineHeight(),
// &display_start, &display_end);
// ImGui::Dummy(ImVec2(0, (display_start)*ImGui::GetTextLineHeight()));
ImGui::Columns(column_count);
if (display_start <= 1) {
for (size_t el_index = 0; el_index < vertex_binding.attributes.size();
@ -1641,11 +1642,12 @@ void TraceViewer::DrawStateUI() {
ImGui::BeginChild("#vsvertices", ImVec2(0, 300));
int display_start, display_end;
ImGui::CalcListClipping(int(vertices.size() / 4),
ImGui::GetTextLineHeight(), &display_start,
&display_end);
ImGui::Dummy(ImVec2(0, (display_start)*ImGui::GetTextLineHeight()));
int display_start = 0;
int display_end = 0;
// ImGui::CalcListClipping(int(vertices.size() / 4),
// ImGui::GetTextLineHeight(), &display_start,
// &display_end);
// ImGui::Dummy(ImVec2(0, (display_start)*ImGui::GetTextLineHeight()));
ImGui::Columns(int(el_size), "#vsvertices", true);
for (size_t i = display_start; i < display_end; i++) {
@ -1706,11 +1708,12 @@ void TraceViewer::DrawStateUI() {
}
ImGui::BeginChild("#indices", ImVec2(0, 300));
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
int display_start, display_end;
ImGui::CalcListClipping(1 + draw_info.index_count,
ImGui::GetTextLineHeight(), &display_start,
&display_end);
ImGui::Dummy(ImVec2(0, (display_start)*ImGui::GetTextLineHeight()));
int display_start = 0;
int display_end = 0;
// ImGui::CalcListClipping(1 + draw_info.index_count,
// ImGui::GetTextLineHeight(), &display_start,
// &display_end);
// ImGui::Dummy(ImVec2(0, (display_start)*ImGui::GetTextLineHeight()));
ImGui::Columns(2, "#indices", true);
ImGui::SetColumnOffset(1, 60);
if (display_start <= 1) {

View File

@ -607,7 +607,14 @@ class GameAchievementsDialog final : public XamDialog {
const auto start_drawing_pos = ImGui::GetCursorPos();
ImGui::TableSetColumnIndex(0);
ImGui::Image(GetIcon(achievement_entry), default_image_icon_size);
const auto icon = GetIcon(achievement_entry);
if (icon) {
ImGui::Image(reinterpret_cast<ImTextureID>(GetIcon(achievement_entry)),
default_image_icon_size);
} else {
ImGui::Dummy(default_image_icon_size);
}
ImGui::TableNextColumn();
ImGui::PushFont(imgui_drawer()->GetTitleFont());
@ -742,8 +749,13 @@ class GamesInfoDialog final : public XamDialog {
// First Column
ImGui::TableSetColumnIndex(0);
ImGui::Image(title_icon.count(entry.id) ? title_icon.at(entry.id).get() : 0,
default_image_icon_size);
if (title_icon.count(entry.id)) {
ImGui::Image(reinterpret_cast<ImTextureID>(title_icon.at(entry.id).get()),
default_image_icon_size);
} else {
ImGui::Dummy(default_image_icon_size);
}
// Second Column
ImGui::TableNextColumn();
@ -1525,10 +1537,12 @@ bool xeDrawProfileContent(ui::ImGuiDrawer* imgui_drawer, const uint64_t xuid,
ImVec2 current_drawing_position = ImGui::GetCursorPos();
// In the future it can be replaced with profile icon.
ImGui::Image(user_index < XUserMaxUserCount
? imgui_drawer->GetNotificationIcon(user_index)
: nullptr,
ImVec2(default_image_size, default_image_size));
const auto icon = imgui_drawer->GetNotificationIcon(user_index);
if (icon && user_index < XUserMaxUserCount) {
ImGui::Image(reinterpret_cast<ImTextureID>(icon), default_image_icon_size);
} else {
ImGui::Dummy(default_image_icon_size);
}
ImGui::SameLine();
current_drawing_position = ImGui::GetCursorPos();

File diff suppressed because one or more lines are too long