Update codebase with changes for Zelda 64: Recompiled 1.2

This commit is contained in:
Mr-Wiseguy
2025-06-03 01:14:09 -04:00
parent 6a10095c88
commit 1e19dad587
71 changed files with 4913 additions and 674 deletions
+19 -3
View File
@@ -16,17 +16,30 @@ namespace recompui {
break;
}
case EventType::Focus: {
const EventFocus &event = std::get<EventFocus>(e.variant);
if (focus_callback != nullptr) {
focus_callback(event.active);
}
break;
}
default:
break;
}
}
TextInput::TextInput(Element *parent) : Element(parent, Events(EventType::Text), "input") {
TextInput::TextInput(Element *parent, bool text_visible) : Element(parent, Events(EventType::Text, EventType::Focus), "input") {
if (!text_visible) {
set_attribute("type", "password");
}
set_min_width(60.0f);
set_max_width(400.0f);
set_border_color(Color{ 242, 242, 242, 255 });
set_border_bottom_width(1.0f);
set_padding_bottom(6.0f);
set_focusable(true);
set_nav_auto(NavDirection::Up);
set_nav_auto(NavDirection::Down);
set_tab_index_auto();
}
void TextInput::set_text(std::string_view text) {
@@ -42,4 +55,7 @@ namespace recompui {
text_changed_callbacks.emplace_back(callback);
}
};
void TextInput::set_focus_callback(std::function<void(bool)> callback) {
focus_callback = callback;
}
};