Index: binaries/data/mods/mod/gui/gui.rnc
===================================================================
--- binaries/data/mods/mod/gui/gui.rnc
+++ binaries/data/mods/mod/gui/gui.rnc
@@ -152,7 +152,8 @@
attribute id { text }&
attribute color { ccolor }?&
attribute heading { text }?&
- attribute width { text }?
+ attribute width { text }?&
+ attribute hidden { bool }?
)
}
\include =
Index: binaries/data/mods/mod/gui/gui.rng
===================================================================
--- binaries/data/mods/mod/gui/gui.rng
+++ binaries/data/mods/mod/gui/gui.rng
@@ -508,6 +508,11 @@
+
+
+
+
+
Index: source/gui/COList.cpp
===================================================================
--- source/gui/COList.cpp
+++ source/gui/COList.cpp
@@ -157,6 +157,11 @@
float xpos = 0;
for (COListColumn column : m_Columns)
{
+ bool hidden = false;
+ GUI::GetSetting(this, "hidden_" + column.m_Id, hidden);
+ if (hidden)
+ continue;
+
float width = column.m_Width;
// Check if it's a decimal value, and if so, assume relative positioning.
if (column.m_Width < 1 && column.m_Width > 0)
@@ -210,6 +215,7 @@
else if (child.GetNodeName() == elmt_column)
{
COListColumn column;
+ bool hidden = false;
for (XMBAttribute attr : child.GetAttributes())
{
@@ -228,6 +234,11 @@
{
column.m_Id = attr_value;
}
+ else if (attr_name == "hidden")
+ {
+ if (!GUI::ParseString(attr_value.FromUTF8(), hidden))
+ LOGERROR("GUI: Error parsing '%s' (\"%s\")", attr_name.c_str(), attr_value.c_str());
+ }
else if (attr_name == "width")
{
float width;
@@ -280,6 +291,9 @@
m_Columns.push_back(column);
AddSetting(GUIST_CGUIList, "list_" + column.m_Id);
+ AddSetting(GUIST_bool, "hidden_" + column.m_Id);
+ GUI::SetSetting(this, "hidden_" + column.m_Id, hidden);
+
SetupText();
return true;
@@ -381,6 +395,11 @@
float xpos = 0;
for (size_t col = 0; col < m_Columns.size(); ++col)
{
+ bool hidden = false;
+ GUI::GetSetting(this, "hidden_" + m_Columns[col].m_Id, hidden);
+ if (hidden)
+ continue;
+
// Check if it's a decimal value, and if so, assume relative positioning.
float width = m_Columns[col].m_Width;
if (m_Columns[col].m_Width < 1 && m_Columns[col].m_Width > 0)
@@ -441,6 +460,11 @@
xpos = 0;
for (size_t col = 0; col < objectsCount; ++col)
{
+ bool hidden = false;
+ GUI::GetSetting(this, "hidden_" + m_Columns[col].m_Id, hidden);
+ if (hidden)
+ continue;
+
// Determine text position and width
const CPos textPos = rect.TopLeft() + CPos(xpos, -scroll + m_ItemsYPositions[i]);