-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced a static check if UI can be opened
Kinda meh right now, needs refinement
- Loading branch information
Kirtle
committed
Jun 22, 2020
1 parent
6f1855c
commit 064cf47
Showing
3 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Terraria; | ||
|
||
namespace BuilderEssentials.Utilities | ||
{ | ||
public class UIUtilities | ||
{ | ||
public static bool IsUIAvailable() | ||
{ | ||
//Add specific UI mouse hoverings etc.. | ||
var player = Main.LocalPlayer; | ||
return Main.hasFocus && | ||
!Main.playerInventory && | ||
!Main.drawingPlayerChat && | ||
!Main.editSign && | ||
!Main.editChest && | ||
!Main.blockInput && | ||
!Main.gamePaused && | ||
!player.mouseInterface && | ||
!Main.mapFullscreen && | ||
!Main.HoveringOverAnNPC && | ||
!player.showItemIcon && | ||
player.talkNPC == -1 && | ||
(player.itemTime == 0 && player.itemAnimation == 0) && | ||
!player.dead && | ||
!player.CCed; | ||
} | ||
} | ||
} |