mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
refactor: remove IconReplacer, now a separate plugin
This commit is contained in:
parent
8a303d1c1c
commit
788bc06833
7 changed files with 9 additions and 1431 deletions
|
|
@ -1,184 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace XIVLauncher.Dalamud
|
||||
{
|
||||
|
||||
//CURRENT HIGHEST FLAG IS 46
|
||||
[Flags]
|
||||
public enum CustomComboPreset : long
|
||||
{
|
||||
None = 0,
|
||||
|
||||
// DRAGOON
|
||||
[CustomComboInfo("Jump + Mirage Dive", "Replace Jump with Mirage Dive when Dive Ready", 22)]
|
||||
DragoonJumpFeature = 1L << 44,
|
||||
|
||||
[CustomComboInfo("BOTD Into Stardiver", "Replace Blood of the Dragon with Stardiver when in Life of the Dragon", 22)]
|
||||
DragoonBOTDFeature = 1L << 46,
|
||||
|
||||
[CustomComboInfo("Coerthan Torment Combo", "Replace Coerthan Torment with its combo chain", 22)]
|
||||
DragoonCoerthanTormentCombo = 1L << 0,
|
||||
|
||||
[CustomComboInfo("Chaos Thrust Combo", "Replace Chaos Thrust with its combo chain", 22)]
|
||||
DragoonChaosThrustCombo = 1L << 1,
|
||||
|
||||
[CustomComboInfo("Full Thrust Combo", "Replace Full Thrust with its combo chain", 22)]
|
||||
DragoonFullThrustCombo = 1L << 2,
|
||||
|
||||
// DARK KNIGHT
|
||||
[CustomComboInfo("Souleater Combo", "Replace Souleater with its combo chain", 32)]
|
||||
DarkSouleaterCombo = 1L << 3,
|
||||
|
||||
[CustomComboInfo("Stalwart Soul Combo", "Replace Stalwart Soul with its combo chain", 32)]
|
||||
DarkStalwartSoulCombo = 1L << 4,
|
||||
|
||||
// PALADIN
|
||||
[CustomComboInfo("Goring Blade Combo", "Replace Goring Blade with its combo chain", 19)]
|
||||
PaladinGoringBladeCombo = 1L << 5,
|
||||
|
||||
[CustomComboInfo("Royal Authority Combo", "Replace Royal Authority with its combo chain", 19)]
|
||||
PaladinRoyalAuthorityCombo = 1L << 6,
|
||||
|
||||
[CustomComboInfo("Prominence Combo", "Replace Prominence with its combo chain", 19)]
|
||||
PaladinProminenceCombo = 1L << 7,
|
||||
|
||||
// WARRIOR
|
||||
[CustomComboInfo("Storms Path Combo", "Replace Storms Path with its combo chain", 21)]
|
||||
WarriorStormsPathCombo = 1L << 8,
|
||||
|
||||
[CustomComboInfo("Storms Eye Combo", "Replace Storms Eye with its combo chain", 21)]
|
||||
WarriorStormsEyeCombo = 1L << 9,
|
||||
|
||||
[CustomComboInfo("Mythril Tempest Combo", "Replace Mythril Tempest with its combo chain", 21)]
|
||||
WarriorMythrilTempestCombo = 1L << 10,
|
||||
|
||||
// SAMURAI
|
||||
[CustomComboInfo("Yukikaze Combo", "Replace Yukikaze with its combo chain", 34)]
|
||||
SamuraiYukikazeCombo = 1L << 11,
|
||||
|
||||
[CustomComboInfo("Gekko Combo", "Replace Gekko with its combo chain", 34)]
|
||||
SamuraiGekkoCombo = 1L << 12,
|
||||
|
||||
[CustomComboInfo("Kasha Combo", "Replace Kasha with its combo chain", 34)]
|
||||
SamuraiKashaCombo = 1L << 13,
|
||||
|
||||
[CustomComboInfo("Mangetsu Combo", "Replace Mangetsu with its combo chain", 34)]
|
||||
SamuraiMangetsuCombo = 1L << 14,
|
||||
|
||||
[CustomComboInfo("Oka Combo", "Replace Oka with its combo chain", 34)]
|
||||
SamuraiOkaCombo = 1L << 15,
|
||||
|
||||
|
||||
// NINJA
|
||||
[CustomComboInfo("Armor Crush Combo", "Replace Armor Crush with its combo chain", 30)]
|
||||
NinjaArmorCrushCombo = 1L << 17,
|
||||
|
||||
[CustomComboInfo("Aeolian Edge Combo", "Replace Aeolian Edge with its combo chain", 30)]
|
||||
NinjaAeolianEdgeCombo = 1L << 18,
|
||||
|
||||
[CustomComboInfo("Hakke Mujinsatsu Combo", "Replace Hakke Mujinsatsu with its combo chain", 30)]
|
||||
NinjaHakkeMujinsatsuCombo = 1L << 19,
|
||||
|
||||
[CustomComboInfo("Dream to Assassinate", "Replace Dream Within a Dream with Assassinate when Assassinate Ready", 30)]
|
||||
NinjaAssassinateFeature = 1L << 45,
|
||||
|
||||
// GUNBREAKER
|
||||
[CustomComboInfo("Solid Barrel Combo", "Replace Solid Barrel with its combo chain", 37)]
|
||||
GunbreakerSolidBarrelCombo = 1L << 20,
|
||||
|
||||
[CustomComboInfo("Gnashing Fang Combo", "Replace Wicked Talon with its combo chain", 37)]
|
||||
GunbreakerGnashingFangCombo = 1L << 21,
|
||||
|
||||
[CustomComboInfo("Demon Slaughter Combo", "Replace Demon Slaughter with its combo chain", 37)]
|
||||
GunbreakerDemonSlaughterCombo = 1L << 22,
|
||||
|
||||
// MACHINIST
|
||||
[CustomComboInfo("(Heated) Shot Combo", "Replace UNHEATED Split Shot with its combo chain or with Heat Blast when overheated.", 31)]
|
||||
MachinistMainCombo = 1L << 23,
|
||||
|
||||
[CustomComboInfo("Spread Shot Heat", "Replace Spread Shot with Auto Crossbow when overheated.", 31)]
|
||||
MachinistSpreadShotFeature = 1L << 24,
|
||||
|
||||
// BLACK MAGE
|
||||
[CustomComboInfo("Enochian Stance Switcher", "Change Enochian to Fire 4 or Blizzard 4 depending on stance.", 25)]
|
||||
BlackEnochianFeature = 1L << 25,
|
||||
|
||||
[CustomComboInfo("Umbral Soul/Transpose Switcher", "Change between Umbral Soul and Transpose automatically.", 25)]
|
||||
BlackManaFeature = 1L << 26,
|
||||
|
||||
// ASTROLOGIAN
|
||||
[CustomComboInfo("Draw on Play", "Play turns into Draw when no card is drawn, as well as the usual Play behavior.", 33)]
|
||||
AstrologianCardsOnDrawFeature = 1L << 27,
|
||||
|
||||
// SUMMONER
|
||||
[CustomComboInfo("Demi-summon combiners", "Dreadwyrm Trance, Summon Bahamut, and Firebird Trance are now one button. Deathflare, Enkindle Bahamut, and Enkindle Phoenix are now one button.", 27)]
|
||||
SummonerDemiCombo = 1L << 28,
|
||||
|
||||
[CustomComboInfo("Brand of Purgatory Combo", "Replaces Fountain of Fire with Brand of Purgatory when under the affect of Hellish Conduit.", 27)]
|
||||
SummonerBoPCombo = 1L << 38,
|
||||
|
||||
[CustomComboInfo("ED Fester", "Change Fester into Energy Drain when out of Aetherflow stacks.", 27)]
|
||||
SummonerEDFesterCombo = 1L << 39,
|
||||
|
||||
[CustomComboInfo("ES Painflare", "Change Painflare into Energy Syphon when out of Aetherflow stacks.", 27)]
|
||||
SummonerESPainflareCombo = 1L << 40,
|
||||
|
||||
[CustomComboInfo("DWT", "DWT.", 27)]
|
||||
SummonerDwtCombo = 1L << 50,
|
||||
|
||||
// SCHOLAR
|
||||
[CustomComboInfo("Seraph Fey Blessing/Consolation", "Change Fey Blessing into Consolation when Seraph is out.", 28)]
|
||||
ScholarSeraphConsolationFeature = 1L << 29,
|
||||
|
||||
[CustomComboInfo("ED Aetherflow", "Change Energy Drain into Aetherflow when you have no more Aetherflow stacks.", 28)]
|
||||
ScholarEnergyDrainFeature = 1L << 37,
|
||||
|
||||
// DANCER
|
||||
[CustomComboInfo("AoE GCD procs", "Replaces all AoE GCDs with their procced version when available.", 38)]
|
||||
DancerAoeGcdFeature = 1L << 32,
|
||||
|
||||
[CustomComboInfo("Fan Dance Combos", "Change Fan Dance and Fan Dance 2 into Fan Dance 3 while flourishing.", 38)]
|
||||
DancerFanDanceCombo = 1L << 33,
|
||||
|
||||
// WHITE MAGE
|
||||
[CustomComboInfo("Solace into Misery", "Replaces Afflatus Solace with Afflatus Misery when Misery is ready to be used.", 24)]
|
||||
WhiteMageSolaceMiseryFeature = 1L << 35,
|
||||
|
||||
[CustomComboInfo("Rapture into Misery", "Replaces Afflatus Rapture with Afflatus Misery when Misery is ready to be used.", 24)]
|
||||
WhiteMageRaptureMiseryFeature = 1L << 36,
|
||||
|
||||
// BARD
|
||||
[CustomComboInfo("Wanderer's into Pitch Perfect", "Replaces Wanderer's Minuet with Pitch Perfect while in WM.", 23)]
|
||||
BardWandererPPFeature = 1L << 41,
|
||||
|
||||
[CustomComboInfo("Heavy Shot into Straight Shot", "Replaces Heavy Shot/Burst Shot with Straight Shot/Refulgent Arrow when procced.", 23)]
|
||||
BardStraightShotUpgradeFeature = 1L << 42,
|
||||
|
||||
// MONK
|
||||
|
||||
// RED MAGE
|
||||
[CustomComboInfo("Red Mage AoE Combo", "Replaces Veraero/thunder 2 with Impact when Dualcast or Swiftcast are active.", 35)]
|
||||
RedMageAoECombo = 1L << 48,
|
||||
|
||||
[CustomComboInfo("Redoublement combo", "Replaces Redoublement with its combo chain, following enchantment rules.", 35)]
|
||||
RedMageMeleeCombo = 1L << 49
|
||||
}
|
||||
|
||||
public class CustomComboInfoAttribute : Attribute
|
||||
{
|
||||
internal CustomComboInfoAttribute(string fancyName, string description, byte classJob)
|
||||
{
|
||||
FancyName = fancyName;
|
||||
Description = description;
|
||||
ClassJob = classJob;
|
||||
}
|
||||
|
||||
public string FancyName { get; }
|
||||
public string Description { get; }
|
||||
public byte ClassJob { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,6 @@ using System.IO;
|
|||
using Dalamud.Configuration;
|
||||
using Dalamud.DiscordBot;
|
||||
using Newtonsoft.Json;
|
||||
using XIVLauncher.Dalamud;
|
||||
|
||||
namespace Dalamud
|
||||
{
|
||||
|
|
@ -15,8 +14,6 @@ namespace Dalamud
|
|||
|
||||
public bool OptOutMbCollection { get; set; } = false;
|
||||
|
||||
public CustomComboPreset ComboPresets { get; set; }
|
||||
|
||||
public List<string> BadWords { get; set; }
|
||||
|
||||
public enum PreferredRole
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ using Dalamud.Game.Internal.Gui;
|
|||
using Dalamud.Game.Network;
|
||||
using Dalamud.Plugin;
|
||||
using Serilog;
|
||||
using XIVLauncher.Dalamud;
|
||||
|
||||
namespace Dalamud {
|
||||
public sealed class Dalamud : IDisposable {
|
||||
|
|
@ -26,7 +25,8 @@ namespace Dalamud {
|
|||
|
||||
private readonly ManualResetEvent unloadSignal;
|
||||
|
||||
private readonly ProcessModule targetModule;
|
||||
public readonly ProcessModule TargetModule;
|
||||
|
||||
private readonly SigScanner sigScanner;
|
||||
|
||||
public Framework Framework { get; }
|
||||
|
|
@ -43,8 +43,6 @@ namespace Dalamud {
|
|||
|
||||
public readonly DalamudStartInfo StartInfo;
|
||||
|
||||
public readonly IconReplacer IconReplacer;
|
||||
|
||||
public readonly DalamudConfiguration Configuration;
|
||||
|
||||
internal readonly WinSockHandlers WinSock2;
|
||||
|
|
@ -58,8 +56,8 @@ namespace Dalamud {
|
|||
this.unloadSignal = new ManualResetEvent(false);
|
||||
|
||||
// Initialize the process information.
|
||||
this.targetModule = Process.GetCurrentProcess().MainModule;
|
||||
this.sigScanner = new SigScanner(this.targetModule);
|
||||
this.TargetModule = Process.GetCurrentProcess().MainModule;
|
||||
this.sigScanner = new SigScanner(this.TargetModule);
|
||||
|
||||
// Initialize game subsystem
|
||||
Framework = new Framework(this.sigScanner, this);
|
||||
|
|
@ -71,14 +69,12 @@ namespace Dalamud {
|
|||
ChatHandlers = new ChatHandlers(this);
|
||||
NetworkHandlers = new NetworkHandlers(this, this.Configuration.OptOutMbCollection);
|
||||
|
||||
this.ClientState = new ClientState(this, info, this.sigScanner, this.targetModule);
|
||||
this.ClientState = new ClientState(this, info, this.sigScanner, this.TargetModule);
|
||||
|
||||
this.BotManager = new DiscordBotManager(this, this.Configuration.DiscordFeatureConfig);
|
||||
|
||||
this.PluginManager = new PluginManager(this, info.PluginDirectory, info.DefaultPluginDirectory);
|
||||
|
||||
this.IconReplacer = new IconReplacer(this, this.sigScanner);
|
||||
|
||||
this.WinSock2 = new WinSockHandlers();
|
||||
|
||||
try {
|
||||
|
|
@ -94,9 +90,6 @@ namespace Dalamud {
|
|||
Framework.Enable();
|
||||
|
||||
this.BotManager.Start();
|
||||
|
||||
if (this.Configuration.ComboPresets != CustomComboPreset.None)
|
||||
this.IconReplacer.Enable();
|
||||
}
|
||||
|
||||
public void Unload() {
|
||||
|
|
@ -115,9 +108,6 @@ namespace Dalamud {
|
|||
this.unloadSignal.Dispose();
|
||||
|
||||
this.WinSock2.Dispose();
|
||||
|
||||
if (this.Configuration.ComboPresets != CustomComboPreset.None)
|
||||
this.IconReplacer.Dispose();
|
||||
}
|
||||
|
||||
private void SetupCommands() {
|
||||
|
|
@ -136,11 +126,6 @@ namespace Dalamud {
|
|||
ShowInHelp = false
|
||||
});
|
||||
|
||||
CommandManager.AddHandler("/xldcombo", new CommandInfo(OnCommandDebugCombo) {
|
||||
HelpMessage = "COMBO debug",
|
||||
ShowInHelp = false
|
||||
});
|
||||
|
||||
CommandManager.AddHandler("/xlhelp", new CommandInfo(OnHelpCommand) {
|
||||
HelpMessage = "Shows list of commands available."
|
||||
});
|
||||
|
|
@ -307,74 +292,6 @@ namespace Dalamud {
|
|||
$"Level: {chara.Level} ClassJob: {chara.ClassJob.Name} CHP: {chara.CurrentHp} MHP: {chara.MaxHp} CMP: {chara.CurrentMp} MMP: {chara.MaxMp}");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnCommandDebugCombo(string command, string arguments) {
|
||||
var argumentsParts = arguments.Split();
|
||||
|
||||
switch (argumentsParts[0]) {
|
||||
case "setall": {
|
||||
foreach (var value in Enum.GetValues(typeof(CustomComboPreset)).Cast<CustomComboPreset>()) {
|
||||
if (value == CustomComboPreset.None)
|
||||
continue;
|
||||
|
||||
this.Configuration.ComboPresets |= value;
|
||||
}
|
||||
|
||||
Framework.Gui.Chat.Print("all SET");
|
||||
}
|
||||
break;
|
||||
case "unsetall": {
|
||||
foreach (var value in Enum.GetValues(typeof(CustomComboPreset)).Cast<CustomComboPreset>()) {
|
||||
this.Configuration.ComboPresets &= value;
|
||||
}
|
||||
|
||||
Framework.Gui.Chat.Print("all UNSET");
|
||||
}
|
||||
break;
|
||||
case "set": {
|
||||
foreach (var value in Enum.GetValues(typeof(CustomComboPreset)).Cast<CustomComboPreset>()) {
|
||||
if (value.ToString().ToLower() != argumentsParts[1].ToLower())
|
||||
continue;
|
||||
|
||||
this.Configuration.ComboPresets |= value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "toggle": {
|
||||
foreach (var value in Enum.GetValues(typeof(CustomComboPreset)).Cast<CustomComboPreset>()) {
|
||||
if (value.ToString().ToLower() != argumentsParts[1].ToLower())
|
||||
continue;
|
||||
|
||||
this.Configuration.ComboPresets ^= value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "unset": {
|
||||
foreach (var value in Enum.GetValues(typeof(CustomComboPreset)).Cast<CustomComboPreset>()) {
|
||||
if (value.ToString().ToLower() != argumentsParts[1].ToLower())
|
||||
continue;
|
||||
|
||||
this.Configuration.ComboPresets &= ~value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "list": {
|
||||
foreach (var value in Enum.GetValues(typeof(CustomComboPreset)).Cast<CustomComboPreset>()) {
|
||||
if (this.Configuration.ComboPresets.HasFlag(value))
|
||||
Framework.Gui.Chat.Print(value.ToString());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default: Framework.Gui.Chat.Print("Unknown");
|
||||
break;
|
||||
}
|
||||
|
||||
this.Configuration.Save(this.StartInfo.ConfigurationPath);
|
||||
}
|
||||
|
||||
private void OnBotJoinCommand(string command, string arguments) {
|
||||
if (this.BotManager != null && this.BotManager.IsConnected)
|
||||
Process.Start(
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,20 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Dalamud.Game.Internal.Gui {
|
||||
class IconReplacerAddressResolver : BaseAddressResolver {
|
||||
public IntPtr GetIcon { get; private set; }
|
||||
public IntPtr IsIconReplaceable { get; private set; }
|
||||
|
||||
protected override void Setup64Bit(SigScanner sig) {
|
||||
this.GetIcon = sig.ScanText("48 89 5c 24 08 48 89 6c 24 10 48 89 74 24 18 57 48 83 ec 30 8b da be dd 1c 00 00 bd d3 0d 00 00");
|
||||
//this.GetIcon = sig.ScanText("E8 ?? ?? ?? ?? F6 DB 8B C8");
|
||||
|
||||
this.IsIconReplaceable = sig.ScanText("81 f9 2e 01 00 00 7f 39 81 f9 2d 01 00 00 0f 8d 11 02 00 00 83 c1 eb");
|
||||
//this.IsIconReplaceable = sig.ScanText("81 F9 ?? ?? ?? ?? 7F 39 81 F9 ?? ?? ?? ??");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,6 @@ using Serilog;
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using XIVLauncher.Dalamud;
|
||||
|
||||
namespace Dalamud.Game.Internal.Gui {
|
||||
public class TargetManager {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using System.Runtime.InteropServices;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Dalamud.Configuration;
|
||||
using Dalamud.Game;
|
||||
using Dalamud.Game.ClientState;
|
||||
using Dalamud.Game.Command;
|
||||
using Dalamud.Game.Internal;
|
||||
|
|
@ -32,6 +33,8 @@ namespace Dalamud.Plugin
|
|||
/// </summary>
|
||||
public readonly Framework Framework;
|
||||
|
||||
public readonly SigScanner TargetModuleScanner;
|
||||
|
||||
private readonly Dalamud dalamud;
|
||||
private readonly string pluginName;
|
||||
|
||||
|
|
@ -43,6 +46,7 @@ namespace Dalamud.Plugin
|
|||
this.CommandManager = dalamud.CommandManager;
|
||||
this.Framework = dalamud.Framework;
|
||||
this.ClientState = dalamud.ClientState;
|
||||
this.TargetModuleScanner = new SigScanner(dalamud.TargetModule);
|
||||
|
||||
this.dalamud = dalamud;
|
||||
this.pluginName = pluginName;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue