Some game UI basics (#25)

* start with dLyt stuff, dLytFader_c

* Some game UI basics

* More progress

* Move and format files

* Proper outlining

* Fix build

* More cleanup

* Correct inlining behavior

* Fix some symbols

* Compiler downgrade required for some funcs.

* fixup vtable

* one line that was somehow missed

---------

Co-authored-by: elijah-thomas774 <elijahthomas774@gmail.com>
This commit is contained in:
robojumper
2024-09-30 06:02:30 +02:00
committed by GitHub
parent ed4aa23119
commit 4d9806f2fc
28 changed files with 1556 additions and 272 deletions
+28
View File
@@ -0,0 +1,28 @@
#include <d/lyt/d_textbox.h>
#include <d/lyt/d_window.h>
dWindow_c::dWindow_c(const nw4r::lyt::res::Window *pBlock, const nw4r::lyt::ResBlockSet &ResBlockSet)
: nw4r::lyt::Window(pBlock, ResBlockSet) {}
void dWindow_c::UpdateSize(dTextBox_c *textBox, f32 f) {
if (textBox == nullptr) {
return;
}
u8 rem = mBasePosition % 3;
if (rem == 0) {
nw4r::math::VEC3 other = textBox->GetTranslate();
nw4r::math::VEC3 my = GetTranslate();
f = (other.x - my.x) * 2.0f;
} else if (rem == 2) {
nw4r::math::VEC3 other = textBox->GetTranslate();
nw4r::math::VEC3 my = GetTranslate();
f = (my.x - other.x) * 2.0f;
}
nw4r::lyt::Size size = GetSize();
f32 width = textBox->GetLineWidth(nullptr);
width += f;
size.width = width;
SetSize(size);
}