mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 21:24:16 +01:00
Merge pull request #165 from karashiiro/master
Add cutscenes and gpose to UI hide conditions
This commit is contained in:
commit
144cc2d356
3 changed files with 11 additions and 5 deletions
|
|
@ -99,8 +99,8 @@ namespace Dalamud.Interface
|
|||
|
||||
ImGui.Dummy(new Vector2(10f, 10f));
|
||||
|
||||
ImGui.Checkbox(Loc.Localize("DalamudSettingToggleUiHide", "Hide plugin UI when the game UI is hidden"), ref this.doToggleUiHide);
|
||||
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingToggleUiHideHint", "Check this box to hide any open windows by plugins when toggling the game overlay."));
|
||||
ImGui.Checkbox(Loc.Localize("DalamudSettingToggleUiHide", "Hide plugin UI when the game UI is hidden and during cutscenes and gpose"), ref this.doToggleUiHide);
|
||||
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingToggleUiHideHint", "Check this box to hide any open windows by plugins when toggling the game overlay, or upon entering gpose or a cutscene."));
|
||||
|
||||
ImGui.EndTabItem();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Dalamud.Game.ClientState;
|
||||
using Dalamud.Game.Internal.Gui;
|
||||
using ImGuiNET;
|
||||
using ImGuiScene;
|
||||
|
|
@ -38,6 +39,11 @@ namespace Dalamud.Interface
|
|||
/// </summary>
|
||||
public bool DisableAutomaticUiHide { get; set; } = false;
|
||||
|
||||
private bool CutsceneOrGposeActive => this.clientState.Condition[ConditionFlag.OccupiedInCutSceneEvent] ||
|
||||
this.clientState.Condition[ConditionFlag.WatchingCutscene] ||
|
||||
this.clientState.Condition[ConditionFlag.WatchingCutscene78];
|
||||
|
||||
private readonly ClientState clientState;
|
||||
private readonly InterfaceManager interfaceManager;
|
||||
private readonly GameGui gameGui;
|
||||
private readonly DalamudConfiguration config;
|
||||
|
|
@ -56,7 +62,7 @@ namespace Dalamud.Interface
|
|||
/// </summary>
|
||||
/// <param name="interfaceManager">The interface manager to register on.</param>
|
||||
/// <param name="namespaceName">The plugin namespace.</param>
|
||||
internal UiBuilder(InterfaceManager interfaceManager, GameGui gameGui, DalamudConfiguration config, string namespaceName) {
|
||||
internal UiBuilder(InterfaceManager interfaceManager, GameGui gameGui, DalamudConfiguration config, ClientState clientState, string namespaceName) {
|
||||
this.namespaceName = namespaceName;
|
||||
|
||||
this.interfaceManager = interfaceManager;
|
||||
|
|
@ -130,7 +136,7 @@ namespace Dalamud.Interface
|
|||
|
||||
private void OnDraw() {
|
||||
|
||||
if (this.gameGui.GameUiHidden && this.config.ToggleUiHide && !DisableAutomaticUiHide)
|
||||
if ((this.gameGui.GameUiHidden || CutsceneOrGposeActive) && this.config.ToggleUiHide && !DisableAutomaticUiHide)
|
||||
return;
|
||||
|
||||
ImGui.PushID(this.namespaceName);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace Dalamud.Plugin
|
|||
this.CommandManager = dalamud.CommandManager;
|
||||
this.Framework = dalamud.Framework;
|
||||
this.ClientState = dalamud.ClientState;
|
||||
this.UiBuilder = new UiBuilder(dalamud.InterfaceManager, dalamud.Framework.Gui, dalamud.Configuration, pluginName);
|
||||
this.UiBuilder = new UiBuilder(dalamud.InterfaceManager, dalamud.Framework.Gui, dalamud.Configuration, dalamud.ClientState, pluginName);
|
||||
this.TargetModuleScanner = dalamud.SigScanner;
|
||||
this.Data = dalamud.Data;
|
||||
this.SeStringManager = dalamud.SeStringManager;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue