From 351bec473f86975fcb973d3f106f07ed078b9a64 Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Sun, 6 Oct 2019 00:35:09 +1000 Subject: [PATCH] launcher: fix and improve config group boxes --- source-code/source/plugins/Launcher/ConfigOption.h | 11 ++++++----- source-code/source/plugins/Launcher/PluginConfig.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source-code/source/plugins/Launcher/ConfigOption.h b/source-code/source/plugins/Launcher/ConfigOption.h index 6ec5782..16d4e84 100644 --- a/source-code/source/plugins/Launcher/ConfigOption.h +++ b/source-code/source/plugins/Launcher/ConfigOption.h @@ -1143,11 +1143,12 @@ Panel^ MakePanel(int width, int height, std::vector &cfg, Too { OptionMetaGroupStart* groupData = (OptionMetaGroupStart*)(cfg[i]); GroupBox^ groupbox = gcnew GroupBox(); - groupbox->Width = width - (ScaleWidth * 8); - groupbox->Height = ScaleHeight * groupData->_height; + groupbox->Width = width - (ScaleWidth * 32); + groupbox->Height = ScaleHeight * (groupData->_height); groupbox->Left = ScaleWidth * 4; groupbox->Top = ScaleHeight * curY; groupbox->Text = gcnew String(groupData->_friendlyName); + groupbox->ForeColor = Drawing::Color::White; // find the end of this group by simple iteration keeping track of indent level int level = 1; @@ -1163,9 +1164,9 @@ Panel^ MakePanel(int width, int height, std::vector &cfg, Too break; } - Panel^ groupPanel = MakePanel(groupbox->Width - (ScaleWidth * 8), groupbox->Height - (ScaleHeight * 10), std::vector(&(cfg[i + 1]), &(cfg[endidx])), tooltip, hasChanged); - groupPanel->Left = ScaleWidth * 12; - groupPanel->Top = ScaleHeight * (curY + 8); + Panel^ groupPanel = MakePanel(groupbox->Width - (ScaleWidth * 16), groupbox->Height - (ScaleHeight * 20), std::vector(&(cfg[i + 1]), &(cfg[endidx])), tooltip, hasChanged); + groupPanel->Left = ScaleWidth * 2; + groupPanel->Top = ScaleHeight * 14; groupbox->Controls->Add(groupPanel); outpanel->Controls->Add(groupbox); diff --git a/source-code/source/plugins/Launcher/PluginConfig.h b/source-code/source/plugins/Launcher/PluginConfig.h index b2d3e35..0d50ac7 100644 --- a/source-code/source/plugins/Launcher/PluginConfig.h +++ b/source-code/source/plugins/Launcher/PluginConfig.h @@ -52,7 +52,7 @@ namespace PluginConfig for (int i = 0; i < in.len; i++) { // basic check for validity - if (in.options[i].data == nullptr) + if (in.options[i].data == nullptr && in.options[i].cfgType != CONFIG_GROUP_END) break; outvec.push_back(GetConfigOption(in.options[i]));