This commit is contained in:
goat 2020-06-25 21:32:26 +02:00
commit 26ad4ce74b
13 changed files with 58 additions and 1377 deletions

View file

@ -4,7 +4,6 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
@ -16,17 +15,12 @@ using Dalamud.Game;
using Dalamud.Game.Chat;
using Dalamud.Game.Chat.SeStringHandling;
using Dalamud.Game.ClientState;
using Dalamud.Game.ClientState.Actors.Types;
using Dalamud.Game.ClientState.Actors.Types.NonPlayer;
using Dalamud.Game.Command;
using Dalamud.Game.Internal;
using Dalamud.Game.Internal.Gui;
using Dalamud.Game.Network;
using Dalamud.Interface;
using Dalamud.Plugin;
using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using Newtonsoft.Json;
using Serilog;
using Serilog.Core;
using Serilog.Events;
@ -380,17 +374,6 @@ namespace Dalamud {
this.isImguiDrawPluginWindow = this.pluginWindow != null && this.pluginWindow.Draw();
}
if (this.isImguiDrawItemSearchWindow)
{
this.isImguiDrawItemSearchWindow = this.itemSearchCommandWindow != null && this.itemSearchCommandWindow.Draw();
if (this.isImguiDrawItemSearchWindow == false)
{
this.itemSearchCommandWindow?.Dispose();
this.itemSearchCommandWindow = null;
}
}
if (this.isImguiDrawCreditsWindow)
{
this.isImguiDrawCreditsWindow = this.creditsWindow != null && this.creditsWindow.Draw();
@ -475,11 +458,6 @@ namespace Dalamud {
HelpMessage = Loc.Localize("DalamudBgmSetHelp", "Set the Game background music. Usage: /xlbgmset <BGM ID>")
});
CommandManager.AddHandler("/xlitem", new CommandInfo(OnItemLinkCommand)
{
HelpMessage = Loc.Localize("DalamudItemLinkHelp", "Open a window you can use to link any specific item to chat.")
});
#if DEBUG
CommandManager.AddHandler("/xldzpi", new CommandInfo(OnDebugZoneDownInjectCommand)
{
@ -640,22 +618,6 @@ namespace Dalamud {
Framework.Gui.SetBgm(ushort.Parse(arguments));
}
private ItemSearchWindow itemSearchCommandWindow;
private bool isImguiDrawItemSearchWindow;
private void OnItemLinkCommand(string command, string arguments)
{
this.itemSearchCommandWindow = new ItemSearchWindow(this.Data, new UiBuilder(this.InterfaceManager, "ItemSearcher"), false, arguments);
this.itemSearchCommandWindow.OnItemChosen += (sender, item) =>
{
this.Framework.Gui.Chat.PrintChat(new XivChatEntry
{
MessageBytes = SeStringUtils.CreateItemLink(item, false).Encode()
});
};
this.isImguiDrawItemSearchWindow = true;
}
#if DEBUG
private void OnDebugZoneDownInjectCommand(string command, string arguments) {
var data = File.ReadAllBytes(arguments);

View file

@ -38,7 +38,7 @@
<ItemGroup>
<PackageReference Include="CheapLoc" Version="1.1.3" />
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" />
<PackageReference Include="Lumina" Version="2.0.0" />
<PackageReference Include="Lumina" Version="2.1.0" />
<PackageReference Include="Lumina.Generated" Version="5.25.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="PropertyChanged.Fody" Version="2.6.1" />

View file

@ -1,610 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Lumina.Excel;
namespace Dalamud.Data.TransientSheet
{
[Sheet("ContentFinderCondition")]
public class ContentFinderCondition : IExcelRow
{
// column defs from Thu, 13 Feb 2020 20:46:12 GMT
/* offset: 002c col: 0
* name: ShortCode
* type:
*/
/* offset: 0048 col: 1
* name: TerritoryType
* type:
*/
/* offset: 0054 col: 2
* name: ContentLinkType
* type:
*/
/* offset: 004a col: 3
* name: Content
* type:
*/
/* offset: 0061 col: 4
* name: PvP
* type:
*/
/* offset: 0055 col: 5
* no SaintCoinach definition found
*/
/* offset: 0030 col: 6
* no SaintCoinach definition found
*/
/* offset: 0034 col: 7
* no SaintCoinach definition found
*/
/* offset: 0056 col: 8
* name: AcceptClassJobCategory
* type:
*/
/* offset: 0057 col: 9
* name: ContentMemberType
* type:
*/
/* offset: 0058 col: 10
* no SaintCoinach definition found
*/
/* offset: 0059 col: 11
* no SaintCoinach definition found
*/
/* offset: 005a col: 12
* no SaintCoinach definition found
*/
/* offset: 0038 col: 13
* name: UnlockQuest
* type:
*/
/* offset: 004c col: 14
* no SaintCoinach definition found
*/
/* offset: 005b col: 15
* name: ClassJobLevel{Required}
* type:
*/
/* offset: 005c col: 16
* name: ClassJobLevel{Sync}
* type:
*/
/* offset: 004e col: 17
* name: ItemLevel{Required}
* type:
*/
/* offset: 0050 col: 18
* name: ItemLevel{Sync}
* type:
*/
/* offset: 0061 col: 19
* name: AllowUndersized
* type:
*/
/* offset: 0061 col: 20
* name: AllowReplacement
* type:
*/
/* offset: 0061 col: 21
* no SaintCoinach definition found
*/
/* offset: 0061 col: 22
* no SaintCoinach definition found
*/
/* offset: 0061 col: 23
* no SaintCoinach definition found
*/
/* offset: 005d col: 24
* no SaintCoinach definition found
*/
/* offset: 0061 col: 25
* no SaintCoinach definition found
*/
/* offset: 0061 col: 26
* name: HighEndDuty
* type:
*/
/* offset: 0062 col: 27
* no SaintCoinach definition found
*/
/* offset: 0062 col: 28
* no SaintCoinach definition found
*/
/* offset: 0062 col: 29
* no SaintCoinach definition found
*/
/* offset: 0062 col: 30
* name: DutyRecorderAllowed
* type:
*/
/* offset: 0062 col: 31
* no SaintCoinach definition found
*/
/* offset: 0062 col: 32
* no SaintCoinach definition found
*/
/* offset: 0062 col: 33
* no SaintCoinach definition found
*/
/* offset: 0000 col: 34
* name: Name
* type:
*/
/* offset: 005e col: 35
* name: ContentType
* type:
*/
/* offset: 005f col: 36
* name: TransientKey
* type:
*/
/* offset: 003c col: 37
* name: Transient
* type:
*/
/* offset: 0052 col: 38
* name: SortKey
* type:
*/
/* offset: 0040 col: 39
* name: Image
* type:
*/
/* offset: 0044 col: 40
* name: Icon
* type:
*/
/* offset: 0060 col: 41
* no SaintCoinach definition found
*/
/* offset: 0004 col: 42
* name: LevelingRoulette
* type:
*/
/* offset: 0005 col: 43
* name: Level50/60Roulette
* type:
*/
/* offset: 0006 col: 44
* name: MSQRoulette
* type:
*/
/* offset: 0007 col: 45
* name: GuildHestRoulette
* type:
*/
/* offset: 0008 col: 46
* name: ExpertRoulette
* type:
*/
/* offset: 0009 col: 47
* name: TrialRoulette
* type:
*/
/* offset: 000a col: 48
* name: DailyFrontlineChallenge
* type:
*/
/* offset: 000b col: 49
* name: Level70Roulette
* type:
*/
/* offset: 000c col: 50
* name: MentorRoulette
* type:
*/
/* offset: 000d col: 51
* no SaintCoinach definition found
*/
/* offset: 000e col: 52
* no SaintCoinach definition found
*/
/* offset: 000f col: 53
* no SaintCoinach definition found
*/
/* offset: 0010 col: 54
* no SaintCoinach definition found
*/
/* offset: 0011 col: 55
* no SaintCoinach definition found
*/
/* offset: 0012 col: 56
* name: AllianceRoulette
* type:
*/
/* offset: 0013 col: 57
* no SaintCoinach definition found
*/
/* offset: 0014 col: 58
* name: NormalRaidRoulette
* type:
*/
/* offset: 0015 col: 59
* no SaintCoinach definition found
*/
/* offset: 0016 col: 60
* no SaintCoinach definition found
*/
/* offset: 0017 col: 61
* no SaintCoinach definition found
*/
/* offset: 0018 col: 62
* no SaintCoinach definition found
*/
/* offset: 0019 col: 63
* no SaintCoinach definition found
*/
/* offset: 001a col: 64
* no SaintCoinach definition found
*/
/* offset: 001b col: 65
* no SaintCoinach definition found
*/
/* offset: 001c col: 66
* no SaintCoinach definition found
*/
/* offset: 001d col: 67
* no SaintCoinach definition found
*/
/* offset: 001e col: 68
* no SaintCoinach definition found
*/
/* offset: 001f col: 69
* no SaintCoinach definition found
*/
/* offset: 0020 col: 70
* no SaintCoinach definition found
*/
/* offset: 0021 col: 71
* no SaintCoinach definition found
*/
/* offset: 0022 col: 72
* no SaintCoinach definition found
*/
/* offset: 0023 col: 73
* no SaintCoinach definition found
*/
/* offset: 0024 col: 74
* no SaintCoinach definition found
*/
/* offset: 0025 col: 75
* no SaintCoinach definition found
*/
/* offset: 0026 col: 76
* no SaintCoinach definition found
*/
/* offset: 0027 col: 77
* no SaintCoinach definition found
*/
/* offset: 0028 col: 78
* no SaintCoinach definition found
*/
/* offset: 0029 col: 79
* no SaintCoinach definition found
*/
/* offset: 002a col: 80
* no SaintCoinach definition found
*/
// col: 34 offset: 0000
public string Name;
// col: 42 offset: 0004
public bool LevelingRoulette;
// col: 43 offset: 0005
public bool Level5060Roulette;
// col: 44 offset: 0006
public bool MSQRoulette;
// col: 45 offset: 0007
public bool GuildHestRoulette;
// col: 46 offset: 0008
public bool ExpertRoulette;
// col: 47 offset: 0009
public bool TrialRoulette;
// col: 48 offset: 000a
public bool DailyFrontlineChallenge;
// col: 49 offset: 000b
public bool Level70Roulette;
// col: 50 offset: 000c
public bool MentorRoulette;
// col: 51 offset: 000d
public bool unknownd;
// col: 52 offset: 000e
public bool unknowne;
// col: 53 offset: 000f
public bool unknownf;
// col: 54 offset: 0010
public bool unknown10;
// col: 55 offset: 0011
public bool unknown11;
// col: 56 offset: 0012
public bool AllianceRoulette;
// col: 57 offset: 0013
public bool unknown13;
// col: 58 offset: 0014
public bool NormalRaidRoulette;
// col: 59 offset: 0015
public bool unknown15;
// col: 60 offset: 0016
public bool unknown16;
// col: 61 offset: 0017
public bool unknown17;
// col: 62 offset: 0018
public bool unknown18;
// col: 63 offset: 0019
public bool unknown19;
// col: 64 offset: 001a
public bool unknown1a;
// col: 65 offset: 001b
public bool unknown1b;
// col: 66 offset: 001c
public bool unknown1c;
// col: 67 offset: 001d
public bool unknown1d;
// col: 68 offset: 001e
public bool unknown1e;
// col: 69 offset: 001f
public bool unknown1f;
// col: 70 offset: 0020
public bool unknown20;
// col: 71 offset: 0021
public bool unknown21;
// col: 72 offset: 0022
public bool unknown22;
// col: 73 offset: 0023
public bool unknown23;
// col: 74 offset: 0024
public bool unknown24;
// col: 75 offset: 0025
public bool unknown25;
// col: 76 offset: 0026
public bool unknown26;
// col: 77 offset: 0027
public bool unknown27;
// col: 78 offset: 0028
public bool unknown28;
// col: 79 offset: 0029
public bool unknown29;
// col: 80 offset: 002a
public bool unknown2a;
// col: 00 offset: 002c
public string ShortCode;
// col: 06 offset: 0030
public uint unknown30;
// col: 07 offset: 0034
public uint unknown34;
// col: 13 offset: 0038
public uint UnlockQuest;
// col: 37 offset: 003c
public uint Transient;
// col: 39 offset: 0040
public uint Image;
// col: 40 offset: 0044
public uint Icon;
// col: 01 offset: 0048
public ushort TerritoryType;
// col: 03 offset: 004a
public ushort Content;
// col: 14 offset: 004c
public ushort unknown4c;
// col: 17 offset: 004e
public ushort ItemLevelRequired;
// col: 18 offset: 0050
public ushort ItemLevelSync;
// col: 38 offset: 0052
public ushort SortKey;
// col: 02 offset: 0054
public byte ContentLinkType;
// col: 05 offset: 0055
public byte unknown55;
// col: 08 offset: 0056
public byte AcceptClassJobCategory;
// col: 09 offset: 0057
public byte ContentMemberType;
// col: 10 offset: 0058
public byte unknown58;
// col: 11 offset: 0059
public byte unknown59;
// col: 12 offset: 005a
public byte unknown5a;
// col: 15 offset: 005b
public byte ClassJobLevelRequired;
// col: 16 offset: 005c
public byte ClassJobLevelSync;
// col: 24 offset: 005d
public byte unknown5d;
// col: 35 offset: 005e
public byte ContentType;
// col: 36 offset: 005f
public byte TransientKey;
// col: 41 offset: 0060
public sbyte unknown60;
// col: 04 offset: 0061
private byte packed61;
public bool PvP => (packed61 & 0x1) == 0x1;
public bool AllowUndersized => (packed61 & 0x2) == 0x2;
public bool AllowReplacement => (packed61 & 0x4) == 0x4;
public bool unknown61_8 => (packed61 & 0x8) == 0x8;
public bool unknown61_10 => (packed61 & 0x10) == 0x10;
public bool unknown61_20 => (packed61 & 0x20) == 0x20;
public bool unknown61_40 => (packed61 & 0x40) == 0x40;
public bool HighEndDuty => (packed61 & 0x80) == 0x80;
// col: 27 offset: 0062
private byte packed62;
public bool unknown62_1 => (packed62 & 0x1) == 0x1;
public bool unknown62_2 => (packed62 & 0x2) == 0x2;
public bool unknown62_4 => (packed62 & 0x4) == 0x4;
public bool DutyRecorderAllowed => (packed62 & 0x8) == 0x8;
public bool unknown62_10 => (packed62 & 0x10) == 0x10;
public bool unknown62_20 => (packed62 & 0x20) == 0x20;
public bool unknown62_40 => (packed62 & 0x40) == 0x40;
public uint RowId { get; set; }
public uint SubRowId { get; set; }
public void PopulateData(RowParser parser, Lumina.Lumina lumina)
{
RowId = parser.Row;
SubRowId = parser.SubRow;
// col: 34 offset: 0000
Name = parser.ReadOffset<string>(0x0);
// col: 39 offset: 0040
Image = parser.ReadOffset<uint>(0x40);
}
}
}

View file

@ -1,481 +0,0 @@
using System;
using Lumina.Data.Structs.Excel;
using Lumina.Excel;
namespace Dalamud.Data.TransientSheet
{
[Sheet("Item", columnHash: 0x9f2e970b)]
public class Item : IExcelRow
{
// column defs from Mon, 24 Feb 2020 17:34:06 GMT
// col: 00 offset: 0000
public string Singular;
// col: 02 offset: 0004
public string Plural;
// col: 08 offset: 0008
public string Description;
// col: 09 offset: 000c
public string Name;
// col: 01 offset: 0010
public sbyte Adjective;
// col: 03 offset: 0011
public sbyte PossessivePronoun;
// col: 04 offset: 0012
public sbyte StartsWithVowel;
// col: 05 offset: 0013
public sbyte unknown13;
// col: 06 offset: 0014
public sbyte Pronoun;
// col: 07 offset: 0015
public sbyte Article;
// col: 47 offset: 0018
public ulong ModelMain;
// col: 48 offset: 0020
public ulong ModelSub;
// col: 51 offset: 0028
public ushort DamagePhys;
// col: 52 offset: 002a
public ushort DamageMag;
// col: 53 offset: 002c
public ushort Delayms;
// col: 55 offset: 002e
public ushort BlockRate;
// col: 56 offset: 0030
public ushort Block;
// col: 57 offset: 0032
public ushort DefensePhys;
// col: 58 offset: 0034
public ushort DefenseMag;
// col: 66 offset: 003c
public short unknown3c;
// col: 68 offset: 003e
public short unknown3e;
// col: 70 offset: 0040
public short unknown40;
// col: 80 offset: 0048
public short unknown48;
// col: 82 offset: 004a
public short unknown4a;
// col: 84 offset: 004c
public short unknown4c;
// col: 40 offset: 004e
public byte LevelEquip;
// col: 41 offset: 004f
public byte unknown4f;
// col: 42 offset: 0050
public byte EquipRestriction;
// col: 43 offset: 0051
public byte ClassJobCategory;
// col: 44 offset: 0052
public byte GrandCompany;
// col: 45 offset: 0053
public byte ItemSeries;
// col: 46 offset: 0054
public byte BaseParamModifier;
// col: 49 offset: 0055
public byte ClassJobUse;
// col: 50 offset: 0056
public byte unknown56;
// col: 54 offset: 0057
public byte unknown57;
// col: 59 offset: 0058
public short[] unknown58;
// col: 65 offset: 005b
public byte unknown5b;
// col: 67 offset: 005c
public byte unknown5c;
// col: 69 offset: 005d
public byte unknown5d;
// col: 71 offset: 005e
public byte ItemSpecialBonus;
// col: 72 offset: 005f
public byte ItemSpecialBonusParam;
// col: 73 offset: 0060
public short[] unknown60;
// col: 79 offset: 0063
public byte unknown63;
// col: 81 offset: 0064
public byte unknown64;
// col: 83 offset: 0065
public byte unknown65;
// col: 85 offset: 0066
public byte MaterializeType;
// col: 86 offset: 0067
public byte MateriaSlotCount;
// col: 89 offset: 0068
public byte unknown68;
// col: 87 offset: 0069
private byte packed69;
public bool IsAdvancedMeldingPermitted => (packed69 & 0x1) == 0x1;
public bool IsPvP => (packed69 & 0x2) == 0x2;
public bool IsGlamourous => (packed69 & 0x4) == 0x4;
// col: 14 offset: 0070
public uint AdditionalData;
// col: 19 offset: 0074
public uint StackSize;
// col: 24 offset: 0078
public uint PriceMid;
// col: 25 offset: 007c
public uint PriceLow;
// col: 33 offset: 0080
public int ItemRepair;
// col: 34 offset: 0084
public int ItemGlamour;
// col: 10 offset: 0088
public ushort Icon;
// col: 11 offset: 008a
public ushort LevelItem;
// col: 18 offset: 008c
public ushort unknown8c;
// col: 29 offset: 008e
public ushort ItemAction;
// col: 31 offset: 0090
public ushort Cooldowns;
// col: 35 offset: 0092
public ushort Salvage;
// col: 36 offset: 0094
public ushort unknown94;
// col: 39 offset: 0096
public ushort AetherialReduce;
// col: 12 offset: 0098
public byte Rarity;
// col: 13 offset: 0099
public byte FilterGroup;
// col: 15 offset: 009a
public byte ItemUICategory;
// col: 16 offset: 009b
public byte ItemSearchCategory;
// col: 17 offset: 009c
public byte EquipSlotCategory;
// col: 30 offset: 009d
public byte unknown9d;
// col: 32 offset: 009e
public byte ClassJobRepair;
// col: 20 offset: 009f
private byte packed9f;
public bool IsUnique => (packed9f & 0x1) == 0x1;
public bool IsUntradable => (packed9f & 0x2) == 0x2;
public bool IsIndisposable => (packed9f & 0x4) == 0x4;
public bool Lot => (packed9f & 0x8) == 0x8;
public bool CanBeHq => (packed9f & 0x10) == 0x10;
public bool IsDyeable => (packed9f & 0x20) == 0x20;
public bool IsCrestWorthy => (packed9f & 0x40) == 0x40;
public bool IsCollectable => (packed9f & 0x80) == 0x80;
// col: 38 offset: 00a0
private byte packeda0;
public bool AlwaysCollectable => (packeda0 & 0x1) == 0x1;
public uint RowId { get; set; }
public uint SubRowId { get; set; }
public void PopulateData(RowParser parser, global::Lumina.Lumina lumina)
{
RowId = parser.Row;
SubRowId = parser.SubRow;
// col: 0 offset: 0000
Singular = parser.ReadOffset<string>(0x0);
// col: 2 offset: 0004
Plural = parser.ReadOffset<string>(0x4);
// col: 8 offset: 0008
Description = parser.ReadOffset<string>(0x8);
// col: 9 offset: 000c
Name = parser.ReadOffset<string>(0xc);
// col: 1 offset: 0010
Adjective = parser.ReadOffset<sbyte>(0x10);
// col: 3 offset: 0011
PossessivePronoun = parser.ReadOffset<sbyte>(0x11);
// col: 4 offset: 0012
StartsWithVowel = parser.ReadOffset<sbyte>(0x12);
// col: 5 offset: 0013
unknown13 = parser.ReadOffset<sbyte>(0x13);
// col: 6 offset: 0014
Pronoun = parser.ReadOffset<sbyte>(0x14);
// col: 7 offset: 0015
Article = parser.ReadOffset<sbyte>(0x15);
// col: 47 offset: 0018
ModelMain = parser.ReadOffset<ulong>(0x18);
// col: 48 offset: 0020
ModelSub = parser.ReadOffset<ulong>(0x20);
// col: 51 offset: 0028
DamagePhys = parser.ReadOffset<ushort>(0x28);
// col: 52 offset: 002a
DamageMag = parser.ReadOffset<ushort>(0x2a);
// col: 53 offset: 002c
Delayms = parser.ReadOffset<ushort>(0x2c);
// col: 55 offset: 002e
BlockRate = parser.ReadOffset<ushort>(0x2e);
// col: 56 offset: 0030
Block = parser.ReadOffset<ushort>(0x30);
// col: 57 offset: 0032
DefensePhys = parser.ReadOffset<ushort>(0x32);
// col: 58 offset: 0034
DefenseMag = parser.ReadOffset<ushort>(0x34);
// col: 66 offset: 003c
unknown3c = parser.ReadOffset<short>(0x3c);
// col: 68 offset: 003e
unknown3e = parser.ReadOffset<short>(0x3e);
// col: 70 offset: 0040
unknown40 = parser.ReadOffset<short>(0x40);
// col: 80 offset: 0048
unknown48 = parser.ReadOffset<short>(0x48);
// col: 82 offset: 004a
unknown4a = parser.ReadOffset<short>(0x4a);
// col: 84 offset: 004c
unknown4c = parser.ReadOffset<short>(0x4c);
// col: 40 offset: 004e
LevelEquip = parser.ReadOffset<byte>(0x4e);
// col: 41 offset: 004f
unknown4f = parser.ReadOffset<byte>(0x4f);
// col: 42 offset: 0050
EquipRestriction = parser.ReadOffset<byte>(0x50);
// col: 43 offset: 0051
ClassJobCategory = parser.ReadOffset<byte>(0x51);
// col: 44 offset: 0052
GrandCompany = parser.ReadOffset<byte>(0x52);
// col: 45 offset: 0053
ItemSeries = parser.ReadOffset<byte>(0x53);
// col: 46 offset: 0054
BaseParamModifier = parser.ReadOffset<byte>(0x54);
// col: 49 offset: 0055
ClassJobUse = parser.ReadOffset<byte>(0x55);
// col: 50 offset: 0056
unknown56 = parser.ReadOffset<byte>(0x56);
// col: 54 offset: 0057
unknown57 = parser.ReadOffset<byte>(0x57);
// col: 59 offset: 0058
unknown58 = new short[6];
unknown58[0] = parser.ReadOffset<byte>(0x58);
unknown58[1] = parser.ReadOffset<short>(0x36);
unknown58[2] = parser.ReadOffset<byte>(0x59);
unknown58[3] = parser.ReadOffset<short>(0x38);
unknown58[4] = parser.ReadOffset<byte>(0x5a);
unknown58[5] = parser.ReadOffset<short>(0x3a);
// col: 65 offset: 005b
unknown5b = parser.ReadOffset<byte>(0x5b);
// col: 67 offset: 005c
unknown5c = parser.ReadOffset<byte>(0x5c);
// col: 69 offset: 005d
unknown5d = parser.ReadOffset<byte>(0x5d);
// col: 71 offset: 005e
ItemSpecialBonus = parser.ReadOffset<byte>(0x5e);
// col: 72 offset: 005f
ItemSpecialBonusParam = parser.ReadOffset<byte>(0x5f);
// col: 73 offset: 0060
unknown60 = new short[6];
unknown60[0] = parser.ReadOffset<byte>(0x60);
unknown60[1] = parser.ReadOffset<short>(0x42);
unknown60[2] = parser.ReadOffset<byte>(0x61);
unknown60[3] = parser.ReadOffset<short>(0x44);
unknown60[4] = parser.ReadOffset<byte>(0x62);
unknown60[5] = parser.ReadOffset<short>(0x46);
// col: 79 offset: 0063
unknown63 = parser.ReadOffset<byte>(0x63);
// col: 81 offset: 0064
unknown64 = parser.ReadOffset<byte>(0x64);
// col: 83 offset: 0065
unknown65 = parser.ReadOffset<byte>(0x65);
// col: 85 offset: 0066
MaterializeType = parser.ReadOffset<byte>(0x66);
// col: 86 offset: 0067
MateriaSlotCount = parser.ReadOffset<byte>(0x67);
// col: 89 offset: 0068
unknown68 = parser.ReadOffset<byte>(0x68);
// col: 87 offset: 0069
packed69 = parser.ReadOffset<byte>(0x69, ExcelColumnDataType.UInt8);
// col: 14 offset: 0070
AdditionalData = parser.ReadOffset<uint>(0x70);
// col: 19 offset: 0074
StackSize = parser.ReadOffset<uint>(0x74);
// col: 24 offset: 0078
PriceMid = parser.ReadOffset<uint>(0x78);
// col: 25 offset: 007c
PriceLow = parser.ReadOffset<uint>(0x7c);
// col: 33 offset: 0080
ItemRepair = parser.ReadOffset<int>(0x80);
// col: 34 offset: 0084
ItemGlamour = parser.ReadOffset<int>(0x84);
// col: 10 offset: 0088
Icon = parser.ReadOffset<ushort>(0x88);
// col: 11 offset: 008a
LevelItem = parser.ReadOffset<ushort>(0x8a);
// col: 18 offset: 008c
unknown8c = parser.ReadOffset<ushort>(0x8c);
// col: 29 offset: 008e
ItemAction = parser.ReadOffset<ushort>(0x8e);
// col: 31 offset: 0090
Cooldowns = parser.ReadOffset<ushort>(0x90);
// col: 35 offset: 0092
Salvage = parser.ReadOffset<ushort>(0x92);
// col: 36 offset: 0094
unknown94 = parser.ReadOffset<ushort>(0x94);
// col: 39 offset: 0096
AetherialReduce = parser.ReadOffset<ushort>(0x96);
// col: 12 offset: 0098
Rarity = parser.ReadOffset<byte>(0x98);
// col: 13 offset: 0099
FilterGroup = parser.ReadOffset<byte>(0x99);
// col: 15 offset: 009a
ItemUICategory = parser.ReadOffset<byte>(0x9a);
// col: 16 offset: 009b
ItemSearchCategory = parser.ReadOffset<byte>(0x9b);
// col: 17 offset: 009c
EquipSlotCategory = parser.ReadOffset<byte>(0x9c);
// col: 30 offset: 009d
unknown9d = parser.ReadOffset<byte>(0x9d);
// col: 32 offset: 009e
ClassJobRepair = parser.ReadOffset<byte>(0x9e);
// col: 20 offset: 009f
packed9f = parser.ReadOffset<byte>(0x9f, ExcelColumnDataType.UInt8);
// col: 38 offset: 00a0
packeda0 = parser.ReadOffset<byte>(0xa0, ExcelColumnDataType.UInt8);
}
}
}

View file

@ -6,13 +6,13 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Dalamud.Data.TransientSheet;
using Dalamud.Game.Chat;
using Dalamud.Game.Chat.SeStringHandling;
using Dalamud.Game.Chat.SeStringHandling.Payloads;
using Dalamud.Game.Internal.Libc;
using Discord;
using Discord.WebSocket;
using Lumina.Excel.GeneratedSheets;
using Newtonsoft.Json.Linq;
using Serilog;
@ -135,7 +135,7 @@ namespace Dalamud.DiscordBot {
await channel.SendMessageAsync(embed: embedBuilder.Build());
}
public async Task ProcessRetainerSale(int itemId, int amount, bool isHq) {
public async Task ProcessRetainerSale(uint itemId, int amount, bool isHq) {
if (this.config.RetainerNotificationChannel == null)
return;

View file

@ -245,10 +245,17 @@ namespace Dalamud.Game.Chat.SeStringHandling
Byte = 0xF0,
ByteTimes256 = 0xF1,
Int16 = 0xF2,
ByteSHL16 = 0xF3,
Int16Packed = 0xF4, // seen in map links, seemingly 2 8-bit values packed into 2 bytes with only one marker
Int16SHL8 = 0xF5,
Int24Special = 0xF6, // unsure how different form Int24 - used for hq items that add 1 million, also used for normal 24-bit values in map links
Int8SHL24 = 0xF7,
Int8SHL8Int8 = 0xF8,
Int8SHL8Int8SHL8 = 0xF9,
Int24 = 0xFA,
Int16SHL16 = 0xFB,
Int24Packed = 0xFC, // used in map links- sometimes short+byte, sometimes... not??
Int16Int8SHL8 = 0xFD,
Int32 = 0xFE
}
@ -276,6 +283,25 @@ namespace Dalamud.Game.Chat.SeStringHandling
case IntegerType.ByteTimes256:
return input.ReadByte() * (uint)256;
case IntegerType.ByteSHL16:
return (uint)(input.ReadByte() << 16);
case IntegerType.Int8SHL24:
return (uint)(input.ReadByte() << 24);
case IntegerType.Int8SHL8Int8:
{
var v = 0;
v |= input.ReadByte() << 24;
v |= input.ReadByte();
return (uint)v;
}
case IntegerType.Int8SHL8Int8SHL8:
{
var v = 0;
v |= input.ReadByte() << 24;
v |= input.ReadByte() << 8;
return (uint)v;
}
case IntegerType.Int16:
// fallthrough - same logic
@ -286,6 +312,20 @@ namespace Dalamud.Game.Chat.SeStringHandling
v |= input.ReadByte();
return (uint)v;
}
case IntegerType.Int16SHL8:
{
var v = 0;
v |= input.ReadByte() << 16;
v |= input.ReadByte() << 8;
return (uint)v;
}
case IntegerType.Int16SHL16:
{
var v = 0;
v |= input.ReadByte() << 24;
v |= input.ReadByte() << 16;
return (uint)v;
}
case IntegerType.Int24Special:
// Fallthrough - same logic
@ -299,7 +339,14 @@ namespace Dalamud.Game.Chat.SeStringHandling
v |= input.ReadByte();
return (uint)v;
}
case IntegerType.Int16Int8SHL8:
{
var v = 0;
v |= input.ReadByte() << 24;
v |= input.ReadByte() << 16;
v |= input.ReadByte() << 8;
return (uint)v;
}
case IntegerType.Int32:
{
var v = 0;

View file

@ -1,10 +1,10 @@
using Dalamud.Data.TransientSheet;
using Lumina.Excel.GeneratedSheets;
using Serilog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Dalamud.Data.TransientSheet;
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
{

View file

@ -1,9 +1,9 @@
using Dalamud.Data.TransientSheet;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Lumina.Excel.GeneratedSheets;
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
{

View file

@ -4,8 +4,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using DalamudItem = Dalamud.Data.TransientSheet.Item;
namespace Dalamud.Game.Chat.SeStringHandling
{
/// <summary>
@ -22,7 +20,7 @@ namespace Dalamud.Game.Chat.SeStringHandling
/// <returns>An SeString containing all the payloads necessary to display an item link in the chat log.</returns>
public static SeString CreateItemLink(uint itemId, bool isHQ, string displayNameOverride = null)
{
string displayName = displayNameOverride ?? SeString.Dalamud.Data.GetExcelSheet<DalamudItem>().GetRow(itemId).Name;
string displayName = displayNameOverride ?? SeString.Dalamud.Data.GetExcelSheet<Item>().GetRow(itemId).Name;
if (isHQ)
{
displayName += $" {(char)SeIconChar.HighQuality}";
@ -52,7 +50,7 @@ namespace Dalamud.Game.Chat.SeStringHandling
/// <param name="isHQ">Whether to link the high-quality variant of the item.</param>
/// <param name="displayNameOverride">An optional name override to display, instead of the actual item name.</param>
/// <returns>An SeString containing all the payloads necessary to display an item link in the chat log.</returns>
public static SeString CreateItemLink(DalamudItem item, bool isHQ, string displayNameOverride = null)
public static SeString CreateItemLink(Item item, bool isHQ, string displayNameOverride = null)
{
return CreateItemLink((uint)item.RowId, isHQ, displayNameOverride ?? item.Name);
}

View file

@ -166,7 +166,7 @@ namespace Dalamud.Game {
if (!valueInfo.Success || !int.TryParse(valueInfo.Value.Replace(",", "").Replace(".", ""), out var itemValue))
continue;
Task.Run(() => this.dalamud.BotManager.ProcessRetainerSale((int)itemLink.Item.RowId, itemValue, itemLink.IsHQ));
Task.Run(() => this.dalamud.BotManager.ProcessRetainerSale(itemLink.Item.RowId, itemValue, itemLink.IsHQ));
break;
}
}

View file

@ -4,12 +4,12 @@ using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Dalamud.Data.TransientSheet;
using Dalamud.Game.Internal.Network;
using Dalamud.Game.Network.MarketBoardUploaders;
using Dalamud.Game.Network.Structures;
using Dalamud.Game.Network.Universalis.MarketBoardUploaders;
using Lumina.Excel;
using Lumina.Excel.GeneratedSheets;
using Newtonsoft.Json.Linq;
using Serilog;

View file

@ -1,235 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Net.Mime;
using System.Numerics;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CheapLoc;
using Dalamud.Data;
using Dalamud.Data.LuminaExtensions;
using Dalamud.Game.ClientState.Actors.Types;
using Dalamud.Game.ClientState.Actors.Types.NonPlayer;
using ImGuiNET;
using ImGuiScene;
using Lumina.Excel.GeneratedSheets;
using Serilog;
using Item = Dalamud.Data.TransientSheet.Item;
namespace Dalamud.Interface
{
class ItemSearchWindow : IDisposable
{
private readonly DataManager data;
private readonly UiBuilder builder;
private readonly bool closeOnChoose;
private string lastSearchText = string.Empty;
private string searchText = string.Empty;
private int lastKind = 0;
private int currentKind = 0;
private int selectedItemIndex = -1;
private TextureWrap selectedItemTex;
private CancellationTokenSource searchCancelTokenSource;
private ValueTask<List<Item>> searchTask;
private List<Item> luminaItems;
public event EventHandler<Item> OnItemChosen;
public ItemSearchWindow(DataManager data, UiBuilder builder, bool closeOnChoose = true, string searchText = "") {
this.data = data;
this.builder = builder;
this.closeOnChoose = closeOnChoose;
this.searchText = searchText;
while (!data.IsDataReady)
Thread.Sleep(1);
Task.Run(() => this.data.GetExcelSheet<Item>().GetRows()).ContinueWith(t => this.luminaItems = t.Result);
}
public bool Draw() {
ImGui.SetNextWindowSize(new Vector2(500, 500), ImGuiCond.FirstUseEver);
var isOpen = true;
if (!ImGui.Begin(Loc.Localize("DalamudItemSelectHeader", "Select an item"), ref isOpen, ImGuiWindowFlags.NoCollapse))
{
ImGui.End();
return false;
}
// Main window
ImGui.AlignTextToFramePadding();
ImGui.Text(Loc.Localize("DalamudItemSelect", "Please select an item."));
if (this.selectedItemTex != null) {
ImGui.Text(" ");
ImGui.SetCursorPosY(200f);
ImGui.SameLine();
ImGui.Image(this.selectedItemTex.ImGuiHandle, new Vector2(40, 40));
} else {
ImGui.Text(" ");
}
ImGui.Separator();
ImGui.Text(Loc.Localize("DalamudItemSearchVerb", "Search: "));
ImGui.SameLine();
ImGui.InputText("##searchbox", ref this.searchText, 32);
var kinds = new List<string> {Loc.Localize("DalamudItemSelectAll", "All")};
kinds.AddRange(this.data.GetExcelSheet<ItemUICategory>().GetRows().Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => x.Name.Replace("\u0002\u001F\u0001\u0003", "-")));
ImGui.Text(Loc.Localize("DalamudItemSelectCategory", "Category: "));
ImGui.SameLine();
ImGui.Combo("##kindbox", ref this.currentKind, kinds.ToArray(),
kinds.Count);
var windowSize = ImGui.GetWindowSize();
ImGui.BeginChild("scrolling", new Vector2(0, windowSize.Y - ImGui.GetCursorPosY() - 40), true, ImGuiWindowFlags.HorizontalScrollbar);
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0, 0));
if (this.luminaItems != null) {
if (!string.IsNullOrEmpty(this.searchText) || this.currentKind != 0)
{
if (this.lastSearchText != this.searchText || this.lastKind != this.currentKind)
{
this.lastSearchText = this.searchText;
this.lastKind = this.currentKind;
this.searchCancelTokenSource?.Cancel();
this.searchCancelTokenSource = new CancellationTokenSource();
var asyncEnum = this.luminaItems.ToAsyncEnumerable();
if (!string.IsNullOrEmpty(this.searchText))
{
Log.Debug("Searching for " + this.searchText);
asyncEnum = asyncEnum.Where(
x => (x.Name.ToLower().Contains(this.searchText.ToLower()) ||
int.TryParse(this.searchText, out var parsedId) &&
parsedId == x.RowId) && x.Icon < 65000);
}
if (this.currentKind != 0)
{
Log.Debug("Searching for C" + this.currentKind);
asyncEnum = asyncEnum.Where(x => x.ItemUICategory == this.currentKind);
}
this.selectedItemIndex = -1;
this.selectedItemTex?.Dispose();
this.selectedItemTex = null;
this.searchTask = asyncEnum.ToListAsync(this.searchCancelTokenSource.Token);
}
if (this.searchTask.IsCompletedSuccessfully)
{
for (var i = 0; i < this.searchTask.Result.Count; i++)
{
if (ImGui.Selectable(this.searchTask.Result[i].Name, this.selectedItemIndex == i, ImGuiSelectableFlags.AllowDoubleClick))
{
this.selectedItemIndex = i;
try
{
var iconTex = this.data.GetIcon(this.searchTask.Result[i].Icon);
this.selectedItemTex?.Dispose();
this.selectedItemTex =
this.builder.LoadImageRaw(iconTex.GetRgbaImageData(), iconTex.Header.Width,
iconTex.Header.Height, 4);
} catch (Exception ex)
{
Log.Error(ex, "Failed loading item texture");
this.selectedItemTex?.Dispose();
this.selectedItemTex = null;
}
if (ImGui.IsMouseDoubleClicked(0))
{
if (this.selectedItemTex != null){
OnItemChosen?.Invoke(this, this.searchTask.Result[i]);
if (this.closeOnChoose)
{
this.selectedItemTex?.Dispose();
isOpen = false;
}
}
}
}
}
}
}
else
{
ImGui.TextColored(new Vector4(0.86f, 0.86f, 0.86f, 1.00f), Loc.Localize("DalamudItemSelectHint", "Type to start searching..."));
this.selectedItemIndex = -1;
this.selectedItemTex?.Dispose();
this.selectedItemTex = null;
}
} else {
ImGui.TextColored(new Vector4(0.86f, 0.86f, 0.86f, 1.00f), Loc.Localize("DalamudItemSelectLoading", "Loading item list..."));
}
ImGui.PopStyleVar();
ImGui.EndChild();
// Darken choose button if it shouldn't be clickable
ImGui.PushStyleVar(ImGuiStyleVar.Alpha, this.selectedItemIndex < 0 || this.selectedItemTex == null ? 0.25f : 1);
if (ImGui.Button(Loc.Localize("Choose", "Choose"))) {
try {
if (this.selectedItemTex != null) {
OnItemChosen?.Invoke(this, this.searchTask.Result[this.selectedItemIndex]);
if (this.closeOnChoose) {
this.selectedItemTex?.Dispose();
isOpen = false;
}
}
} catch (Exception ex) {
Log.Error($"Exception in Choose: {ex.Message}");
}
}
ImGui.PopStyleVar();
if (!this.closeOnChoose) {
ImGui.SameLine();
if (ImGui.Button(Loc.Localize("Close", "Close")))
{
this.selectedItemTex?.Dispose();
isOpen = false;
}
}
if (this.selectedItemIndex >= 0 && this.selectedItemTex == null) {
ImGui.SameLine();
ImGui.Text(Loc.Localize("DalamudItemNotLinkable", "This item is not linkable."));
}
ImGui.End();
return isOpen;
}
public void Dispose() {
this.selectedItemTex?.Dispose();
}
}
}

View file

@ -70,7 +70,7 @@ namespace Dalamud
return await Get($"market/item/{itemId}?dc={dcName}", true);
}
public static async Task<JObject> GetItem(int itemId) {
public static async Task<JObject> GetItem(uint itemId) {
return await Get($"Item/{itemId}", true);
}