Skip to content

Commit

Permalink
groups menu is enabled only when the option is set in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhite510 authored and past-due committed Aug 27, 2023
1 parent 2569a42 commit 1366dd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/hci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2012,12 +2012,14 @@ void intAlliedResearchChanged()

bool intShowGroupSelectionMenu()
{
// TODO set if statement, if enabled in options
GroupsForum* groupsForum = (GroupsForum*)widgGetFromID(psWScreen, IDOBJ_GROUP);
if (!groupsForum)
if (getGroupButtonEnabled())
{
auto newGroupsForum = GroupsForum::make();
psWScreen->psForm->attach(newGroupsForum);
GroupsForum* groupsForum = (GroupsForum*)widgGetFromID(psWScreen, IDOBJ_GROUP);
if (!groupsForum)
{
auto newGroupsForum = GroupsForum::make();
psWScreen->psForm->attach(newGroupsForum);
}
}
return true;
}
Expand Down
3 changes: 1 addition & 2 deletions src/hci/objects_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@ void ObjectsForm::initialize()
{
// creating an obj stat form
id = IDOBJ_FORM;
// TODO set if statement, subtract the 80 if enabled in options
setCalcLayout(LAMBDA_CALCLAYOUT_SIMPLE({
psWidget->setGeometry(OBJ_BACKX, OBJ_BACKY - 80, OBJ_BACKWIDTH, OBJ_BACKHEIGHT);
psWidget->setGeometry(OBJ_BACKX, OBJ_BACKY - (getGroupButtonEnabled() ? 80 : 0), OBJ_BACKWIDTH, OBJ_BACKHEIGHT);
}));

addCloseButton();
Expand Down

0 comments on commit 1366dd6

Please sign in to comment.