Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 13 additions & 35 deletions NGMCToolGUI/Previewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace NGMC
{
if (m_File != nullptr)
{
ImGui::Text("GENERAL");
ImGui::TextUnformatted("GENERAL");

FileType type = m_File->GetType();

Expand All @@ -63,42 +63,20 @@ namespace NGMC

if (ImGui::BeginTable("tablePreviewerGeneral", 2, Preview::tableFlags))
{
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Name");
ImGui::TableSetColumnIndex(1); ImGui::Text(m_File->GetName());

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Type");
ImGui::TableSetColumnIndex(1); ImGui::Text("%s > %s", gameName.c_str(), typeName.c_str());

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Is file in memory");
ImGui::TableSetColumnIndex(1); ImGui::Text(m_File->IsFileInMemory() ? "true" : "false");
ROW_CSTRING("Name", m_File->GetName());
ROW_PRINTF("Type", "%s > %s", gameName.c_str(), typeName.c_str());
ROW_CSTRING("Is file in memory", m_File->IsFileInMemory() ? "true" : "false");

if (!m_File->IsFileInMemory())
{
std::wstring filePath = m_File->GetFilePath();

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Path");
ImGui::TableSetColumnIndex(1); ImGui::Text(std::string(filePath.begin(), filePath.end()).c_str());
ROW_STRING("Path", std::string(filePath.begin(), filePath.end()));
}

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Is file loaded");
ImGui::TableSetColumnIndex(1); ImGui::Text(m_File->IsLoaded() ? "true" : "false");

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Size");
ImGui::TableSetColumnIndex(1); ImGui::Text(GetPrettySize(m_File->GetSize()).c_str());

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Index in Parent");
ImGui::TableSetColumnIndex(1); ImGui::Text(std::format("{}", m_File->GetIndexInParent()).c_str());

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Child count");
ImGui::TableSetColumnIndex(1); ImGui::Text(std::format("{}", m_File->GetChildCount()).c_str());
ROW_CSTRING("Is file loaded", m_File->IsLoaded() ? "true" : "false");
ROW_SIZE("Size", m_File->GetSize());
ROW_VALUE("Index in Parent", m_File->GetIndexInParent());
ROW_VALUE("Child count", m_File->GetChildCount());

ImGui::EndTable();
}
Expand All @@ -120,14 +98,14 @@ namespace NGMC
else
{
if (type.IsUnknown())
ImGui::Text("Format unknown. Right-click the file and set a type manually.");
ImGui::TextUnformatted("Format unknown. Right-click the file and set a type manually.");
else
ImGui::Text("This format is not yet supported for previewing.");
ImGui::TextUnformatted("This format is not yet supported for previewing.");
}
}
else
{
ImGui::Text("Select an element in the content viewer to see a preview of its data here.");
ImGui::TextUnformatted("Select an element in the content viewer to see a preview of its data here.");
}
}

Expand Down Expand Up @@ -238,4 +216,4 @@ namespace NGMC

return m_IsSetup;
}
}
}
14 changes: 7 additions & 7 deletions NGMCToolGUI/UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ namespace NGMC
{
ImGui::Separator();

ImGui::Text("GT1G:");
ImGui::TextUnformatted("GT1G:");
if (ImGui::MenuItem("Render Color Map as raw data (color index)", NULL, &g_ReadColorMapAsLuminance))
{
previewer.Prepare();
Expand Down Expand Up @@ -541,8 +541,8 @@ namespace NGMC
}

ImGui::Separator();
ImGui::Text((std::string("Type: ") + type.GetTypeName() + std::format(" (0x{:02X})", (char)type.GetId())).c_str());
ImGui::Text((std::string("Size: ") + GetPrettySize(p_File->GetSize())).c_str());
ImGui::TextUnformatted((std::string("Type: ") + type.GetTypeName() + std::format(" (0x{:02X})", (char)type.GetId())).c_str());
ImGui::TextUnformatted((std::string("Size: ") + GetPrettySize(p_File->GetSize())).c_str());
ImGui::Separator();
}
else if (selectionCount > 1)
Expand All @@ -561,14 +561,14 @@ namespace NGMC
}

ImGui::Separator();
ImGui::Text(std::format("{} items selected", fileManager.GetSelectionCount()).c_str());
ImGui::TextUnformatted(std::format("{} items selected", fileManager.GetSelectionCount()).c_str());

uintmax_t size = 0ULL;
for (unsigned int i = 0; i < selectionCount; i++)
{
size += fileManager.GetSelectedFile(i)->GetSize();
}
ImGui::Text((std::string("Size: ") + GetPrettySize(size)).c_str());
ImGui::TextUnformatted((std::string("Size: ") + GetPrettySize(size)).c_str());
ImGui::Separator();
}

Expand Down Expand Up @@ -858,7 +858,7 @@ namespace NGMC
//ImGui::Separator();
//ImGui::Dummy(ImVec2(0.0f, 2.0f));
//
//ImGui::Text(std::format("Popup count: {}", popups.size()).c_str());
//ImGui::TextUnformatted(std::format("Popup count: {}", popups.size()).c_str());

ImGui::End();
}
Expand Down Expand Up @@ -969,4 +969,4 @@ namespace NGMC

HandlePopups();
}
}
}
32 changes: 6 additions & 26 deletions NGMCToolGUI/popups/PopupAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ namespace NGMC
{
ImGui::Dummy({ 0.0f, 0.0f });
ImGui::SetCursorPosX((ImGui::CalcTextSize(longDesc).x - ImGui::CalcTextSize(appTitle).x) / 2);
ImGui::Text(appTitle);
ImGui::TextUnformatted(appTitle);
ImGui::Dummy({ 0.0f, 0.0f });
ImGui::Text(longDesc);
ImGui::TextUnformatted(longDesc);
ImGui::Dummy({ 0.0f, 0.0f });

ImGui::Separator();
Expand All @@ -38,29 +38,9 @@ namespace NGMC

if (ImGui::BeginTable("tableAbout", 2))
{
ImGui::TableNextRow();

ImGui::TableSetColumnIndex(0);
ImGui::Text("Version");

ImGui::TableSetColumnIndex(1);
ImGui::Text(std::format("{:X}.{:X}.{:X}", (g_ApplicationVersion >> 16) & 0xFF, (g_ApplicationVersion >> 8) & 0xFF, g_ApplicationVersion & 0xFF).c_str());

ImGui::TableNextRow();

ImGui::TableSetColumnIndex(0);
ImGui::Text("Author");

ImGui::TableSetColumnIndex(1);
ImGui::Text("Mystixor");

ImGui::TableNextRow();

ImGui::TableSetColumnIndex(0);
ImGui::Text("Contributors");

ImGui::TableSetColumnIndex(1);
ImGui::Text("");
ROW_FORMAT("Version", "{:X}.{:X}.{:X}", (g_ApplicationVersion >> 16) & 0xFF, (g_ApplicationVersion >> 8) & 0xFF, g_ApplicationVersion & 0xFF);
ROW_CSTRING("Author", "Mystixor");
ROW_CSTRING("Contributors", "");

ImGui::EndTable();
}
Expand All @@ -80,4 +60,4 @@ namespace NGMC
ImGui::EndTable();
}
}
}
}
26 changes: 13 additions & 13 deletions NGMCToolGUI/popups/PopupBuildGT1G.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace NGMC
if (ImGui::BeginChild("childWindowPopupBuildGT1GTextureList", { 0.0f, -footer_height_to_reserve }, ImGuiChildFlags_Border, ImGuiWindowFlags_AlwaysVerticalScrollbar))
{
if (m_TextureCount == 0)
ImGui::Text("Increase count above to edit textures here.");
ImGui::TextUnformatted("Increase count above to edit textures here.");

for (unsigned int i = 0; i < m_TextureCount; i++)
{
Expand Down Expand Up @@ -123,7 +123,7 @@ namespace NGMC
}

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("File input:");
ImGui::TableSetColumnIndex(0); ImGui::TextUnformatted("File input:");

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
Expand All @@ -136,19 +136,19 @@ namespace NGMC
ImGui::TableSetColumnIndex(0);
if (m_TextureFilePathDisplays[i].length() == 0)
{
ImGui::Text("No file selected");
ImGui::TextUnformatted("No file selected");
}
else
{
ImGui::Text(m_TextureFilePathDisplays[i].c_str());
ImGui::TextUnformatted(m_TextureFilePathDisplays[i].c_str());
}

ImGui::EndTable();
}

if (ImGui::BeginItemTooltip())
{
ImGui::Text("Text field does not support UTF-16, but if you pick a file using the Browse button it will work correctly nonetheless");
ImGui::TextUnformatted("Text field does not support UTF-16, but if you pick a file using the Browse button it will work correctly nonetheless");
ImGui::EndTooltip();
}

Expand Down Expand Up @@ -208,11 +208,11 @@ namespace NGMC
ImGui::TableSetColumnIndex(0);
if (m_TextureFilePointers[i] == nullptr)
{
ImGui::Text("No file selected");
ImGui::TextUnformatted("No file selected");
}
else
{
ImGui::Text(m_TextureFilePointers[i]->GetName());
ImGui::TextUnformatted(m_TextureFilePointers[i]->GetName());
}
ImGui::EndTable();
}
Expand All @@ -230,7 +230,7 @@ namespace NGMC


ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Width:");
ImGui::TableSetColumnIndex(0); ImGui::TextUnformatted("Width:");

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
Expand All @@ -248,7 +248,7 @@ namespace NGMC


ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Height:");
ImGui::TableSetColumnIndex(0); ImGui::TextUnformatted("Height:");

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
Expand All @@ -266,7 +266,7 @@ namespace NGMC


ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("MipMap Count:");
ImGui::TableSetColumnIndex(0); ImGui::TextUnformatted("MipMap Count:");

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
Expand All @@ -280,7 +280,7 @@ namespace NGMC


ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::Text("Format:");
ImGui::TableSetColumnIndex(0); ImGui::TextUnformatted("Format:");

ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);
Expand Down Expand Up @@ -316,7 +316,7 @@ namespace NGMC
ImGui::Dummy(ImVec2(0.0f, spacing));

ImGui::PushItemWidth(ImGui::GetWindowSize().x - 97.0f);
ImGui::Text("File name:");
ImGui::TextUnformatted("File name:");
if (ImGui::InputText("##inputFileName", (char*)m_OutputName.c_str(), 256))
{
m_OutputName = m_OutputName.c_str();
Expand Down Expand Up @@ -475,4 +475,4 @@ namespace NGMC
m_Formats.erase(m_Formats.begin() + m_TextureCount, m_Formats.end());
m_FormatIDs.erase(m_FormatIDs.begin() + m_TextureCount, m_FormatIDs.end());
}
}
}
4 changes: 2 additions & 2 deletions NGMCToolGUI/popups/PopupFilePicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ namespace NGMC
else
{
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetStyle().FramePadding.y);
ImGui::Text(std::format("Select a file of type \"{}\"", m_AcceptType.GetTypeName()).c_str());
ImGui::TextUnformatted(std::format("Select a file of type \"{}\"", m_AcceptType.GetTypeName()).c_str());
}

ImGui::TableSetColumnIndex(2);
Expand All @@ -174,4 +174,4 @@ namespace NGMC
ImGui::EndTable();
}
}
}
}
4 changes: 2 additions & 2 deletions NGMCToolGUI/popups/PopupRenameFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace NGMC

void PopupRenameFile::OnRenderContent()
{
ImGui::Text("File name:");
ImGui::TextUnformatted("File name:");

ImGui::PushItemWidth(ImGui::GetWindowSize().x - 2 * ImGui::GetStyle().WindowPadding.x);
if (ImGui::InputText("##newName", (char*)m_NewName.c_str(), 128))
Expand Down Expand Up @@ -68,4 +68,4 @@ namespace NGMC
ImGui::EndTable();
}
}
}
}
6 changes: 3 additions & 3 deletions NGMCToolGUI/popups/PopupSelectGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ namespace NGMC

void PopupSelectGame::OnRenderContent()
{
ImGui::Text("Please select the Game which this file belongs to:");
ImGui::TextUnformatted("Please select the Game which this file belongs to:");

if (ImGui::BeginTable("tableFileInputForBorders", 1, ImGuiTableFlags_BordersOuter))
{
ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0);

ImGui::Text((std::string("\"") + GetFile()->GetName() + "\"").c_str());
ImGui::TextUnformatted((std::string("\"") + GetFile()->GetName() + "\"").c_str());

ImGui::EndTable();
}
Expand Down Expand Up @@ -105,4 +105,4 @@ namespace NGMC
ImGui::EndTable();
}
}
}
}
Loading