Skip to content

Commit b584210

Browse files
committed
Change GUI always to draw information sets fully
Previously, the GUI allowed information set drawing to be turned off entirely, or to only be drawn for nodes at the same level. After much reflection, these options do not seem like good ideas given the standard way games are drawn. Further, we hope to improve tree layout in the near future. Therefore, we are withdrawing this feature, and all information set connections will be rendered.
1 parent c0b158c commit b584210

File tree

5 files changed

+17
-53
lines changed

5 files changed

+17
-53
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [16.5.0] - unreleased
4+
5+
### Changed
6+
- In the graphical interface, removed option to configure information set link drawing; information sets
7+
are always drawn and indicators are always drawn if an information set spans multiple levels.
8+
9+
310
## [16.4.0] - 2025-09-05
411

512
### General

src/gui/dlefglayout.cc

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,11 @@ gbtLayoutBranchesPanel::gbtLayoutBranchesPanel(wxWindow *p_parent, const gbtStyl
210210

211211
class gbtLayoutInfosetsPanel : public wxPanel {
212212
private:
213-
wxChoice *m_infosetConnect, *m_infosetJoin;
213+
wxChoice *m_infosetJoin;
214214

215215
public:
216216
gbtLayoutInfosetsPanel(wxWindow *p_parent, const gbtStyle &);
217217

218-
InfosetConnectStyle GetInfosetConnect() const
219-
{
220-
return static_cast<InfosetConnectStyle>(m_infosetConnect->GetSelection());
221-
}
222218
InfosetJoinStyle GetInfosetJoin() const
223219
{
224220
return static_cast<InfosetJoinStyle>(m_infosetJoin->GetSelection());
@@ -234,15 +230,6 @@ gbtLayoutInfosetsPanel::gbtLayoutInfosetsPanel(wxWindow *p_parent, const gbtStyl
234230

235231
auto *styleSizer = new wxFlexGridSizer(2);
236232

237-
styleSizer->Add(new wxStaticText(this, wxID_STATIC, _("Connect members of information sets")), 0,
238-
wxALL | wxALIGN_CENTER_VERTICAL, 5);
239-
wxString connectChoices[] = {_("invisibly (don't draw indicators)"),
240-
_("only when on the same level"), _("regardless of level")};
241-
m_infosetConnect =
242-
new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 3, connectChoices);
243-
m_infosetConnect->SetSelection(p_settings.GetInfosetConnect());
244-
styleSizer->Add(m_infosetConnect, 0, wxALL, 5);
245-
246233
styleSizer->Add(new wxStaticText(this, wxID_STATIC, _("Draw information set connections")), 0,
247234
wxALL | wxALIGN_CENTER_VERTICAL, 5);
248235
wxString joinChoices[] = {_("using lines"), _("using bubbles")};
@@ -309,7 +296,6 @@ void gbtLayoutDialog::GetSettings(gbtStyle &p_settings)
309296
p_settings.SetBranchLabels(branches->GetBranchLabels());
310297

311298
auto *infosets = dynamic_cast<gbtLayoutInfosetsPanel *>(m_notebook->GetPage(2));
312-
p_settings.SetInfosetConnect(infosets->GetInfosetConnect());
313299
p_settings.SetInfosetJoin(infosets->GetInfosetJoin());
314300
}
315301

src/gui/efglayout.cc

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,6 @@ void gbtTreeLayout::ComputeOffsets(const GameNode &p_node, const BehaviorSupport
598598
std::shared_ptr<gbtNodeEntry>
599599
gbtTreeLayout::ComputeNextInInfoset(const std::shared_ptr<gbtNodeEntry> &p_entry)
600600
{
601-
const auto infosetConnectStyle = m_doc->GetStyle().GetInfosetConnect();
602601
const auto infoset = p_entry->m_node->GetInfoset();
603602
if (!infoset) {
604603
// For terminal nodes, the next in information set is always the next terminal node,
@@ -616,8 +615,7 @@ gbtTreeLayout::ComputeNextInInfoset(const std::shared_ptr<gbtNodeEntry> &p_entry
616615
std::find(infoset->GetMembers().begin(), infoset->GetMembers().end(), p_entry->m_node));
617616
while (member != infoset->GetMembers().end()) {
618617
auto member_entry = GetNodeEntry(*member);
619-
if (member_entry != nullptr && (p_entry->m_level == member_entry->m_level ||
620-
infosetConnectStyle == GBT_INFOSET_CONNECT_ALL)) {
618+
if (member_entry != nullptr && p_entry->m_level == member_entry->m_level) {
621619
return member_entry;
622620
}
623621
++member;
@@ -714,12 +712,10 @@ void gbtTreeLayout::Layout(const BehaviorSupportProfile &p_support)
714712

715713
m_infosetSublevels.clear();
716714
m_numSublevels = std::vector<int>(m_maxLevel + 1);
717-
if (m_doc->GetStyle().GetInfosetConnect() != GBT_INFOSET_CONNECT_NONE) {
718-
for (auto entry : m_nodeList) {
719-
ComputeSublevel(entry);
720-
}
721-
ComputeNodeDepths();
715+
for (auto entry : m_nodeList) {
716+
ComputeSublevel(entry);
722717
}
718+
ComputeNodeDepths();
723719

724720
ComputeRenderedParents();
725721
GenerateLabels();
@@ -780,13 +776,11 @@ void gbtTreeLayout::RenderSubtree(wxDC &p_dc, bool p_noHints) const
780776
if (entry->GetChildNumber() == 1) {
781777
DrawNode(p_dc, parentEntry, m_doc->GetSelectNode(), p_noHints);
782778

783-
if (m_doc->GetStyle().GetInfosetConnect() != GBT_INFOSET_CONNECT_NONE &&
784-
parentEntry->GetNextMember()) {
779+
if (parentEntry->GetNextMember()) {
785780
const int nextX = parentEntry->GetNextMember()->m_x;
786781
const int nextY = parentEntry->GetNextMember()->m_y;
787782

788-
if ((m_doc->GetStyle().GetInfosetConnect() != GBT_INFOSET_CONNECT_SAMELEVEL) ||
789-
parentEntry->m_x == nextX) {
783+
if (parentEntry->m_x == nextX) {
790784
#ifdef __WXGTK__
791785
// A problem with using styled pens and user scaling on wxGTK
792786
p_dc.SetPen(wxPen(m_doc->GetStyle().GetPlayerColor(parentEntry->m_node->GetPlayer()), 1,

src/gui/style.cc

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ void gbtStyle::SetDefaults()
8282
m_tineLength = 20;
8383
m_branchStyle = GBT_BRANCH_STYLE_FORKTINE;
8484
m_branchLabels = GBT_BRANCH_LABEL_ORIENT_HORIZONTAL;
85-
m_infosetConnect = GBT_INFOSET_CONNECT_ALL;
8685
m_infosetJoin = GBT_INFOSET_JOIN_CIRCLES;
8786
m_nodeAboveLabel = GBT_NODE_LABEL_LABEL;
8887
m_nodeBelowLabel = GBT_NODE_LABEL_ISETID;
@@ -198,8 +197,7 @@ std::string gbtStyle::GetLayoutXML() const
198197
const std::string branchLabels[] = {"horizontal", "rotated"};
199198
s << "labels=\"" << branchLabels[m_branchLabels] << "\"/>\n";
200199

201-
const std::string infosetConnect[] = {"none", "same", "all"};
202-
s << "<infosets connect=\"" << infosetConnect[m_infosetConnect] << "\" ";
200+
s << "<infosets ";
203201
const std::string infosetStyle[] = {"lines", "circles"};
204202
s << "style=\"" << infosetStyle[m_infosetJoin] << "\"/>\n";
205203

@@ -302,24 +300,8 @@ void gbtStyle::SetLayoutXML(TiXmlNode *p_node)
302300
}
303301
}
304302

305-
TiXmlNode *infosets = p_node->FirstChild("infosets");
306-
if (infosets) {
307-
const char *connect = infosets->ToElement()->Attribute("connect");
308-
if (connect) {
309-
const std::string s = connect;
310-
if (s == "none") {
311-
m_infosetConnect = GBT_INFOSET_CONNECT_NONE;
312-
}
313-
else if (s == "same") {
314-
m_infosetConnect = GBT_INFOSET_CONNECT_SAMELEVEL;
315-
}
316-
else if (s == "all") {
317-
m_infosetConnect = GBT_INFOSET_CONNECT_ALL;
318-
}
319-
}
320-
321-
const char *style = infosets->ToElement()->Attribute("style");
322-
if (style) {
303+
if (TiXmlNode *infosets = p_node->FirstChild("infosets")) {
304+
if (const char *style = infosets->ToElement()->Attribute("style")) {
323305
const std::string s = style;
324306
if (s == "lines") {
325307
m_infosetJoin = GBT_INFOSET_JOIN_LINES;

src/gui/style.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class gbtStyle {
8484
BranchLabelOrientationStyle m_branchLabels{GBT_BRANCH_LABEL_ORIENT_HORIZONTAL};
8585

8686
// Information set styling
87-
InfosetConnectStyle m_infosetConnect{GBT_INFOSET_CONNECT_ALL};
8887
InfosetJoinStyle m_infosetJoin{GBT_INFOSET_JOIN_CIRCLES};
8988

9089
// Legend styling
@@ -146,10 +145,6 @@ class gbtStyle {
146145
BranchLabelOrientationStyle GetBranchLabels() const { return m_branchLabels; }
147146
void SetBranchLabels(BranchLabelOrientationStyle p_labels) { m_branchLabels = p_labels; }
148147

149-
// Information set styling
150-
InfosetConnectStyle GetInfosetConnect() const { return m_infosetConnect; }
151-
void SetInfosetConnect(InfosetConnectStyle p_connect) { m_infosetConnect = p_connect; }
152-
153148
InfosetJoinStyle GetInfosetJoin() const { return m_infosetJoin; }
154149
void SetInfosetJoin(InfosetJoinStyle p_join) { m_infosetJoin = p_join; }
155150

0 commit comments

Comments
 (0)