feat(lite): add ObsidianDragonLite build mode and gate full-node features
Add --lite build flow and ObsidianDragonLite target naming, hide full-node pages/features in lite mode, enforce pool-only mining in lite, and include chat port feasibility audit documentation.
This commit is contained in:
@@ -66,6 +66,16 @@ inline const char* NavSectionLabel(const NavItem& item) {
|
||||
return item.section_tr_key ? TR(item.section_tr_key) : item.section_label;
|
||||
}
|
||||
|
||||
inline bool IsNavPageVisible(NavPage page)
|
||||
{
|
||||
#if DRAGONX_LITE_BUILD
|
||||
return page != NavPage::Console && page != NavPage::Peers && page != NavPage::Explorer;
|
||||
#else
|
||||
(void)page;
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Get the Material Design icon string for a navigation page.
|
||||
inline const char* GetNavIconMD(NavPage page)
|
||||
{
|
||||
@@ -446,12 +456,13 @@ inline bool RenderSidebar(NavPage& current, float sidebarWidth, float contentHei
|
||||
// Separate fixed parts (don't scale) from flex parts (scale when tight).
|
||||
float fixedH = stripH; // collapse strip
|
||||
for (int i = 0; i < (int)NavPage::Count_; ++i)
|
||||
if (kNavItems[i].section_label && showLabels)
|
||||
if (IsNavPageVisible(kNavItems[i].page) && kNavItems[i].section_label && showLabels)
|
||||
fixedH += olFsz + 2.0f + sectionLabelPadBot; // section label + pad below
|
||||
fixedH += bottomPadding + stripH; // exit area
|
||||
|
||||
float baseFlexH = baseNavGap;
|
||||
for (int i = 0; i < (int)NavPage::Count_; ++i) {
|
||||
if (!IsNavPageVisible(kNavItems[i].page)) continue;
|
||||
if (kNavItems[i].section_label) {
|
||||
if (showLabels) baseFlexH += baseSectionGap;
|
||||
else baseFlexH += baseSectionGap * 0.8f;
|
||||
@@ -479,6 +490,7 @@ inline bool RenderSidebar(NavPage& current, float sidebarWidth, float contentHei
|
||||
|
||||
float curY = stripH + navGap; // after collapse strip + gap
|
||||
for (int i = 0; i < (int)NavPage::Count_; ++i) {
|
||||
if (!IsNavPageVisible(kNavItems[i].page)) continue;
|
||||
if (kNavItems[i].section_label) {
|
||||
if (showLabels) {
|
||||
curY += sectionGap;
|
||||
@@ -560,6 +572,7 @@ inline bool RenderSidebar(NavPage& current, float sidebarWidth, float contentHei
|
||||
float maxSectionW = panelRight - wp.x - sbSectionLabelPadLeft;
|
||||
int si = 0;
|
||||
for (int i = 0; i < (int)NavPage::Count_; ++i) {
|
||||
if (!IsNavPageVisible(kNavItems[i].page)) continue;
|
||||
if (kNavItems[i].section_label && si < nSectionLabels) {
|
||||
float ly = panelTopY + sectionLabelY[si++];
|
||||
const char* sLabel = NavSectionLabel(kNavItems[i]);
|
||||
@@ -587,6 +600,7 @@ inline bool RenderSidebar(NavPage& current, float sidebarWidth, float contentHei
|
||||
float btnPadX = collapsed ? btnPadCollapsed : btnPadExpanded;
|
||||
for (int i = 0; i < (int)NavPage::Count_; ++i) {
|
||||
const NavItem& item = kNavItems[i];
|
||||
if (!IsNavPageVisible(item.page)) continue;
|
||||
bool selected = (current == item.page);
|
||||
float btnY = panelTopY + itemY[i];
|
||||
float btnRnd = itemH * 0.22f;
|
||||
@@ -695,10 +709,14 @@ inline bool RenderSidebar(NavPage& current, float sidebarWidth, float contentHei
|
||||
if (!ImGui::GetIO().WantTextInput && !ImGui::GetIO().KeyCtrl) {
|
||||
int idx = static_cast<int>(current);
|
||||
bool nav = false;
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_UpArrow) || ImGui::IsKeyPressed(ImGuiKey_K))
|
||||
if (idx > 0) { idx--; nav = true; }
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_DownArrow) || ImGui::IsKeyPressed(ImGuiKey_J))
|
||||
if (idx < (int)NavPage::Count_ - 1) { idx++; nav = true; }
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_UpArrow) || ImGui::IsKeyPressed(ImGuiKey_K)) {
|
||||
do { idx--; } while (idx >= 0 && !IsNavPageVisible(static_cast<NavPage>(idx)));
|
||||
if (idx >= 0) nav = true;
|
||||
}
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_DownArrow) || ImGui::IsKeyPressed(ImGuiKey_J)) {
|
||||
do { idx++; } while (idx < (int)NavPage::Count_ && !IsNavPageVisible(static_cast<NavPage>(idx)));
|
||||
if (idx < (int)NavPage::Count_) nav = true;
|
||||
}
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_LeftBracket))
|
||||
collapsed = !collapsed;
|
||||
if (nav) { current = static_cast<NavPage>(idx); changed = true; }
|
||||
|
||||
Reference in New Issue
Block a user