mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 00:13:08 +00:00
final reviews
This commit is contained in:
parent
4970e4e34f
commit
8ef10bf32a
@ -16,8 +16,6 @@ std::queue<TrophyInfo> trophy_queue;
|
|||||||
|
|
||||||
TrophyUI::TrophyUI(std::filesystem::path trophyIconPath, std::string trophyName)
|
TrophyUI::TrophyUI(std::filesystem::path trophyIconPath, std::string trophyName)
|
||||||
: trophy_icon_path(trophyIconPath), trophy_name(trophyName) {
|
: trophy_icon_path(trophyIconPath), trophy_name(trophyName) {
|
||||||
trophy_start_time = std::chrono::system_clock::now().time_since_epoch().count();
|
|
||||||
trophy_time_now = trophy_start_time;
|
|
||||||
if (std::filesystem::exists(trophy_icon_path)) {
|
if (std::filesystem::exists(trophy_icon_path)) {
|
||||||
trophy_icon = RefCountedTexture::DecodePngFile(trophy_icon_path);
|
trophy_icon = RefCountedTexture::DecodePngFile(trophy_icon_path);
|
||||||
} else {
|
} else {
|
||||||
@ -55,7 +53,8 @@ void TrophyUI::Draw() {
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
} else {
|
} else {
|
||||||
// placeholder
|
// placeholder
|
||||||
ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(1040, 60), ImVec2(1090, 110),
|
const auto pos = GetCursorScreenPos();
|
||||||
|
ImGui::GetWindowDrawList()->AddRectFilled(pos, pos + ImVec2{50.0f},
|
||||||
GetColorU32(ImVec4{0.7f}));
|
GetColorU32(ImVec4{0.7f}));
|
||||||
ImGui::Indent(60);
|
ImGui::Indent(60);
|
||||||
}
|
}
|
||||||
@ -63,8 +62,8 @@ void TrophyUI::Draw() {
|
|||||||
}
|
}
|
||||||
End();
|
End();
|
||||||
|
|
||||||
trophy_time_now += io.DeltaTime * 1000;
|
trophy_timer -= io.DeltaTime;
|
||||||
if (trophy_time_now >= trophy_start_time + 5000) {
|
if (trophy_timer <= 0) {
|
||||||
if (!trophy_queue.empty()) {
|
if (!trophy_queue.empty()) {
|
||||||
TrophyInfo next_trophy = trophy_queue.front();
|
TrophyInfo next_trophy = trophy_queue.front();
|
||||||
trophy_queue.pop();
|
trophy_queue.pop();
|
||||||
|
@ -27,8 +27,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
std::filesystem::path trophy_icon_path;
|
std::filesystem::path trophy_icon_path;
|
||||||
std::string trophy_name;
|
std::string trophy_name;
|
||||||
double trophy_start_time;
|
float trophy_timer = 5.0f;
|
||||||
double trophy_time_now;
|
|
||||||
ImGui::RefCountedTexture trophy_icon;
|
ImGui::RefCountedTexture trophy_icon;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user