mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-02 22:14:35 +01:00
refactor: break classes and enums into separate files
This commit is contained in:
parent
eaf6dec8e4
commit
65869a9575
6 changed files with 85 additions and 73 deletions
36
Dalamud/Game/Internal/Gui/Toast/QuestToastOptions.cs
Executable file
36
Dalamud/Game/Internal/Gui/Toast/QuestToastOptions.cs
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
namespace Dalamud.Game.Internal.Gui.Toast
|
||||
{
|
||||
public sealed class QuestToastOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the toast on the screen.
|
||||
/// </summary>
|
||||
public QuestToastPosition Position { get; set; } = QuestToastPosition.Centre;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ID of the icon that will appear in the toast.
|
||||
///
|
||||
/// This may be 0 for no icon.
|
||||
/// </summary>
|
||||
public uint IconId { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the toast will show a checkmark after appearing.
|
||||
/// </summary>
|
||||
public bool DisplayCheckmark { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the toast will play a completion sound.
|
||||
///
|
||||
/// This only works if <see cref="IconId"/> is non-zero or <see cref="DisplayCheckmark"/> is true.
|
||||
/// </summary>
|
||||
public bool PlaySound { get; set; } = false;
|
||||
|
||||
internal (uint, uint) DetermineParameterOrder()
|
||||
{
|
||||
return this.DisplayCheckmark
|
||||
? (ToastGui.QuestToastCheckmarkMagic, this.IconId)
|
||||
: (this.IconId, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
9
Dalamud/Game/Internal/Gui/Toast/QuestToastPosition.cs
Executable file
9
Dalamud/Game/Internal/Gui/Toast/QuestToastPosition.cs
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
namespace Dalamud.Game.Internal.Gui.Toast
|
||||
{
|
||||
public enum QuestToastPosition
|
||||
{
|
||||
Centre = 0,
|
||||
Right = 1,
|
||||
Left = 2,
|
||||
}
|
||||
}
|
||||
15
Dalamud/Game/Internal/Gui/Toast/ToastOptions.cs
Executable file
15
Dalamud/Game/Internal/Gui/Toast/ToastOptions.cs
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
namespace Dalamud.Game.Internal.Gui.Toast
|
||||
{
|
||||
public sealed class ToastOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the toast on the screen.
|
||||
/// </summary>
|
||||
public ToastPosition Position { get; set; } = ToastPosition.Bottom;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the speed of the toast.
|
||||
/// </summary>
|
||||
public ToastSpeed Speed { get; set; } = ToastSpeed.Slow;
|
||||
}
|
||||
}
|
||||
8
Dalamud/Game/Internal/Gui/Toast/ToastPosition.cs
Executable file
8
Dalamud/Game/Internal/Gui/Toast/ToastPosition.cs
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
namespace Dalamud.Game.Internal.Gui.Toast
|
||||
{
|
||||
public enum ToastPosition : byte
|
||||
{
|
||||
Bottom = 0,
|
||||
Top = 1,
|
||||
}
|
||||
}
|
||||
15
Dalamud/Game/Internal/Gui/Toast/ToastSpeed.cs
Executable file
15
Dalamud/Game/Internal/Gui/Toast/ToastSpeed.cs
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
namespace Dalamud.Game.Internal.Gui.Toast
|
||||
{
|
||||
public enum ToastSpeed : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// The toast will take longer to disappear (around four seconds).
|
||||
/// </summary>
|
||||
Slow = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The toast will disappear more quickly (around two seconds).
|
||||
/// </summary>
|
||||
Fast = 1,
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
using Dalamud.Game.Internal.Gui.Toast;
|
||||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using Dalamud.Hooking;
|
||||
|
||||
|
|
@ -394,77 +396,4 @@ namespace Dalamud.Game.Internal.Gui
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ToastOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the toast on the screen.
|
||||
/// </summary>
|
||||
public ToastPosition Position { get; set; } = ToastPosition.Bottom;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the speed of the toast.
|
||||
/// </summary>
|
||||
public ToastSpeed Speed { get; set; } = ToastSpeed.Slow;
|
||||
}
|
||||
|
||||
public enum ToastPosition : byte
|
||||
{
|
||||
Bottom = 0,
|
||||
Top = 1,
|
||||
}
|
||||
|
||||
public enum ToastSpeed : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// The toast will take longer to disappear (around four seconds).
|
||||
/// </summary>
|
||||
Slow = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The toast will disappear more quickly (around two seconds).
|
||||
/// </summary>
|
||||
Fast = 1,
|
||||
}
|
||||
|
||||
public sealed class QuestToastOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the toast on the screen.
|
||||
/// </summary>
|
||||
public QuestToastPosition Position { get; set; } = QuestToastPosition.Centre;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ID of the icon that will appear in the toast.
|
||||
///
|
||||
/// This may be 0 for no icon.
|
||||
/// </summary>
|
||||
public uint IconId { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the toast will show a checkmark after appearing.
|
||||
/// </summary>
|
||||
public bool DisplayCheckmark { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the toast will play a completion sound.
|
||||
///
|
||||
/// This only works if <see cref="IconId"/> is non-zero or <see cref="DisplayCheckmark"/> is true.
|
||||
/// </summary>
|
||||
public bool PlaySound { get; set; } = false;
|
||||
|
||||
internal (uint, uint) DetermineParameterOrder()
|
||||
{
|
||||
return this.DisplayCheckmark
|
||||
? (ToastGui.QuestToastCheckmarkMagic, this.IconId)
|
||||
: (this.IconId, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public enum QuestToastPosition
|
||||
{
|
||||
Centre = 0,
|
||||
Right = 1,
|
||||
Left = 2,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue