mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Merge branch 'master' of https://github.com/goatcorp/Dalamud
This commit is contained in:
commit
fb91331224
2 changed files with 144 additions and 7 deletions
120
Dalamud/Game/Chat/SeStringHandling/BitmapFontIcon.cs
Normal file
120
Dalamud/Game/Chat/SeStringHandling/BitmapFontIcon.cs
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
#pragma warning disable 1591
|
||||
|
||||
namespace Dalamud.Game.Chat.SeStringHandling {
|
||||
public enum BitmapFontIcon : uint {
|
||||
None,
|
||||
ControllerDPadUp,
|
||||
ControllerDPadDown,
|
||||
ControllerDPadLeft,
|
||||
ControllerDPadRight,
|
||||
ControllerDPadUpDown,
|
||||
ControllerDPadLeftRight,
|
||||
ControllerDPadAll,
|
||||
|
||||
ControllerButton0, // Xbox B / PS Circle
|
||||
ControllerButton1, // Xbox A / PS Cross
|
||||
ControllerButton2, // Xbox X / PS Square
|
||||
ControllerButton3, // Xbox Y / PS Triangle
|
||||
|
||||
ControllerShoulderLeft,
|
||||
ControllerShoulderRight,
|
||||
|
||||
ControllerTriggerLeft,
|
||||
ControllerTriggerRight,
|
||||
|
||||
ControllerAnalogLeftStickIn,
|
||||
ControllerAnalogRightStickIn,
|
||||
|
||||
ControllerStart,
|
||||
ControllerBack,
|
||||
|
||||
ControllerAnalogLeftStick,
|
||||
ControllerAnalogLeftStickUpDown,
|
||||
ControllerAnalogLeftStickLeftRight,
|
||||
|
||||
ControllerAnalogRightStick,
|
||||
ControllerAnalogRightStickUpDown,
|
||||
ControllerAnalogRightStickLeftRight,
|
||||
|
||||
LaNoscea = 51,
|
||||
BlackShroud,
|
||||
Thanalan,
|
||||
AutoTranslateBegin,
|
||||
AutoTranslateEnd,
|
||||
ElementFire,
|
||||
ElementIce,
|
||||
ElementWind,
|
||||
ElementEarth,
|
||||
ElementLightning,
|
||||
ElementWater,
|
||||
LevelSync,
|
||||
Warning,
|
||||
Ishgard,
|
||||
Aetheryte,
|
||||
Aethernet,
|
||||
|
||||
GoldStar,
|
||||
SilverStar,
|
||||
|
||||
GreenDot = 70,
|
||||
SwordUnsheathed,
|
||||
SwordSheathed,
|
||||
|
||||
Dice,
|
||||
|
||||
FlyZone,
|
||||
FlyZoneLocked,
|
||||
|
||||
NoCircle,
|
||||
|
||||
NewAdventurer,
|
||||
Mentor,
|
||||
MentorPvE,
|
||||
MentorCrafting,
|
||||
MentorPvP,
|
||||
|
||||
Tank,
|
||||
Healer,
|
||||
DPS,
|
||||
Crafter,
|
||||
Gatherer,
|
||||
AnyClass,
|
||||
|
||||
CrossWorld,
|
||||
|
||||
FateSlay,
|
||||
FateBoss,
|
||||
FateGather,
|
||||
FateDefend,
|
||||
FateEscort,
|
||||
FateSpecial1,
|
||||
|
||||
Returner,
|
||||
|
||||
FarEast,
|
||||
GyrAbania,
|
||||
|
||||
FateSpecial2,
|
||||
|
||||
PriorityWorld,
|
||||
|
||||
ElementalLevel,
|
||||
ExclamationRectangle,
|
||||
|
||||
NotoriousMonster,
|
||||
|
||||
Recording,
|
||||
Alarm,
|
||||
|
||||
ArrowUp,
|
||||
ArrowDown,
|
||||
Crystarium,
|
||||
|
||||
MentorProblem,
|
||||
|
||||
FateUnknownGold,
|
||||
|
||||
OrangeDiamond,
|
||||
FateCrafting
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Serilog;
|
||||
using System;
|
||||
|
||||
namespace Dalamud.Game.Chat.SeStringHandling.Payloads {
|
||||
|
||||
|
|
@ -12,7 +12,13 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads {
|
|||
/// <summary>
|
||||
/// Index of the icon
|
||||
/// </summary>
|
||||
public uint IconIndex { get; private set; }
|
||||
[Obsolete("Use IconPayload.Icon")]
|
||||
public uint IconIndex => (uint) Icon;
|
||||
|
||||
/// <summary>
|
||||
/// Icon the payload represents.
|
||||
/// </summary>
|
||||
public BitmapFontIcon Icon { get; set; } = BitmapFontIcon.None;
|
||||
|
||||
internal IconPayload() { }
|
||||
|
||||
|
|
@ -20,14 +26,23 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads {
|
|||
/// Create a Icon payload for the specified icon.
|
||||
/// </summary>
|
||||
/// <param name="iconIndex">Index of the icon</param>
|
||||
public IconPayload(uint iconIndex) {
|
||||
this.IconIndex = iconIndex;
|
||||
[Obsolete("IconPayload(uint) is deprecated, please use IconPayload(BitmapFontIcon).")]
|
||||
public IconPayload(uint iconIndex) : this((BitmapFontIcon) iconIndex) { }
|
||||
|
||||
/// <summary>
|
||||
/// Create a Icon payload for the specified icon.
|
||||
/// </summary>
|
||||
/// <param name="icon">The Icon</param>
|
||||
public IconPayload(BitmapFontIcon icon) {
|
||||
Icon = icon;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override PayloadType Type => PayloadType.Icon;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override byte[] EncodeImpl() {
|
||||
var indexBytes = MakeInteger(this.IconIndex);
|
||||
var indexBytes = MakeInteger((uint) this.Icon);
|
||||
var chunkLen = indexBytes.Length + 1;
|
||||
var bytes = new List<byte>(new byte[] {
|
||||
START_BYTE, (byte)SeStringChunkType.Icon, (byte)chunkLen
|
||||
|
|
@ -37,12 +52,14 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads {
|
|||
return bytes.ToArray();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void DecodeImpl(BinaryReader reader, long endOfStream) {
|
||||
this.IconIndex = GetInteger(reader);
|
||||
Icon = (BitmapFontIcon) GetInteger(reader);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() {
|
||||
return $"{Type} - IconIndex: {this.IconIndex}";
|
||||
return $"{Type} - {Icon}";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue