Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UIDebug"/> class.
        /// </summary>
        /// <param name="dalamud">The Dalamud instance.</param>
        public UIDebug(Dalamud dalamud)
        {
            this.dalamud = dalamud;
            var getSingletonAddr = dalamud.SigScanner.ScanText("E8 ?? ?? ?? ?? 41 B8 01 00 00 00 48 8D 15 ?? ?? ?? ?? 48 8B 48 20 E8 ?? ?? ?? ?? 48 8B CF");

            this.getAtkStageSingleton = Marshal.GetDelegateForFunctionPointer <GetAtkStageSingleton>(getSingletonAddr);
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UIDebug"/> class.
        /// </summary>
        public UIDebug()
        {
            var sigScanner = Service <SigScanner> .Get();

            var getSingletonAddr = sigScanner.ScanText("E8 ?? ?? ?? ?? 41 B8 01 00 00 00 48 8D 15 ?? ?? ?? ?? 48 8B 48 20 E8 ?? ?? ?? ?? 48 8B CF");

            this.getAtkStageSingleton = Marshal.GetDelegateForFunctionPointer <GetAtkStageSingleton>(getSingletonAddr);
        }
Example #3
0
        public void Init()
        {
            var scanner = _plugin.pluginInterface.TargetModuleScanner;

            var getSingletonAddr = scanner.ScanText("E8 ?? ?? ?? ?? 41 B8 01 00 00 00 48 8D 15 ?? ?? ?? ?? 48 8B 48 20 E8 ?? ?? ?? ?? 48 8B CF");

            this.getAtkStageSingleton = Marshal.GetDelegateForFunctionPointer <GetAtkStageSingleton>(getSingletonAddr);
        }
Example #4
0
        public override void Draw()
        {
            if (firstDraw)
            {
                firstDraw        = false;
                selectedUnitBase = (AtkUnitBase *)(Plugin.PluginConfig.Debugging.SelectedAtkUnitBase);
            }
            if (getAtkStageSingleton == null)
            {
                var getSingletonAddr = Plugin.PluginInterface.TargetModuleScanner.ScanText("E8 ?? ?? ?? ?? 41 B8 01 00 00 00 48 8D 15 ?? ?? ?? ?? 48 8B 48 20 E8 ?? ?? ?? ?? 48 8B CF");
                this.getAtkStageSingleton = Marshal.GetDelegateForFunctionPointer <GetAtkStageSingleton>(getSingletonAddr);
            }

            ImGui.BeginChild("st_uiDebug_unitBaseSelect", new Vector2(250, -1), true);

            ImGui.SetNextItemWidth(-38);
            ImGui.InputTextWithHint("###atkUnitBaseSearch", "Search", ref Plugin.PluginConfig.Debugging.AtkUnitBaseSearch, 0x20);
            ImGui.SameLine();
            ImGui.PushFont(UiBuilder.IconFont);
            ImGui.PushStyleColor(ImGuiCol.Text, elementSelectorActive ? 0xFF00FFFF : 0xFFFFFFFF);
            if (ImGui.Button($"{(char) FontAwesomeIcon.ObjectUngroup}", new Vector2(-1, ImGui.GetItemRectSize().Y)))
            {
                elementSelectorActive = !elementSelectorActive;
                Plugin.PluginInterface.UiBuilder.OnBuildUi -= DrawElementSelector;
                FreeExclusiveDraw();

                if (elementSelectorActive)
                {
                    SetExclusiveDraw(DrawElementSelector);
                }
            }
            ImGui.PopStyleColor();
            ImGui.PopFont();
            if (ImGui.IsItemHovered())
            {
                ImGui.SetTooltip("Element Selector");
            }

            DrawUnitBaseList();
            ImGui.EndChild();
            if (selectedUnitBase != null)
            {
                ImGui.SameLine();
                ImGui.BeginChild("st_uiDebug_selectedUnitBase", new Vector2(-1, -1), true);
                DrawUnitBase(selectedUnitBase);
                ImGui.EndChild();
            }

            if (elementSelectorCountdown > 0)
            {
                elementSelectorCountdown -= 1;
                if (elementSelectorCountdown < 0)
                {
                    elementSelectorCountdown = 0;
                }
            }
        }