# Changes 0.2.8

- Fix Flickering problem in StaticText api
- Fix Lagacy and Container HandleScrolling InBox checks
- Add IO Flags define for future
- Implement Single Object Dragging API by IO Context
- Add TreeNodes
- Use ioMenuPadding and ItemSpace
- Add StyleEditorMenu
- Rework ContainerApi to take functions from IO and add an Update function template for Updating internal values if required
- Use new DragApi for MenuCollabse, MenuDragging, MenuResize, SliderDragging and TreeNodes Open/Close
- Add Helper Defines for Metrics Menu [INTERNAL]
- Add TimeTrace as Tree to Metrics as well as other new Data
- Add GetRawObject to StaticText for custom rendering like ui7
- Add DrawlistRegestry to correctly render Menus in their own layer ranges
This commit is contained in:
2025-03-08 13:52:11 +01:00
parent e282d0ec7e
commit 09b1937a8d
22 changed files with 536 additions and 266 deletions

View File

@@ -68,27 +68,33 @@ void DrawList::AddText(vec2 pos, const std::string& text, const UI7Color& clr,
return;
}
u32 id = Strings::FastHash(text);
auto e = static_text.find(id);
if (e == static_text.end()) {
static_text[id] = LI::StaticText::New();
e = static_text.find(id);
LI::StaticText::Ref e;
auto f = static_text.find(id);
if (static_text.find(id) == static_text.end()) {
e = LI::StaticText::New();
static_text[id] = e;
} else {
e = f->second;
}
if (!e->second->IsSetup() || e->second->Font() != ren->Font()) {
if (!e->IsSetup() || e->Font() != ren->Font()) {
int l = ren->Layer();
ren->Layer(base);
/// Probably a simple ren.get() would handle the job too
e->second->Setup(&(*ren), pos, clr, text, flags, box);
e->second->Font(ren->Font());
e->Setup(ren.get(), pos, clr, text, flags, box);
e->Font(ren->Font());
ren->Layer(l);
}
e->second->SetPos(pos);
e->second->SetColor(clr);
e->second->SetLayer(layer);
e->SetPos(pos);
e->SetColor(clr);
e->SetLayer(layer);
if (!clip_rects.empty()) {
e->second->SetScissorMode(LI::ScissorMode_Normal);
e->second->ScissorRect(clip_rects.top());
e->SetScissorMode(LI::ScissorMode_Normal);
e->ScissorRect(clip_rects.top());
}
e->second->Draw();
for (auto it : e->GetRawObject()->List()) {
this->commands.push_back(std::make_pair(
ren->CurrentScreen()->ScreenType() == Screen::Bottom, it));
}
e->GetRawObject()->ReCopy();
////// STILL LEAVING THE OLD CODE BELOW AS IT IS MAYBE NEEDED //////
////// IF STATIC TEXT SYSTEM SHOULD HAVE AN DISABLE OPTION //////