Skip to content

Commit

Permalink
Refactor show/hideInterface()
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Oct 11, 2023
1 parent 7b08363 commit 0c2b16d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
21 changes: 21 additions & 0 deletions src/hci.cpp
Expand Up @@ -3155,3 +3155,24 @@ bool intGetShouldShowRedundantDesign()
{
return includeRedundantDesigns;
}

void intShowInterface()
{
intAddReticule();
intShowPowerBar();
intShowGroupSelectionMenu();
}

void intHideInterface(bool forceHidePowerbar)
{
intRemoveReticule();
if (forceHidePowerbar)
{
forceHidePowerBar();
}
else
{
intHidePowerBar();
}
intHideGroupSelectionMenu();
}
3 changes: 3 additions & 0 deletions src/hci.h
Expand Up @@ -416,4 +416,7 @@ void intStartStructPosition(BASE_STATS *psStats);
/* Remove the object widgets from the widget screen */
void intRemoveObject();

void intShowInterface();
void intHideInterface(bool forceHidePowerbar = false);

#endif // __INCLUDED_SRC_HCI_H__
8 changes: 2 additions & 6 deletions src/wzapi.cpp
Expand Up @@ -2812,9 +2812,7 @@ wzapi::no_return_value wzapi::showReticuleWidget(WZAPI_PARAMS(int buttonId))
//--
wzapi::no_return_value wzapi::showInterface(WZAPI_NO_PARAMS)
{
intAddReticule();
intShowPowerBar();
intShowGroupSelectionMenu();
intShowInterface();
return {};
}

Expand All @@ -2824,9 +2822,7 @@ wzapi::no_return_value wzapi::showInterface(WZAPI_NO_PARAMS)
//--
wzapi::no_return_value wzapi::hideInterface(WZAPI_NO_PARAMS)
{
intRemoveReticule();
intHidePowerBar();
intHideGroupSelectionMenu();
intHideInterface();
return {};
}

Expand Down

0 comments on commit 0c2b16d

Please sign in to comment.