add info button

This commit is contained in:
Beu
2025-01-12 10:10:21 +01:00
parent e86220e95b
commit 88453791bf

View File

@@ -1,5 +1,6 @@
namespace RenderManager {
bool G_RenderInterface = Meta::IsDeveloperMode(); // render by default in dev mode
float G_ButtonsDummySize = 0.;
void RenderInterface() {
if (G_RenderInterface) {
@@ -15,12 +16,38 @@ namespace RenderManager {
PacksManager::LoadConfigs();
}
if (UI::BeginTable('configs', 5, UI::TableFlags(UI::TableFlags::Resizable | UI::TableFlags::Sortable | UI::TableFlags::NoSavedSettings))) {
UI::SameLine();
vec2 LeftAlignedButtonsCursorPos = UI::GetCursorPos();
UI::Dummy(vec2(G_ButtonsDummySize, 1.));
UI::SameLine();
vec2 RightAlignedButtonsCursorPos = UI::GetCursorPos();
if (UI::Button(Icons::Info + ' Info')) {
OpenBrowserURL('https://openplanet.dev/plugin/' + Meta::ExecutingPlugin().get_SiteID());
}
UI::SameLine();
float RightAlignedButtonsWidth = UI::GetCursorPos().x - RightAlignedButtonsCursorPos.x;
float ScrollBarSize = 0.;
if (UI::GetScrollMaxY() > 0.) {
ScrollBarSize = UI::GetStyleVarFloat(UI::StyleVar::ScrollbarSize);
}
G_ButtonsDummySize = Math::Max(0., UI::GetWindowSize().x - RightAlignedButtonsWidth - LeftAlignedButtonsCursorPos.x - UI::GetStyleVarVec2(UI::StyleVar::ItemSpacing).x - ScrollBarSize);
UI::Dummy(vec2());
if (UI::BeginTable('configs', 5, UI::TableFlags(UI::TableFlags::Resizable | UI::TableFlags::Sortable | UI::TableFlags::NoSavedSettings | UI::TableFlags::SizingStretchProp |UI::TableFlags::ScrollY ))) {
UI::TableSetupColumn("Name", UI::TableColumnFlags::DefaultSort);
UI::TableSetupColumn("Author", UI::TableColumnFlags::None);
UI::TableSetupColumn("Version", UI::TableColumnFlags::None);
UI::TableSetupColumn("Modes", UI::TableColumnFlags::NoResize);
UI::TableSetupColumn("Enable", UI::TableFlags(UI::TableColumnFlags::NoResize | UI::TableColumnFlags::WidthFixed | UI::TableColumnFlags::NoSort), 60.);
UI::TableSetupColumn("Modes", UI::TableColumnFlags::None);
UI::TableSetupColumn("Enable", UI::TableColumnFlags::NoSort, 60.);
UI::TableHeadersRow();
const array<string> ConfigIds = PacksManager::G_Configs.GetKeys();