mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Merge pull request #767 from Ottermandias/WindowExtensions
This commit is contained in:
commit
bbeb188711
2 changed files with 28 additions and 2 deletions
|
|
@ -10,8 +10,8 @@ namespace Dalamud
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts a Dalamud ClientLanguage to the corresponding Lumina variant.
|
/// Converts a Dalamud ClientLanguage to the corresponding Lumina variant.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="language">Langauge to convert.</param>
|
/// <param name="language">Language to convert.</param>
|
||||||
/// <returns>Converted langauge.</returns>
|
/// <returns>Converted language.</returns>
|
||||||
public static Lumina.Data.Language ToLumina(this ClientLanguage language)
|
public static Lumina.Data.Language ToLumina(this ClientLanguage language)
|
||||||
{
|
{
|
||||||
return language switch
|
return language switch
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,28 @@ namespace Dalamud.Interface.Windowing
|
||||||
this.IsOpen ^= true;
|
this.IsOpen ^= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Code to always be executed before the open-state of the window is checked.
|
||||||
|
/// </summary>
|
||||||
|
public virtual void PreOpenCheck()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Additional conditions for the window to be drawn, regardless of its open-state.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// True if the window should be drawn, false otherwise.
|
||||||
|
/// </returns>
|
||||||
|
/// <remarks>
|
||||||
|
/// Not being drawn due to failing this condition will not change focus or trigger OnClose.
|
||||||
|
/// This is checked before PreDraw, but after Update.
|
||||||
|
/// </remarks>
|
||||||
|
public virtual bool DrawConditions()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Code to be executed before conditionals are applied and the window is drawn.
|
/// Code to be executed before conditionals are applied and the window is drawn.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -170,6 +192,8 @@ namespace Dalamud.Interface.Windowing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal void DrawInternal()
|
internal void DrawInternal()
|
||||||
{
|
{
|
||||||
|
this.PreOpenCheck();
|
||||||
|
|
||||||
if (!this.IsOpen)
|
if (!this.IsOpen)
|
||||||
{
|
{
|
||||||
if (this.internalIsOpen != this.internalLastIsOpen)
|
if (this.internalIsOpen != this.internalLastIsOpen)
|
||||||
|
|
@ -184,6 +208,8 @@ namespace Dalamud.Interface.Windowing
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Update();
|
this.Update();
|
||||||
|
if (!this.DrawConditions())
|
||||||
|
return;
|
||||||
|
|
||||||
var hasNamespace = !string.IsNullOrEmpty(this.Namespace);
|
var hasNamespace = !string.IsNullOrEmpty(this.Namespace);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue