Skip to content

Commit 00f0cc4

Browse files
authored
Merge pull request #5027 from Goober5000/comm_menu_open
add hu.isCommMenuOpen
2 parents 2f8e10b + e3fc5f8 commit 00f0cc4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

code/scripting/api/libs/hud.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "hud/hudconfig.h"
1212
#include "hud/hudtargetbox.h"
1313
#include "hud/hudtarget.h"
14+
#include "playerman/player.h"
1415
#include "ship/ship.h"
1516

1617
extern int Training_obj_num_display_lines;
@@ -267,6 +268,11 @@ ADE_FUNC(getDirectiveLines, l_HUD, nullptr, "Returns the number of lines display
267268
return ade_set_args(L, "i", Training_obj_num_display_lines);
268269
}
269270

271+
ADE_FUNC(isCommMenuOpen, l_HUD, nullptr, "Returns whether the HUD comm menu is currently being displayed", "boolean", "Whether the comm menu is open")
272+
{
273+
return ade_set_args(L, "b", (Player->flags & PLAYER_FLAGS_MSG_MODE) != 0);
274+
}
275+
270276
ADE_VIRTVAR(toggleCockpits, l_HUD, "boolean", "Gets or sets whether the the cockpit model will be rendered.", "boolean", "true if being rendered, false otherwise")
271277
{
272278
bool choice = !disableCockpits;

0 commit comments

Comments
 (0)