Skip to content

Commit f31f65a

Browse files
committed
Additional Formatting to About Window
1 parent 926692b commit f31f65a

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

Source/Managers/UIManager.cpp

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,31 @@ namespace EnigmaFix {
111111
if (::Begin(LocUI.Strings.aboutEnigmaFix, p_open, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoCollapse))
112112
{
113113
float dpiScaleLogo = SettingsUI.INS.dpiScale / 100.0f * SettingsUI.INS.dpiScaleMultiplier;
114+
115+
float logoWidth = (static_cast<float>(LogoWidth) / 4) * dpiScaleLogo;
116+
float logoHeight = (static_cast<float>(LogoHeight) / 4) * dpiScaleLogo;
117+
118+
// Save the current cursor position
119+
float originalCursorPosX = ImGui::GetCursorPosX();
120+
121+
// Calculate the horizontal center position and set the cursor position
122+
float windowWidth = ImGui::GetWindowWidth();
123+
float imageXPos = (windowWidth - logoWidth) * 0.5f; // Center the image horizontally
124+
ImGui::SetCursorPosX(imageXPos);
125+
114126
ImGui::Image(reinterpret_cast<ImTextureID>(Logo), ImVec2((static_cast<float>(LogoWidth) / 4) * dpiScaleLogo, (static_cast<float>(LogoHeight) / 4) * dpiScaleLogo));
115-
Text("%s %s", LocUI.Strings.enigmaFixName, LocUI.Strings.versionNumber);
127+
128+
// Restore the cursor position after the image
129+
ImGui::SetCursorPosX(originalCursorPosX);
130+
131+
// Calculate the text width (this will give you the length of the text in pixels)
132+
float textWidth = ImGui::CalcTextSize(LocUI.Strings.enigmaFixName).x + ImGui::CalcTextSize(LocUI.Strings.versionNumber).x + 10.0f; // 10.0f for a small space between the two strings
133+
134+
// Set the cursor to the center of the window minus half the text width
135+
ImGui::SetCursorPosX((windowWidth - textWidth) * 0.5f);
136+
137+
// Render the centered text
138+
Text("%s %s %s", LocUI.Strings.enigmaFixName, LocUI.Strings.versionNumber);
116139
Separator();
117140
Text("(C) 2021 Bryce Q.");
118141
Text("%s", LocUI.Strings.enigmaFixLicense);
@@ -121,17 +144,22 @@ namespace EnigmaFix {
121144
Text("%s", LocUI.Strings.specialThanksTo);
122145
Text("%s", LocUI.Strings.specialThanksLine);
123146
Text("%s", LocUI.Strings.specialThanksLine2);
147+
Text("%s", LocUI.Strings.specialThanksLine3);
148+
ImGui::PushTextWrapPos(ImGui::GetWindowWidth() * 0.8f); // Wrap text at 80% of the window width
149+
Text("%s", LocUI.Strings.alsoSpecialThanksToLine);
150+
Text("%s", LocUI.Strings.specialThanksLine4);
124151
Separator();
125152
Text("%s", LocUI.Strings.thirdPartySoftware);
126153
Text("%s", LocUI.Strings.imguiLicense);
127154
Text("%s", LocUI.Strings.kieroHookLicense);
128155
Text("%s", LocUI.Strings.ghFearLicense);
129-
Text("%s", LocUI.Strings.thirteenAGIniLicense);
156+
Text("%s", LocUI.Strings.inippLicense);
130157
Text("%s", LocUI.Strings.thirteenAGAsiLicense);
131-
Text("%s", LocUI.Strings.minHookLicense);
132-
Text("%s", LocUI.Strings.modUtilsLicense);
158+
Text("%s", LocUI.Strings.safetyHookLicense);
159+
Text("%s", LocUI.Strings.zydisLicense);
133160
Text("%s", LocUI.Strings.fontsLicense);
134161
Text("%s", LocUI.Strings.fontAwesomeLicense);
162+
ImGui::PopTextWrapPos(); // Reset word wrap
135163
Separator();
136164
if (Button(LocUI.Strings.button_Close)) {
137165
aboutPage = false;

0 commit comments

Comments
 (0)