rodecomp/Source/UI/Window/WindowOrdering.cpp
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

58 lines
1.4 KiB
C++

#include "UI/Window/UIWindow.h"
#include "UI/Window/WindowManagerWindows.h"
#include "UI/Window/WindowOrdering.h"
#include <algorithm>
// OFFSET: 0x00A976C0
// FUNCTION: fn_17206
void WindowOrdering::Promote(UIWindow* window) {
if (!window || (this->modal != 0 && this->modalWindow != window)) {
return;
}
if (this->windows.LookupWindow(278) || this->windows.LookupWindow(4) || this->windows.LookupWindow(199) || this->windows.LookupWindow(200)) {
return;
}
int companion = -1;
if (window->geometry.id == 12) {
companion = 234;
} else if (window->geometry.id == 82) {
companion = 250;
}
if (companion != -1) {
const auto entry = std::find_if(this->rendered.begin(), this->rendered.end(), [&](const UIWindow* value) { return value->geometry.id == companion; });
if (entry != this->rendered.end()) {
UIWindow* value = *entry;
this->rendered.erase(entry);
this->rendered.push_back(value);
}
}
const auto entry = std::find(this->rendered.begin(), this->rendered.end(), window);
if (entry != this->rendered.end()) {
this->rendered.erase(entry);
this->rendered.push_back(window);
}
}
// OFFSET: 0x00A969D0
// FUNCTION: fn_17190
void WindowOrdering::InvalidateFrames(int& latch) {
if (latch != 0) {
return;
}
latch = 1;
for (UIWindow* window : this->rendered) {
if (window->Slot03()) {
window->InvalidateChildren();
}
}
}