mirror of
https://github.com/zeldaret/ss
synced 2026-09-04 02:09:59 -04:00
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:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user