mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
Move trophy type to leftmost and trophy art to rightmost
This commit is contained in:
parent
d922082819
commit
ff28b97f1a
@ -72,20 +72,21 @@ void TrophyUI::Draw() {
|
|||||||
float AdjustWidth = io.DisplaySize.x / 1280;
|
float AdjustWidth = io.DisplaySize.x / 1280;
|
||||||
float AdjustHeight = io.DisplaySize.y / 720;
|
float AdjustHeight = io.DisplaySize.y / 720;
|
||||||
const ImVec2 window_size{
|
const ImVec2 window_size{
|
||||||
std::min(io.DisplaySize.x, (330 * AdjustWidth)),
|
std::min(io.DisplaySize.x, (350 * AdjustWidth)),
|
||||||
std::min(io.DisplaySize.y, (70 * AdjustHeight)),
|
std::min(io.DisplaySize.y, (70 * AdjustHeight)),
|
||||||
};
|
};
|
||||||
|
|
||||||
SetNextWindowSize(window_size);
|
SetNextWindowSize(window_size);
|
||||||
SetNextWindowCollapsed(false);
|
SetNextWindowCollapsed(false);
|
||||||
SetNextWindowPos(ImVec2(io.DisplaySize.x - (350 * AdjustWidth), (50 * AdjustHeight)));
|
SetNextWindowPos(ImVec2(io.DisplaySize.x - (370 * AdjustWidth), (50 * AdjustHeight)));
|
||||||
KeepNavHighlight();
|
KeepNavHighlight();
|
||||||
if (Begin("Trophy Window", nullptr,
|
if (Begin("Trophy Window", nullptr,
|
||||||
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings |
|
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoSavedSettings |
|
||||||
ImGuiWindowFlags_NoInputs)) {
|
ImGuiWindowFlags_NoInputs)) {
|
||||||
if (trophy_icon) {
|
if (trophy_type_icon) {
|
||||||
SetCursorPosY((window_size.y * 0.5f) - (25 * AdjustHeight));
|
SetCursorPosY((window_size.y * 0.5f) - (25 * AdjustHeight));
|
||||||
Image(trophy_icon.GetTexture().im_id, ImVec2((50 * AdjustWidth), (50 * AdjustHeight)));
|
Image(trophy_type_icon.GetTexture().im_id,
|
||||||
|
ImVec2((50 * AdjustWidth), (50 * AdjustHeight)));
|
||||||
} else {
|
} else {
|
||||||
// placeholder
|
// placeholder
|
||||||
const auto pos = GetCursorScreenPos();
|
const auto pos = GetCursorScreenPos();
|
||||||
@ -94,24 +95,26 @@ void TrophyUI::Draw() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (trophy_type_icon) {
|
|
||||||
SetCursorPosY((window_size.y * 0.5f) - (15 * AdjustHeight));
|
SetWindowFontScale((1.2 * AdjustHeight));
|
||||||
Image(trophy_type_icon.GetTexture().im_id,
|
char earned_text[] = "Trophy earned!\n%s";
|
||||||
ImVec2((30 * AdjustWidth), (30 * AdjustHeight)));
|
const float text_height =
|
||||||
|
ImGui::CalcTextSize(std::strcat(earned_text, trophy_name.c_str())).y;
|
||||||
|
SetCursorPosY((window_size.y - text_height) * 0.5f);
|
||||||
|
|
||||||
|
ImGui::PushTextWrapPos(window_size.x - (60 * AdjustWidth));
|
||||||
|
TextWrapped("Trophy earned!\n%s", trophy_name.c_str());
|
||||||
|
ImGui::SameLine(window_size.x - (60 * AdjustWidth));
|
||||||
|
|
||||||
|
if (trophy_icon) {
|
||||||
|
SetCursorPosY((window_size.y * 0.5f) - (25 * AdjustHeight));
|
||||||
|
Image(trophy_icon.GetTexture().im_id, ImVec2((50 * AdjustWidth), (50 * AdjustHeight)));
|
||||||
} else {
|
} else {
|
||||||
// placeholder
|
// placeholder
|
||||||
const auto pos = GetCursorScreenPos();
|
const auto pos = GetCursorScreenPos();
|
||||||
ImGui::GetWindowDrawList()->AddRectFilled(pos, pos + ImVec2{30.0f * AdjustHeight},
|
ImGui::GetWindowDrawList()->AddRectFilled(pos, pos + ImVec2{30.0f * AdjustHeight},
|
||||||
GetColorU32(ImVec4{0.7f}));
|
GetColorU32(ImVec4{0.7f}));
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
|
||||||
SetWindowFontScale((1.2 * AdjustHeight));
|
|
||||||
char earned_text[] = "Trophy earned!\n%s";
|
|
||||||
const float text_height =
|
|
||||||
ImGui::CalcTextSize(std::strcat(earned_text, trophy_name.c_str())).y;
|
|
||||||
SetCursorPosY((window_size.y - text_height) * 0.5f);
|
|
||||||
TextWrapped("Trophy earned!\n%s", trophy_name.c_str());
|
|
||||||
}
|
}
|
||||||
End();
|
End();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user