refactor: break classes and enums into separate files

This commit is contained in:
Anna Clemens 2021-04-06 18:44:26 -04:00
parent eaf6dec8e4
commit 65869a9575
No known key found for this signature in database
GPG key ID: 0B391D8F06FCD9E0
6 changed files with 85 additions and 73 deletions

View 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);
}
}
}

View file

@ -0,0 +1,9 @@
namespace Dalamud.Game.Internal.Gui.Toast
{
public enum QuestToastPosition
{
Centre = 0,
Right = 1,
Left = 2,
}
}

View 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;
}
}

View file

@ -0,0 +1,8 @@
namespace Dalamud.Game.Internal.Gui.Toast
{
public enum ToastPosition : byte
{
Bottom = 0,
Top = 1,
}
}

View 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,
}
}

View file

@ -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,
}
}