Ejemplo n.º 1
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            Version           = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            PluginInterface   = pluginInterface;
            this.PluginConfig = (ItemSearchPluginConfig)pluginInterface.GetPluginConfig() ?? new ItemSearchPluginConfig();

            ItemSearchPlugin.DataSites = new DataSite[] {
                new GarlandToolsDataSite(),
                new TeamcraftDataSite(PluginConfig),
                new GamerEscapeDatasite(),
            };

            this.PluginConfig.Init(pluginInterface, this);


            SetupGameFunctions();

            ReloadLocalization();

            FittingRoomUI = new FittingRoomUI(this);

            CraftingRecipeFinder = new CraftingRecipeFinder(this);

            PluginInterface.UiBuilder.OnBuildUi += this.BuildUI;
            SetupCommands();

#if DEBUG
            OnItemSearchCommand("", "");
#endif
        }
Ejemplo n.º 2
0
        public unsafe void Initialize(DalamudPluginInterface pluginInterface)
        {
            Interface = pluginInterface;

            Configuration = pluginInterface.GetPluginConfig() as JobIconsConfiguration ?? new JobIconsConfiguration();

            Address = new PluginAddressResolver();
            Address.Setup(pluginInterface.TargetModuleScanner);

            XivApi.Initialize(Interface, Address);
            IconSet.Initialize(this);

            SetNamePlateHook = new Hook <SetNamePlateDelegate>(Address.AddonNamePlate_SetNamePlatePtr, new SetNamePlateDelegate(SetNamePlateDetour), this);
            SetNamePlateHook.Enable();

            EmptySeStringPtr = XivApi.StringToSeStringPtr("");

            var commandInfo = new CommandInfo(CommandHandler)
            {
                HelpMessage = "Opens Job Icons config.",
                ShowInHelp  = true
            };

            Interface.CommandManager.AddHandler(Command1, commandInfo);
            Interface.CommandManager.AddHandler(Command2, commandInfo);

            Task.Run(() => FixNamePlates(FixNonPlayerCharacterNamePlatesTokenSource.Token));

            PluginGui = new JobIconsGui(this);
        }
Ejemplo n.º 3
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            HTTPAction.pluginInterface = pluginInterface;
            Configuration = pluginInterface.GetPluginConfig() as HTTPActionConfiguration ?? new HTTPActionConfiguration();
            try {
                //var macroCallPtr = pluginInterface.TargetModuleScanner.ScanText("E8 ?? ?? ?? ?? E9 ?? ?? ?? ?? 48 8D 4D 20 49 8B D6");
                var macroCallPtr = pluginInterface.TargetModuleScanner.ScanText("40 53 56 57 48 83 EC 70 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 60 48 8B 02 49 8B F0");
                //var macroBasePtr = pluginInterface.TargetModuleScanner.GetStaticAddressFromSig("48 8B 05 ?? ?? ?? ?? 48 8B D9 8B 40 14 85 C0");
                macroBasePtr = Marshal.ReadIntPtr(pluginInterface.TargetModuleScanner.Module.BaseAddress + 0x1BDFEF0);
                macroBasePtr = Marshal.ReadIntPtr(macroBasePtr);
                //PluginLog.Log($"macroBasePtrC={macroBasePtr}");
                macroCallHook = new Hook <MacroCallDelegate>(macroCallPtr, new MacroCallDelegate(MacroCallDetour));
                macroCallHook?.Enable();

                pluginInterface.CommandManager.AddHandler("/macrohttp", new Dalamud.Game.Command.CommandInfo(OnMacroCommandHandler)
                {
                    HelpMessage = "Send and Execute a Macro By HTTP Requests",
                    ShowInHelp  = true
                });
                InitMem();
                hwnd = Process.GetCurrentProcess().MainWindowHandle;
                Port = Configuration.Port;
                //PluginLog.LogError($"HTTP server Started on http://localhost:{Port}!");
                OnStartServer();
            }
            catch (Exception ex) {
                PluginLog.LogError(ex.ToString());
            }
        }
Ejemplo n.º 4
0
        public void Initialize(DalamudPluginInterface pI)
        {
            this.pluginInterface = pI;
            Configuration        = pluginInterface.GetPluginConfig() as Config ?? new Config();

            ring      = Configuration.Ring;
            thickness = Configuration.Thickness;
            col_ring  = Configuration.Col_Ring;
            segments  = Configuration.Segments;
            radius    = Configuration.Radius;

            enabled  = Configuration.Enabled;
            combat   = Configuration.Combat;
            circle   = Configuration.Circle;
            instance = Configuration.Instance;
            col      = Configuration.Col;
            col2     = Configuration.Col2;


            this.pluginInterface.UiBuilder.OnBuildUi      += DrawWindow;
            this.pluginInterface.UiBuilder.OnOpenConfigUi += ConfigWindow;
            this.pluginInterface.CommandManager.AddHandler("/pp", new CommandInfo(Command)
            {
                HelpMessage = "Pixel Perfect config."
            });
        }
Ejemplo n.º 5
0
 public void Initialize(DalamudPluginInterface pluginInterface)
 {
     pi            = pluginInterface;
     configuration = pluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
     configuration.Initialize(pi);
     pi.Framework.OnUpdateEvent  += HandleFrameworkUpdate;
     pi.UiBuilder.OnOpenConfigUi += OnGuiOpen;
 }
Ejemplo n.º 6
0
        //private SeString nowPlayingString;
        //private TextPayload currentSongPayload;

        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.pi = pluginInterface;

            this.configuration = pluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
            this.configuration.Initialize(pluginInterface);
            this.enableFallbackPlayer = this.configuration.UseOldPlayback;

            this.localDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            var songlistPath = Path.Combine(this.localDir, songListFile);

            this.songList = new SongList(songlistPath, this.configuration, this, this);

            // TODO: eventually it might be nice to do this only if the fallback player isn't being used
            // and to add/remove it on-demand if that changes
            var addressResolver = new AddressResolver();

            try
            {
                addressResolver.Setup(pluginInterface.TargetModuleScanner);
                this.bgmControl = new BGMControl(addressResolver);
                this.bgmControl.OnSongChanged  += HandleSongChanged;
                this.bgmControl.OnSongChanged2 += HandleSongChanged2;
                this.bgmControl.StartUpdate();
            }
            catch (Exception e)
            {
                PluginLog.LogError(e, "Failed to find BGM playback objects");
                this.bgmControl?.Dispose();
                this.bgmControl = null;

                this.enableFallbackPlayer = true;
            }

            // TODO: for new payload system
            // cached string so we don't have to rebuild this entire payload set each time
            //this.currentSongPayload = new TextPayload("");           // dummy, filled in when needed
            //this.nowPlayingString = new SeString(new Payload[] {
            //    new TextPayload("Now playing "),
            //    EmphasisItalicPayload.ItalicsOn,
            //    this.currentSongPayload,
            //    EmphasisItalicPayload.ItalicsOff,
            //    new TextPayload(".")
            //});

            // caches all the payloads - future updates will only have to reencode the song name payload
            // this.nowPlayingString.Encode();

            pluginInterface.CommandManager.AddHandler(commandName, new CommandInfo(OnDisplayCommand)
            {
                HelpMessage = "Displays the orchestrion player, to view, change, or stop in-game BGM."
            });
            pluginInterface.UiBuilder.OnBuildUi += Display;

            pluginInterface.UiBuilder.OnOpenConfigUi += (sender, args) => this.songList.SettingsVisible = true;
            this.songReplacementCfg = new SongReplacementList(this);
        }
Ejemplo n.º 7
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            _pi = pluginInterface;

            Config = pluginInterface.GetPluginConfig() as OwoPluginConfig ?? new OwoPluginConfig();

            _pi.UiBuilder.OnBuildUi      += UiBuilder_OnBuildUi;
            _pi.UiBuilder.OnOpenConfigUi += (sender, args) => _isMainConfigWindowDrawing = true;

            pluginInterface.Framework.Gui.Chat.OnChatMessage += Chat_OnChatMessage;
        }
Ejemplo n.º 8
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            _pi = pluginInterface;

            this.config = (Configuration)_pi.GetPluginConfig() ?? new Configuration();
            this.config.Initialize(_pi);

            pluginInterface.Framework.Gui.Chat.OnChatMessage += Chat_OnChatMessage;

            this.commandManager = new PluginCommandManager <OwoPlugin>(this, _pi);
        }
Ejemplo n.º 9
0
        public Plugin(
            [RequiredVersion("1.0")] DalamudPluginInterface pluginInterface,
            [RequiredVersion("1.0")] CommandManager commandManager,
            ClientState clientState,
            SigScanner sigScanner,
            ChatGui chatGui)
        {
            PluginInterface = pluginInterface;
            CommandManager  = commandManager;

            Configuration = PluginInterface.GetPluginConfig() as Configuration ?? new Configuration();

            Interface = new Interface();

            Commands.Add((s, t) => Interface.Show(), "/customize", "Opens the customize plus window");

            PluginInterface.UiBuilder.Draw         += Interface.Draw;
            PluginInterface.UiBuilder.OpenConfigUi += Interface.Show;

            this.clientState = clientState;

            try
            {
                // "Render::Manager::Render"
                renderManagerHook = new Hook <RenderDelegate>(sigScanner.ScanText("40 53 55 57 41 56 41 57 48 83 EC 60"), manager =>
                {
                    // if this gets disposed while running we crash calling Original's getter, so get it at start
                    var original = renderManagerHook.Original;
                    try
                    {
                        if (!updateFailed)
                        {
                            Update();
                        }
                    }
                    catch (Exception e)
                    {
                        chatGui.PrintError("Failed to run CustomizePlus render hook, disabling.");
                        PluginLog.Error($"Error in CustomizePlus render hook {e}");

                        updateFailed = true;
                    }

                    return(original(manager));
                });
                // Because scales all get set to 0 below, the character will be very messed up
                renderManagerHook.Enable();
            }
            catch (Exception e)
            {
                PluginLog.Error($"Failed to hook Render::Manager::Render {e}");
            }
        }
Ejemplo n.º 10
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            PluginInterface     = pluginInterface;
            PluginConfiguration = pluginInterface.GetPluginConfig() as VisibilityConfiguration ?? new VisibilityConfiguration();
            PluginConfiguration.Init(this, pluginInterface);

            PluginInterface.CommandManager.AddHandler(PluginCommandName, new CommandInfo(PluginCommand)
            {
                HelpMessage = $"Shows the config for the visibility plugin.\nAdditional help available via '{PluginCommandName} help'",
                ShowInHelp  = true
            });

            PluginInterface.CommandManager.AddHandler(VoidCommandName, new CommandInfo(VoidPlayer)
            {
                HelpMessage = $"Adds player to void list.\nUsage: {VoidCommandName} <charactername> <worldname> <reason>",
                ShowInHelp  = true
            });

            PluginInterface.CommandManager.AddHandler(VoidTargetCommandName, new CommandInfo(VoidTargetPlayer)
            {
                HelpMessage = $"Adds targeted player to void list.\nUsage: {VoidTargetCommandName} <reason>",
                ShowInHelp  = true
            });

            PluginInterface.CommandManager.AddHandler(WhitelistCommandName, new CommandInfo(WhitelistPlayer)
            {
                HelpMessage = $"Adds player to whitelist.\nUsage: {WhitelistCommandName} <charactername> <worldname>",
                ShowInHelp  = true
            });

            PluginInterface.CommandManager.AddHandler(WhitelistTargetCommandName, new CommandInfo(WhitelistTargetPlayer)
            {
                HelpMessage = $"Adds targeted player to whitelist.\nUsage: {WhitelistTargetCommandName}",
                ShowInHelp  = true
            });

            _characterDrawResolver = new CharacterDrawResolver();
            _characterDrawResolver.Init(pluginInterface, PluginConfiguration);

            Common            = new XivCommonBase(PluginInterface, Hooks.ContextMenu);
            PluginContextMenu = new ContextMenu(this);

            if (PluginConfiguration.EnableContextMenu)
            {
                PluginContextMenu.Toggle();
            }

            PluginInterface.Framework.OnUpdateEvent          += FrameworkOnOnUpdateEvent;
            PluginInterface.UiBuilder.OnBuildUi              += BuildUi;
            PluginInterface.UiBuilder.OnOpenConfigUi         += OpenConfigUi;
            PluginInterface.Framework.Gui.Chat.OnChatMessage += OnChatMessage;
        }
Ejemplo n.º 11
0
        public unsafe void Initialize(DalamudPluginInterface pluginInterface)
        {
            setNamePlatePtr = pluginInterface.TargetModuleScanner.ScanText("48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 54 41 56 41 57 48 83 EC 40 44 0F B6 E2");
            setNamePlate    = new SetNamePlate(setNamePlateFunc);
            try
            { setNamePlateHook = new Hook <SetNamePlate>(setNamePlatePtr, setNamePlate, this); setNamePlateHook.Enable(); }
            catch (Exception e)
            { PluginLog.Log("BAD 1\n" + e.ToString()); }


            scaleIconPtr = pluginInterface.TargetModuleScanner.ScanText("8B 81 ?? ?? ?? ?? A8 01 75 ?? F3 0F 10 41 ?? 0F 2E C1 7A ?? 75 ?? F3 0F 10 41 ?? 0F 2E C2 7A ?? 74 ?? 83 C8 01 89 81 ?? ?? ?? ?? F3 0F 10 05 ?? ?? ?? ??");
            scaleIcon    = Marshal.GetDelegateForFunctionPointer <scaleIconFunc>(scaleIconPtr);

            var GetBaseUIObject = pluginInterface.TargetModuleScanner.ScanText("E8 ?? ?? ?? ?? 41 b8 01 00 00 00 48 8d 15 ?? ?? ?? ?? 48 8b 48 20 e8 ?? ?? ?? ?? 48 8b cf");
            var GetUI2ObjByName = pluginInterface.TargetModuleScanner.ScanText("e8 ?? ?? ?? ?? 48 8b cf 48 89 87 ?? ?? 00 00 e8 ?? ?? ?? ?? 41 b8 01 00 00 00");

            getBaseUIObj    = Marshal.GetDelegateForFunctionPointer <GetBaseUIObjDelegate>(GetBaseUIObject);
            getUI2ObjByName = Marshal.GetDelegateForFunctionPointer <GetUI2ObjByNameDelegate>(GetUI2ObjByName);

            this.pluginInterface = pluginInterface;
            Configuration        = pluginInterface.GetPluginConfig() as Config ?? new Config();

            role    = Configuration.Role;
            enabled = Configuration.Enabled;
            scaler  = Configuration.Scale;
            xAdjust = Configuration.XAdjust;
            yAdjust = Configuration.YAdjust;

            this.pluginInterface.CommandManager.AddHandler("/jicons", new CommandInfo(Command)
            {
                HelpMessage = "Opens Job Icons config."
            });

            baseUIObject     = getBaseUIObj();
            baseUiProperties = Marshal.ReadIntPtr(baseUIObject, 0x20);

            UIModulePtr      = Marshal.ReadIntPtr(pluginInterface.Framework.Address.BaseAddress, 0x29F8);
            UI3DModule       = Marshal.ReadIntPtr(UIModulePtr, 0xA62C0);
            RaptureAtkModule = (RaptureAtkModule *)(Marshal.ReadIntPtr(pluginInterface.Framework.Address.BaseAddress, 0x29F8) + 0xB3780).ToPointer();

            nameplateUIPtr = getUI2ObjByName(baseUiProperties, "NamePlate", 1);
            if (nameplateUIPtr != IntPtr.Zero)
            {
                npObjArray = ((AddonNamePlate *)nameplateUIPtr)->NamePlateObjectArray;
            }


            this.pluginInterface.UiBuilder.OnOpenConfigUi += ConfigWindow;
            this.pluginInterface.UiBuilder.OnBuildUi      += DrawWindow;
        }
Ejemplo n.º 12
0
        public void Initialize(DalamudPluginInterface pInterface)
        {
            pluginInterface = pInterface;

            config = (Configuration)pluginInterface.GetPluginConfig() ?? new Configuration();
            config.Initialize(pluginInterface);

            ui = new PluginUI(this, config);
            pluginInterface.UiBuilder.OnOpenConfigUi += ToggleConfig;
            pluginInterface.UiBuilder.OnBuildUi      += ui.Draw;
            pluginInterface.ClientState.OnLogin      += InitCommands;

            commandManager = new PluginCommandManager <QoLBar>(this, pluginInterface);
        }
Ejemplo n.º 13
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.pi = pluginInterface;

            var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), songListFile);

            this.songList = new SongList(path, this, customSongs);

            this.config      = pi.GetPluginConfig() as CustomSongConfiguration ?? new CustomSongConfiguration();
            this.customSongs = new CustomSongController(this.config, this.pi);

            pluginInterface.CommandManager.AddHandler(commandName, new CommandInfo(OnDisplayCommand));
            pluginInterface.UiBuilder.OnBuildUi += Display;
        }
Ejemplo n.º 14
0
 public void Initialize(DalamudPluginInterface pluginInterface)
 {
     Interface = pluginInterface;
     Scanner   = Interface.TargetModuleScanner;
     Config    = pluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
     Config.Initialize(pluginInterface);
     LoadOffset();
     Initialize();
     Interface.CommandManager.AddHandler("/xhouse", new CommandInfo(CommandHandler)
     {
         HelpMessage = "/xhouse - load housing item list."
     });
     Gui = new PluginUi(this);
     Interface.Framework.Network.OnNetworkMessage += OnNetwork;
 }
Ejemplo n.º 15
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.PluginInterface = pluginInterface;
            this.PluginConfig    = (FPSPluginConfig)pluginInterface.GetPluginConfig() ?? new FPSPluginConfig();
            this.PluginConfig.Init(this, pluginInterface);
            fpsText    = string.Empty;
            fpsHistory = new List <float>();

            fpsHistoryInterval = new Stopwatch();
            fpsHistoryInterval.Start();
            SetupCommands();
            PluginInterface.UiBuilder.OnBuildUi      += this.BuildUI;
            PluginInterface.UiBuilder.OnOpenConfigUi += OnConfigCommandHandler;
            PluginInterface.Framework.OnUpdateEvent  += OnFrameworkUpdate;
            PluginInterface.UiBuilder.OnBuildFonts   += this.BuildFont;
        }
Ejemplo n.º 16
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.pluginInterface = pluginInterface;
            Configuration        = pluginInterface.GetPluginConfig() as Config ?? new Config();
            voidList             = Configuration.VoidList;
            enabled = Configuration.Enabled;


            this.pluginInterface.CommandManager.AddHandler("/void", new CommandInfo(Command)
            {
                HelpMessage = "Shows the config for the VoidList."
            });

            this.pluginInterface.UiBuilder.OnBuildUi              += DrawWindow;
            this.pluginInterface.UiBuilder.OnOpenConfigUi         += ConfigWindow;
            this.pluginInterface.Framework.Gui.Chat.OnChatMessage += Chat_OnChatMessage;
        }
Ejemplo n.º 17
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.pluginInterface = pluginInterface;
            this.pluginInterface.CommandManager.AddHandler("/combo", new CommandInfo(OnCommandDebugCombo)
            {
                HelpMessage = "Open a window to edit custom combo settings.",
                ShowInHelp  = true
            });

            this.Configuration = pluginInterface.GetPluginConfig() as IconReplacerConfiguration ?? new IconReplacerConfiguration();

            this.iconReplacer = new IconReplacer(pluginInterface.TargetModuleScanner, pluginInterface.ClientState, this.Configuration);

            this.iconReplacer.Enable();

            this.pluginInterface.UiBuilder.OnBuildUi += UiBuilder_OnBuildUi;
        }
 public void Initialize(DalamudPluginInterface pluginInterface)
 {
     _pluginInterface = pluginInterface;
     _configuration   = _pluginInterface.GetPluginConfig() as Config ?? new Config();
     InitProfanityFilter();
     pluginInterface.Framework.Gui.Chat.OnChatMessage += ChatOnOnChatMessage;
     _pluginInterface.CommandManager.AddHandler("/profanity", new Dalamud.Game.Command.CommandInfo(ToggleFilter)
     {
         HelpMessage = "Toggle profanity filter."
     });
     _pluginInterface.CommandManager.AddHandler("/profanityconfig", new Dalamud.Game.Command.CommandInfo(OpenConfig)
     {
         HelpMessage = "Open profanity filter config."
     });
     _pluginInterface.UiBuilder.OnBuildUi      += DrawWindow;
     _pluginInterface.UiBuilder.OnOpenConfigUi += ToggleConfig;
 }
Ejemplo n.º 19
0
        public void Initialize(DalamudPluginInterface pi)
        {
            this.pi       = pi;
            Configuration = pi.GetPluginConfig() as Config ?? new Config();
            col           = Configuration.Col;
            no_move       = Configuration.NoMove;
            scale         = Configuration.Scale;
            enabled       = Configuration.Enabled;
            terr          = pi.Data.GetExcelSheet <TerritoryType>();

            this.pi.UiBuilder.OnBuildUi += DrawWindow;

            this.pi.CommandManager.AddHandler("/woldo", new Dalamud.Game.Command.CommandInfo(Command)
            {
                HelpMessage = "Where's WOLdo config."
            });
        }
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            _pi = pluginInterface;

            Config = pluginInterface.GetPluginConfig() as CharacterSyncConfig ?? new CharacterSyncConfig();

            _pi.UiBuilder.OnBuildUi      += UiBuilder_OnBuildUi;
            _pi.UiBuilder.OnOpenConfigUi += (sender, args) => _isMainConfigWindowDrawing = true;

            _pi.CommandManager.AddHandler("/pcharsync",
                                          new CommandInfo((string cmd, string args) => _isMainConfigWindowDrawing = true)
            {
                HelpMessage = "Open the Character Sync configuration."
            });

            this._createFileHook = new Hook <CreateFileWDelegate>(LocalHook.GetProcAddress("Kernel32", "CreateFileW"), new CreateFileWDelegate(CreateFileWDetour));
            this._createFileHook.Enable();
        }
Ejemplo n.º 21
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            Version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            this.PluginInterface = pluginInterface;
            this.PluginConfig    = (ItemSearchPluginConfig)pluginInterface.GetPluginConfig() ?? new ItemSearchPluginConfig();
            this.PluginConfig.Init(pluginInterface, this);

            ReloadLocalization();

            FittingRoomUI = new FittingRoomUI(this);

            PluginInterface.UiBuilder.OnBuildUi += this.BuildUI;
            SetupCommands();

#if DEBUG
            OnItemSearchCommand("", "");
#endif
        }
Ejemplo n.º 22
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            _pi     = pluginInterface;
            _config = (Config)_pi.GetPluginConfig() ?? new Config();
            _pi.SavePluginConfig(_config);

            _pi.CommandManager.AddHandler(CommandName, PluginCommand());

            _ui = new Ui(this, _pi, _config);

            _pi.UiBuilder.OnBuildUi      += _ui.BuildUi;
            _pi.UiBuilder.OnOpenConfigUi += _ui.OnOpenConfigUI;

            _watcher = new Watcher(_pi, _config.Items);

            _pi.Framework.OnUpdateEvent += _watcher.FrameworkUpdateEvent;

            PluginLog.Log($"{Name} loaded");
        }
Ejemplo n.º 23
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.pluginInterface = pluginInterface;

            this.pluginInterface.CommandManager.AddHandler("/ptitle", new CommandInfo(OnCommandDebugMouseover)
            {
                HelpMessage = "Open a window to set the title screen version.",
                ShowInHelp  = true
            });

            Configuration = pluginInterface.GetPluginConfig() as TitleEditConfiguration ?? new TitleEditConfiguration();

            titleEdit = new TitleEdit(pluginInterface.TargetModuleScanner, pluginInterface.ClientState, Configuration);

            titleEdit.Enable();
            SetNewConfig();

            this.pluginInterface.UiBuilder.OnBuildUi += UiBuilder_OnBuildUi;
        }
Ejemplo n.º 24
0
 public void Initialize(DalamudPluginInterface pluginInterface)
 {
     Interface      = pluginInterface;
     CommandManager = pluginInterface.CommandManager;
     Scanner        = Interface.TargetModuleScanner;
     Config         = pluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
     Config.Initialize(pluginInterface);
     Config.Grouping = false;
     Config.Save();
     _localizer = new Localizer(Config.UILanguage);
     // LoadOffset();
     Initialize();
     Interface.CommandManager.AddHandler("/xhouse", new CommandInfo(CommandHandler)
     {
         HelpMessage = "/xhouse - load housing item list."
     });
     Gui = new PluginUi(this);
     // Interface.Framework.Network.OnNetworkMessage += OnNetwork;
     Interface.ClientState.TerritoryChanged += TerritoryChanged;
 }
Ejemplo n.º 25
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            pi = pluginInterface;

            configuration = pi.GetPluginConfig() as Configuration ?? new Configuration();
            configuration.Initialize(pi);
            synthesizer = configuration.Synthesizer;

            // you might normally want to embed resources and load them from the manifest stream
            ui = new PluginUI(configuration);

            pi.CommandManager.AddHandler(CommandName, new CommandInfo(OnCommand)
            {
                HelpMessage = "Opens Settings"
            });

            pi.UiBuilder.OnBuildUi += DrawUI;

            pi.Framework.Gui.Chat.OnChatMessage += HandleChatMessage;
        }
Ejemplo n.º 26
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.pluginInterface = pluginInterface;
            Configuration        = pluginInterface.GetPluginConfig() as Config ?? new Config();
            enabled = Configuration.Enabled;


            this.pluginInterface.CommandManager.AddHandler("/spec", new CommandInfo(Command2)
            {
                HelpMessage = "Shows config for Single Player Experience."
            });

            this.pluginInterface.CommandManager.AddHandler("/spe", new CommandInfo(Command)
            {
                HelpMessage = "Toggles Single Player Experience."
            });

            this.pluginInterface.UiBuilder.OnBuildUi      += DrawWindow;
            this.pluginInterface.UiBuilder.OnOpenConfigUi += ConfigWindow;
        }
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            Pi = pluginInterface;

            TemplateLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            _configuration = Pi.GetPluginConfig() as Configuration ?? new Configuration();
            _configuration.Initialize(Pi);

            Pi.Framework.OnUpdateEvent += OnUpdate;

            _ui = new PluginUI(_configuration, pluginInterface);

            Pi.CommandManager.AddHandler(commandName, new CommandInfo(OnCommand)
            {
                HelpMessage = "Opens configuration for Kingdom Hearts UI Bars."
            });

            Pi.UiBuilder.OnBuildUi      += DrawUI;
            Pi.UiBuilder.OnOpenConfigUi += (sender, args) => DrawConfigUi();
        }
Ejemplo n.º 28
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.pluginInterface = pluginInterface;

            this.pluginInterface.CommandManager.AddHandler("/pcombo", new CommandInfo(OnCommandDebugCombo)
            {
                HelpMessage = "Open a window to edit custom combo settings.",
                ShowInHelp  = true
            });

            this.Configuration = pluginInterface.GetPluginConfig() as XIVComboConfiguration ?? new XIVComboConfiguration();
            if (Configuration.Version < 3)
            {
                Configuration.HiddenActions = new List <bool>();
                for (var i = 0; i < Enum.GetValues(typeof(CustomComboPreset)).Length; i++)
                {
                    Configuration.HiddenActions.Add(false);
                }
                Configuration.Version = 3;
            }

            this.iconReplacer = new IconReplacer(pluginInterface.TargetModuleScanner, pluginInterface.ClientState, this.Configuration);

            this.iconReplacer.Enable();

            this.pluginInterface.UiBuilder.OnOpenConfigUi += (sender, args) => isImguiComboSetupOpen = true;
            this.pluginInterface.UiBuilder.OnBuildUi      += UiBuilder_OnBuildUi;

            /*
             * pluginInterface.Subscribe("PingPlugin", e => {
             *  dynamic msg = e;
             *  iconReplacer.UpdatePing(msg.LastRTT / 2);
             *  PluginLog.Log("Ping was updated to {0} ms", msg.LastRTT / 2);
             *  });
             */
            var values = Enum.GetValues(typeof(CustomComboPreset)).Cast <CustomComboPreset>();

            orderedByClassJob = values.Where(x => x != CustomComboPreset.None && x.GetAttribute <CustomComboInfoAttribute>() != null).OrderBy(x => x.GetAttribute <CustomComboInfoAttribute>().ClassJob).ToArray();
            UpdateConfig();
        }
Ejemplo n.º 29
0
Archivo: Dev.cs Proyecto: Haplo064/Dev
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            this.pluginInterface = pluginInterface;
            Configuration        = pluginInterface.GetPluginConfig() as Config ?? new Config();
            this.pluginInterface.UiBuilder.OnBuildUi += DrawWindow;

            this.pluginInterface.UiBuilder.OnOpenConfigUi += ConfigWindow;
            this.pluginInterface.CommandManager.AddHandler("/dev", new CommandInfo(Command)
            {
                HelpMessage = ""
            });
            this.pluginInterface.CommandManager.AddHandler("/devc", new CommandInfo(CommandC)
            {
                HelpMessage = ""
            });


            //**********************************
            //**         DEV FROM HERE        **
            //**********************************

            scan1 = pluginInterface.TargetModuleScanner.ScanText("E8 ?? ?? ?? ?? 41 b8 01 00 00 00 48 8d 15 ?? ?? ?? ?? 48 8b 48 20 e8 ?? ?? ?? ?? 48 8b cf");
            scan2 = pluginInterface.TargetModuleScanner.ScanText("e8 ?? ?? ?? ?? 48 8b cf 48 89 87 ?? ?? 00 00 e8 ?? ?? ?? ?? 41 b8 01 00 00 00");

            funcPtr = pluginInterface.TargetModuleScanner.Module.BaseAddress + 0x4cd440;

            ukFunc     = new UnknownFunc(ukFuncFunc);
            ukFuncHook = new Hook <UnknownFunc>(funcPtr, ukFunc, this);

            getBaseUIObj    = Marshal.GetDelegateForFunctionPointer <GetBaseUIObjDelegate>(scan1);
            getUI2ObjByName = Marshal.GetDelegateForFunctionPointer <GetUI2ObjByNameDelegate>(scan2);
            chatLog         = getUI2ObjByName(Marshal.ReadIntPtr(getBaseUIObj(), 0x20), "ChatLog", 1);
            chatLogStuff    = getUI2ObjByName(Marshal.ReadIntPtr(getBaseUIObj(), 0x20), "ChatLog", 1);
            chatLogPanel_0  = getUI2ObjByName(Marshal.ReadIntPtr(getBaseUIObj(), 0x20), "ChatLog", 1);

            chatLogPosition = new float[2];


            PluginLog.Log(chatLog.ToString());
        }
Ejemplo n.º 30
0
        public void Initialize(DalamudPluginInterface pluginInterface)
        {
            _pi = pluginInterface;

            Config = pluginInterface.GetPluginConfig() as RichPresenceConfig ?? new RichPresenceConfig();

            _pi.UiBuilder.OnBuildUi      += UiBuilder_OnBuildUi;
            _pi.UiBuilder.OnOpenConfigUi += (sender, args) => _isMainConfigWindowDrawing = true;

            _discordPresenceManager = new DiscordPresenceManager(DefaultPresence, DISCORD_CLIENT_ID);
            _discordPresenceManager.SetPresence(DefaultPresence);

            _pi.Framework.OnUpdateEvent += Framework_OnUpdateEvent;

            _pi.ClientState.TerritoryChanged += TerritoryChanged;

            _pi.CommandManager.AddHandler("/prp",
                                          new CommandInfo((string cmd, string args) => _isMainConfigWindowDrawing = true)
            {
                HelpMessage = "Open the Discord Rich Presence configuration."
            });
        }