Пример #1
0
        public bool Draw()
        {
            ImGui.SetNextWindowSize(new Vector2(500, 500), ImGuiCond.Always);

            var isOpen = true;

            if (!ImGui.Begin("Dalamud Data", ref isOpen, ImGuiWindowFlags.NoCollapse))
            {
                ImGui.End();
                return(false);
            }

            // Main window
            if (ImGui.Button("Force Reload"))
            {
                Load();
            }
            ImGui.SameLine();
            var copy = ImGui.Button("Copy all");

            ImGui.SameLine();
            ImGui.Combo("Data kind", ref currentKind, new[] { "ServerOpCode", "ContentFinderCondition" }, 2);

            ImGui.BeginChild("scrolling", new Vector2(0, 0), false, ImGuiWindowFlags.HorizontalScrollbar);

            if (copy)
            {
                ImGui.LogToClipboard();
            }

            ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0, 0));

            if (this.wasReady)
            {
                switch (currentKind)
                {
                case 0: ImGui.TextUnformatted(this.serverOpString);
                    break;

                case 1: ImGui.TextUnformatted(this.cfcString);
                    break;
                }
            }
            else
            {
                ImGui.TextUnformatted("Data not ready.");
            }

            ImGui.PopStyleVar();

            ImGui.EndChild();
            ImGui.End();

            return(isOpen);
        }
Пример #2
0
        public override void Draw()
        {
            //Main Window Contents
            if (propertiesOpen && !statePlaying)
            {
                ImGui.Columns(2, "##alecolumns", true);
                if (firstProperties)
                {
                    ImGui.SetColumnWidth(0, 300);
                    firstProperties = false;
                }
                ImGui.BeginChild("##leftpanel");
                DoProperties();
                ImGui.EndChild();
                ImGui.NextColumn();
            }
            if (TabHandler.VerticalTab("Properties", propertiesOpen))
            {
                propertiesOpen = !propertiesOpen;
            }
            //Viewport
            ImGui.SameLine();
            ImGui.BeginChild("##maincontent");
            var totalH = ImGui.GetWindowHeight();

            ImGuiExt.SplitterV(2f, ref h1, ref h2, 8, 8, -1);
            h1 = totalH - h2 - 24f;
            ImGui.BeginChild("###viewport", new Vector2(-1, h1), false, ImGuiWindowFlags.None);
            if (validXml)
            {
                DoViewport(mainWindow.RenderDelta);
            }
            else
            {
                ImGui.Text(exceptionText);
            }
            ImGui.EndChild();
            //Text
            ImGui.BeginChild("###text", new Vector2(-1, h2), false, ImGuiWindowFlags.None);

            xmlEditor.Render("##texteditor");
            if (xmlEditor.TextChanged())
            {
                TextChanged();
            }
            var coords = xmlEditor.GetCoordinates();

            editingObject = null;
            if (validXml)
            {
                editingObject = FindEditingObject(coords.Y + 1, coords.X + 1);
            }
            ImGui.EndChild();
            ImGui.EndChild();
        }
Пример #3
0
        public void DrawRaidEffectsTab()
        {
            ImGui.Columns(1 + MonitorDisplays.Count, "###statusColumns", false);
            ImGui.SetColumnWidth(0, 220);
            for (var i = 1; i <= MonitorDisplays.Count; i++)
            {
                ImGui.SetColumnWidth(i, 100);
            }
            ImGui.Text("状态");
            ImGui.NextColumn();
            foreach (var m in MonitorDisplays.Values)
            {
                ImGui.Text(m.Name);
                ImGui.NextColumn();
            }

            ImGui.Separator();
            ImGui.Separator();
            ImGui.Columns(1);
            ImGui.BeginChild("###scrolling", new Vector2(-1));
            ImGui.Columns(1 + MonitorDisplays.Count, "###statusColumns", false);
            ImGui.SetColumnWidth(0, 220);
            for (var i = 1; i <= MonitorDisplays.Count; i++)
            {
                ImGui.SetColumnWidth(i, 100);
            }

            StatusMonitorConfigDisplay(638, 15, raid: true, note: pluginInterface.Data.GetExcelSheet <Action>().GetRow(2258)?.Name); // 目标 / 受伤加重 (忍者)

            StatusMonitorConfigDisplay(1221, 15, raid: true);                                                                        // 目标 / 连环计 (学者)

            StatusMonitorConfigDisplay(1213, 15, raid: true, selfOnly: true);                                                        // 玩家 / 灵护 (召唤)

            StatusMonitorConfigDisplay(786, 20, raid: true, selfOnly: true);                                                         // 玩家 / 战斗连祷 (龙骑)

            StatusMonitorConfigDisplay(1184, 20, raid: true, selfOnly: true, statusList: new uint[] { 1183 },
                                       forcedName: pluginInterface.Data.GetExcelSheet <Action>().GetRow(7398)?.Name); // 玩家 / 巨龙视线 (龙骑)

            StatusMonitorConfigDisplay(1185, 20, raid: true, selfOnly: true);                                         // 玩家 / 义结金兰:攻击 (武僧)

            StatusMonitorConfigDisplay(1297, 20, raid: true, selfOnly: true);                                         // 玩家 / 鼓励 (赤魔)

            StatusMonitorConfigDisplay(1202, 20, raid: true, selfOnly: true);                                         // 玩家 / 大地神的抒情恋歌 (诗人)

            StatusMonitorConfigDisplay(1876, 20, raid: true, selfOnly: true,
                                       statusList: new uint[] { 1882, 1884, 1885 }, forcedName: "近战卡"); // 玩家 / 王冠之领主 (占星)
            StatusMonitorConfigDisplay(1877, 20, raid: true, selfOnly: true,
                                       statusList: new uint[] { 1883, 1886, 1887 }, forcedName: "远程卡"); // 玩家 / 王冠之贵妇 (占星)

            ImGui.Columns(1);

            ImGui.TextWrapped("\n有东西缺失了?\n请到 goat place discord 向 Caraxi 反馈,之后它便会被添加。");

            ImGui.EndChild();
        }
Пример #4
0
        public unsafe override void ImGuiLayout()
        {
            // 1. Show a simple window
            // Tip: if we don't call ImGui.Begin()/ImGui.End() the widgets appears in a window automatically called "Debug"
            {
                var io = ImGui.GetIO();
                ImGui.BeginWindow("Debug");
                ImGui.Text("Hello, world!");
                ImGui.SliderFloat("float", ref f, 0.0f, 1.0f, null, 1f);
                ImGui.ColorEdit3("clear color", ref clear_color, ColorEditFlags.Default);
                if (ImGui.Button("Test Window"))
                {
                    show_test_window = !show_test_window;
                }
                if (ImGui.Button("Another Window"))
                {
                    show_another_window = !show_another_window;
                }
                ImGui.Text(string.Format("Application average {0:F3} ms/frame ({1:F1} FPS)", ImGui.GetIO().DeltaTime, 1f / ImGui.GetIO().DeltaTime));
                //ImGui.InputText("Text Input 1", _TextInputBuffers[0], _TextInputBuffers[0].Length,InputTextFlags.Default,new TextEditCallback();
                //ImGui.InputText("Text Input 2", _TextInputBuffers[1].Buffer, _TextInputBuffers[1].Length);
                if (ImGui.Button("Open File"))
                {
                    show_file_dialog = !show_file_dialog;
                }
                ImGui.EndWindow();
            }

            // 2. Show another simple window, this time using an explicit Begin/End pair
            if (show_another_window)
            {
                ImGui.SetNextWindowSize(new System.Numerics.Vector2(200, 100), Condition.FirstUseEver);
                ImGui.BeginChild("Another Window", show_another_window);
                ImGui.Text("Hello");
                ImGui.EndChild();
            }

            // 3. Show the ImGui test window. Most of the sample code is in ImGui.ShowTestWindow()
            if (show_test_window)
            {
                ImGui.SetNextWindowPos(new System.Numerics.Vector2(650, 20), Condition.FirstUseEver, new System.Numerics.Vector2(0, 0));
                ImGuiNative.igShowDemoWindow(ref show_test_window);
            }

            // 4. Show the memory editor and file dialog, just as an example.
            _MemoryEditor.Draw("Memory editor", _MemoryEditorData, _MemoryEditorData.Length);
            if (show_file_dialog)
            {
                string start = _Dialog.LastDirectory;
                _Dialog.ChooseFileDialog(true, _Dialog.LastDirectory, null, "Choose File", new System.Numerics.Vector2(500, 500), new System.Numerics.Vector2(50, 50), 1f);

                /* if (!string.IsNullOrEmpty(_Dialog.ChosenPath))
                 *   _TextInputBuffers[0].StringValue = _Dialog.ChosenPath;*/
            }
        }
Пример #5
0
        protected override void DrawOverride(ref bool isGameViewFocused)
        {
            ImGui.PushItemWidth(-1);
            ImGui.InputTextMultiline("", ref _scriptConsoleText, 1000, Vector2.Zero);
            ImGui.PopItemWidth();

            if (ImGui.Button("Run") || ImGui.IsKeyPressed(0x0D))
            {
                _scriptConsoleTextAll = string.Concat(_scriptConsoleTextAll, ">> ", _scriptConsoleText.Replace("\n", "\n>> "), "\n");
                ExecuteLuaScript(_scriptConsoleText);
            }

            ImGui.SameLine();
            if (ImGui.Button("Clear"))
            {
                _scriptConsoleTextAll = "";
            }

            ImGui.SameLine();
            var loadPopupID = "load";

            if (ImGui.Button("Load"))
            {
                ImGui.OpenPopup(loadPopupID);
            }

            var savePopupID = "save";

            ImGui.SameLine();
            if (ImGui.Button("Save"))
            {
                ImGui.OpenPopup(savePopupID);
            }

            ImGui.PushStyleColor(ImGuiCol.Border, new Vector4(0, 0, 150, 1));
            ImGui.Separator();
            ImGui.BeginChild("cmd", Vector2.Zero, true);
            ImGui.PushStyleColor(ImGuiCol.Text, _consoleTextColor);
            ImGui.Text(_scriptConsoleTextAll);
            ImGui.PopStyleColor();
            ImGui.EndChild();
            ImGui.PopStyleColor();

            if (ImGui.BeginPopup(loadPopupID))
            {
                ImGui.Text("Soon");
                ImGui.EndPopup();
            }

            if (ImGui.BeginPopup(savePopupID))
            {
                ImGui.Text("Soon");
                ImGui.EndPopup();
            }
        }
Пример #6
0
        public static void Render(FMAT material)
        {
            var renderer = material.MaterialAsset as SharcFBRenderer;

            if (renderer.GLShaderInfo == null)
            {
                return;
            }

            if (ImGui.BeginCombo("Stage", selectedStage))
            {
                if (ImGui.Selectable("Vertex"))
                {
                    selectedStage = "Vertex";
                }
                if (ImGui.Selectable("Pixel"))
                {
                    selectedStage = "Pixel";
                }
                ImGui.EndCombo();
            }

            ImGui.BeginTabBar("menu_shader1");
            if (ImguiCustomWidgets.BeginTab("menu_shader1", $"Shader Code"))
            {
                LoadShaderStageCode(material);
                ImGui.EndTabItem();
            }
            if (ImguiCustomWidgets.BeginTab("menu_shader1", "Shader Info"))
            {
                if (ImGui.BeginChild("ShaderInfoC"))
                {
                    LoadShaderInfo(material);
                }
                ImGui.EndChild();
                ImGui.EndTabItem();
            }
            if (ImguiCustomWidgets.BeginTab("menu_shader1", "GX2 Shader Data"))
            {
                var shader  = material.MaterialAsset as SharcFBRenderer;
                var program = shader.ShaderModel;

                if (selectedStage == "Vertex")
                {
                    var gx2Shader = program.GetRawVertexShader(shader.BinaryIndex).ToArray();
                    MemoryEditor.Draw(gx2Shader, gx2Shader.Length);
                }
                if (selectedStage == "Pixel")
                {
                    var gx2Shader = program.GetRawPixelShader(shader.BinaryIndex).ToArray();
                    MemoryEditor.Draw(gx2Shader, gx2Shader.Length);
                }
                ImGui.EndTabItem();
            }
        }
Пример #7
0
 public override void DrawSettingsMenu()
 {
     ImGui.BulletText($"v{PluginVersion}");
     ImGui.PushStyleVar(StyleVar.ChildRounding, 5.0f);
     ImGuiNative.igGetContentRegionAvail(out var newcontentRegionArea);
     if (ImGui.BeginChild("RightSettings", new System.Numerics.Vector2(newcontentRegionArea.X, newcontentRegionArea.Y), true, WindowFlags.Default))
     {
         SettingsMenu();
     }
     ImGui.EndChild();
 }
Пример #8
0
        public void Draw(AptSceneManager manager)
        {
            if (_frameListUtilities.Reset(manager))
            {
                // if this is a different frame (imply _utilities.Active == true)
                ImGui.SetNextWindowSize(Vector2.Zero);
                _inputFrameNumber = manager.CurrentFrame;
                _playing          = false;
                _playSpeed        = 1f;
            }
            else if (!_frameListUtilities.Active)
            {
                return;
            }

            if (ImGui.Begin(Name))
            {
                ImGui.InputFloat("Speed multiplier", ref _playSpeed);
                ImGui.Text($"Current Frame: {manager.CurrentFrameWrapped}");
                ProcessPlay(manager);

                ImGui.Separator();

                ImGui.InputInt($" / {manager.NumberOfFrames}", ref _inputFrameNumber);
                _inputFrameNumber = Math.Abs(_inputFrameNumber);
                if (ImGui.Button("Play to frame"))
                {
                    manager.PlayToFrame(_inputFrameNumber);
                }

                ImGui.Separator();

                if (ImGui.BeginChild("Real Frame List"))
                {
                    var digits = 1;
                    if (manager.NumberOfFrames > 10)
                    {
                        digits = (int)Math.Log10(manager.NumberOfFrames - 1) + 1;
                    }
                    for (var i = 0; i < manager.NumberOfFrames; ++i)
                    {
                        var selected = (i == manager.CurrentFrameWrapped);
                        ImGui.Selectable($"Frame {i.ToString($"D{digits}")}", ref selected);
                        if (selected && i != manager.CurrentFrameWrapped)
                        {
                            manager.PlayToFrame(i);
                            _inputFrameNumber = i;
                        }
                    }
                }
                ImGui.EndChild();
            }
            ImGui.End();
        }
Пример #9
0
    public override void Draw()
    {
        if (ImGui.BeginChild("###newsFrame", this.GetSize()))
        {
            ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(32f, 32f));

            //ImGui.Text("awooga");

            if (this.newsLoaded)
            {
                var banner = this.banners[this.currentBanner];
                ImGui.Image(banner.ImGuiHandle, banner.Size);

                if (ImGui.IsItemClicked(ImGuiMouseButton.Left))
                {
                    Util.OpenBrowser(this.headlines.Banner[this.currentBanner].Link.ToString());
                }

                ImGui.Dummy(new Vector2(15));

                void ShowNewsEntry(News newsEntry)
                {
                    ImGui.Text(newsEntry.Title);

                    if (ImGui.IsItemClicked(ImGuiMouseButton.Left) && !string.IsNullOrEmpty(newsEntry.Url))
                    {
                        Util.OpenBrowser(newsEntry.Url);
                    }
                }

                foreach (News newsEntry in this.headlines.News)
                {
                    ShowNewsEntry(newsEntry);
                }

                ImGui.Separator();

                foreach (News topic in this.headlines.Topics)
                {
                    ShowNewsEntry(topic);
                }
            }
            else
            {
                ImGui.Text("News are loading...");
            }

            ImGui.PopStyleVar();
        }

        ImGui.EndChild();

        base.Draw();
    }
Пример #10
0
        private void DrawHistory(IList <SequenceCombo> collection)
        {
            ImGui.Separator();
            ImGui.BeginChild("ComboTrackerChild1");

            for (int i = collection.Count - 1; i >= 0; i--)
            {
                ImGui.Text(collection[i].Name);
            }

            ImGui.EndChild();
        }
Пример #11
0
        public override void Draw(ref bool isGameViewFocused)
        {
            ImGui.BeginChild("ru sidebar", new Vector2(250, 0), true, 0);

            ImGui.TextWrapped(_ruText);

            ImGui.EndChild();

            ImGui.SameLine();

            base.Draw(ref isGameViewFocused);
        }
Пример #12
0
 public void OnGui(PARAM.Row selection, string id, float w, float h)
 {
     ImGui.PushStyleColor(ImGuiCol.ChildBg, new Vector4(0.145f, 0.145f, 0.149f, 1.0f));
     ImGui.SetNextWindowSize(new Vector2(350, h - 80), ImGuiCond.FirstUseEver);
     ImGui.SetNextWindowPos(new Vector2(w - 370, 20), ImGuiCond.FirstUseEver);
     ImGui.Begin($@"Properties##{id}");
     ImGui.BeginChild("propedit");
     PropEditorParamRow(selection);
     ImGui.EndChild();
     ImGui.End();
     ImGui.PopStyleColor();
 }
Пример #13
0
        private void RenderStatisticsWindow()
        {
            if (ImGui.Begin("Statistics",
                            ImGuiWindowFlags.NoCollapse |
                            ImGuiWindowFlags.NoMove |
                            ImGuiWindowFlags.NoResize |
                            ImGuiWindowFlags.HorizontalScrollbar))
            {
                // set position and size of the window
                ImGui.SetWindowPos(new System.Numerics.Vector2((int)(0.25 * Window.Size.X), (int)(0.7 * Window.Size.Y)));
                ImGui.SetWindowSize(new System.Numerics.Vector2((int)(0.3 * Window.Size.X - 2), (int)(0.3 * Window.Size.Y)));

                if (ManipulatorHandler.Count > 0)
                {
                    var quarterWidth = 0.25f * ImGui.GetWindowContentRegionWidth();

                    int selectedIndex = -1;
                    ImGui.PushStyleVar(ImGuiStyleVar.ChildRounding, 5);
                    if (ImGui.BeginChild("ManipulatorStat", new System.Numerics.Vector2(quarterWidth, ImGui.GetContentRegionAvail().Y), true,
                                         ImGuiWindowFlags.HorizontalScrollbar))
                    {
                        foreach (var manipulator in ManipulatorHandler.Manipulators)
                        {
                            if (ImGui.Selectable($"Manip {++selectedIndex}"))
                            {
                                _selectedStatIndex = selectedIndex;
                            }
                        }

                        ImGui.EndChild();
                    }

                    ImGui.SameLine();

                    ImGui.BeginGroup();

                    if (_selectedStatIndex != -1)
                    {
                        ImGui.Text($"Manipulator {_selectedStatIndex}");

                        ImGui.Separator();

                        RenderAlgorithmStatistics(ManipulatorHandler.Manipulators[_selectedStatIndex]);
                    }

                    ImGui.EndGroup();
                }
                else
                {
                    ImGui.Text("No manipulators on the scene.");
                }
            }
        }
Пример #14
0
        public override void Draw(ref bool isGameViewFocused)
        {
            ImGui.BeginChild("wnd tree", new Vector2(400, 0), true, 0);

            DrawControlTreeItemRecursive(_rootControl);

            ImGui.EndChild();

            ImGui.SameLine();

            base.Draw(ref isGameViewFocused);
        }
Пример #15
0
        /// <inheritdoc/>
        public override void Draw()
        {
            ImGui.BeginChild("color_scrolling", new Vector2(0, 0), false, ImGuiWindowFlags.AlwaysVerticalScrollbar | ImGuiWindowFlags.HorizontalScrollbar);
            ImGui.Text("This is a collection of UI colors you can use in your plugin.");
            ImGui.Separator();
            foreach (var color in this.colors)
            {
                ImGui.TextColored(color.Value, color.Key);
            }

            ImGui.EndChild();
        }
Пример #16
0
        internal void DrawIcon(ushort icon, Vector2 size)
        {
            if (icon < 65000)
            {
                if (textureDictionary.ContainsKey(icon))
                {
                    var tex = textureDictionary[icon];
                    if (tex == null || tex.ImGuiHandle == IntPtr.Zero)
                    {
                        ImGui.PushStyleColor(ImGuiCol.Border, new Vector4(1, 0, 0, 1));
                        ImGui.BeginChild("FailedTexture", size, true);
                        ImGui.Text(icon.ToString());
                        ImGui.EndChild();
                        ImGui.PopStyleColor();
                    }
                    else
                    {
                        ImGui.Image(textureDictionary[icon].ImGuiHandle, size);
                    }
                }
                else
                {
                    ImGui.BeginChild("WaitingTexture", size, true);
                    ImGui.EndChild();

                    textureDictionary[icon] = null;

                    Task.Run(() => {
                        try {
                            var iconTex = PluginInterface.Data.GetIcon(icon);
                            var tex     = PluginInterface.UiBuilder.LoadImageRaw(iconTex.GetRgbaImageData(), iconTex.Header.Width, iconTex.Header.Height, 4);
                            if (tex != null && tex.ImGuiHandle != IntPtr.Zero)
                            {
                                textureDictionary[icon] = tex;
                            }
                        } catch {
                            // Ignore
                        }
                    });
                }
            }
            else
            {
                ImGui.BeginChild("NoIcon", size, true);
                if (PluginConfig.ShowItemID)
                {
                    ImGui.Text(icon.ToString());
                }

                ImGui.EndChild();
            }
        }
Пример #17
0
        void DrawResourceMods()
        {
            var ret = ImGui.BeginTabItem("Resource Mods");

            if (!ret)
            {
                return;
            }

            DrawModsSelector();

            ImGui.SameLine();

            if (_selectedMod != null)
            {
                try
                {
                    ImGui.BeginChild("selectedModInfo", AutoFillSize, true);

                    ImGui.Text(_selectedMod.Meta.Name);
                    ImGui.SameLine();
                    ImGui.TextColored(new Vector4(1f, 1f, 1f, 0.66f), "by");
                    ImGui.SameLine();
                    ImGui.Text(_selectedMod.Meta.Author);

                    ImGui.TextWrapped(_selectedMod.Meta.Description ?? "");

                    ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 12);

                    // list files
                    ImGui.Text("Files:");
                    ImGui.SetNextItemWidth(-1);
                    if (ImGui.ListBoxHeader("##", AutoFillSize))
                    {
                        foreach (var file in _selectedMod.ModFiles)
                        {
                            ImGui.Selectable(file.FullName);
                        }
                    }

                    ImGui.ListBoxFooter();

                    ImGui.EndChild();
                }
                catch (Exception ex)
                {
                    PluginLog.LogError(ex, "f**k");
                }
            }

            ImGui.EndTabItem();
        }
        private void LoadArchiveProperties(NodeBase node, bool onLoad)
        {
            var archiveFileWrapper = node as ArchiveHiearchy;

            //Wrapper is a folder, skip
            if (!archiveFileWrapper.IsFile)
            {
                return;
            }

            if (ImGui.BeginChild("##editor_menu", new System.Numerics.Vector2(200, 22)))
            {
                if (ImGui.BeginCombo("Editor", archiveFileWrapper.ArchiveEditor))
                {
                    if (ImGui.Selectable("Hex Preview"))
                    {
                        archiveFileWrapper.ArchiveEditor = "Hex Preview";
                    }
                    if (ImGui.Selectable("File Editor"))
                    {
                        archiveFileWrapper.ArchiveEditor = "File Editor";
                    }
                    if (ImGui.Selectable("Text Preview"))
                    {
                        archiveFileWrapper.ArchiveEditor = "Text Preview";
                    }

                    ImGui.EndCombo();
                }
            }
            ImGui.EndChild();

            if (archiveFileWrapper.ArchiveEditor == "Hex Preview")
            {
                if (ActiveEditor == null || ActiveEditor.GetType() != typeof(MemoryEditor))
                {
                    ActiveEditor = new MemoryEditor();
                }

                var data = archiveFileWrapper.ArchiveFileInfo.FileData;
                if (memPool.Length != data.Length)
                {
                    memPool = data.ToArray();
                }

                ((MemoryEditor)ActiveEditor).Draw(memPool, memPool.Length);
            }
            if (archiveFileWrapper.ArchiveEditor == "File Editor")
            {
                LoadProperties(node, onLoad);
            }
        }
Пример #19
0
 public bool Draw()
 {
     if (ImGuiExt.BeginDock(Title, ref open, 0))
     {
         //Layout
         if (selectedNode != null)
         {
             ImGui.Columns(2, "NodeColumns", true);
         }
         //Headers
         ImGui.Separator();
         ImGui.Text("Nodes");
         if (selectedNode != null)
         {
             ImGui.NextColumn();
             ImGui.Text("Node Information");
             ImGui.NextColumn();
         }
         ImGui.Separator();
         //Tree
         ImGui.BeginChild("##scroll", false, 0);
         var flags  = selectedNode == Utf.Root ? TreeNodeFlags.Selected | tflags : tflags;
         var isOpen = ImGui.TreeNodeEx("/", flags);
         if (ImGuiNative.igIsItemClicked(0))
         {
             selectedNode = Utf.Root;
         }
         ImGui.PushID("/");
         DoNodeMenu("/", Utf.Root, null);
         ImGui.PopID();
         if (isOpen)
         {
             int i = 0;
             foreach (var node in Utf.Root.Children)
             {
                 DoNode(node, Utf.Root, i++);
             }
             ImGui.TreePop();
         }
         ImGui.EndChild();
         //End Tree
         if (selectedNode != null)
         {
             //Node preview
             ImGui.NextColumn();
             NodeInformation();
         }
     }
     ImGuiExt.EndDock();
     Popups();
     return(open);
 }
Пример #20
0
        public override void Draw()
        {
            ImGui.BeginChild("ConsoleInner", new Vector2(-1, -64));
            ImGui.PushFont(ImGuiManager.Instance.MonospacedFont);

            foreach (var logEntry in Logging.LogEntries.TakeLast(logLimit))
            {
                if (!string.IsNullOrWhiteSpace(currentConsoleFilter) && !GetFilterMatch(logEntry, currentConsoleFilter))
                {
                    continue;
                }

                ImGui.TextWrapped(logEntry.timestamp.TimeOfDay.ToString());
                ImGui.SameLine();
                ImGui.PushStyleColor(ImGuiCol.Text, SeverityToColor(logEntry.severity));
                ImGui.TextWrapped(logEntry.str);
                ImGui.PopStyleColor();

                if (ImGui.IsItemHovered())
                {
                    ImGui.SetNextWindowSize(new Vector2(GameSettings.GameResolutionX / 2f, -1));

                    ImGui.BeginTooltip();

                    ImGui.Text("Stack Trace:");
                    ImGui.TextWrapped(logEntry.stackTrace.ToString());

                    ImGui.EndTooltip();
                }

                ImGui.Separator();
            }

            if (scrollQueued)
            {
                ImGui.SetScrollHereY(1.0f);
                scrollQueued = false;
            }

            ImGui.PopFont();
            ImGui.EndChild();

            ImGui.InputText("Filter", ref currentConsoleFilter, 256);

            ImGui.InputText("Input", ref currentConsoleInput, 256);
            ImGui.SameLine();
            if (ImGui.Button("Submit"))
            {
                CommandRegistry.ParseAndExecute(currentConsoleInput);
                currentConsoleInput = "";
            }
        }
Пример #21
0
        public void DrawRaidEffectsTab()
        {
            ImGui.Columns(1 + MonitorDisplays.Count, "###statusColumns", false);
            ImGui.SetColumnWidth(0, 220);
            for (var i = 1; i <= MonitorDisplays.Count; i++)
            {
                ImGui.SetColumnWidth(i, 100);
            }
            ImGui.Text("Status");
            ImGui.NextColumn();
            foreach (var m in MonitorDisplays.Values)
            {
                ImGui.Text(m.Name);
                ImGui.NextColumn();
            }

            ImGui.Separator();
            ImGui.Separator();
            ImGui.Columns(1);
            ImGui.BeginChild("###scrolling", new Vector2(-1));
            ImGui.Columns(1 + MonitorDisplays.Count, "###statusColumns", false);
            ImGui.SetColumnWidth(0, 220);
            for (var i = 1; i <= MonitorDisplays.Count; i++)
            {
                ImGui.SetColumnWidth(i, 100);
            }

            StatusMonitorConfigDisplay(638, 15, raid: true, note: pluginInterface.Data.GetExcelSheet <Action>().GetRow(2258)?.Name);                   // Target / Trick Attack (NIN)

            StatusMonitorConfigDisplay(1221, 15, raid: true);                                                                                          // Target / Chain Stratagem (SCH)

            StatusMonitorConfigDisplay(1213, 15, raid: true, selfOnly: true);                                                                          // Player / Devotion (SMN)

            StatusMonitorConfigDisplay(786, 20, raid: true, selfOnly: true);                                                                           // Player / Battle Litany (DRG)

            StatusMonitorConfigDisplay(1184, 20, raid: true, selfOnly: true, note: pluginInterface.Data.GetExcelSheet <Action>().GetRow(7398)?.Name);  // Player / Dragon Sight (DRG)

            StatusMonitorConfigDisplay(1185, 20, raid: true, selfOnly: true);                                                                          // Player / Brotherhood (MNK)

            StatusMonitorConfigDisplay(1297, 20, raid: true, selfOnly: true);                                                                          // Player / Embolden (RDM)

            StatusMonitorConfigDisplay(1202, 20, raid: true, selfOnly: true);                                                                          // Player / Nature's Minne (BRD)

            StatusMonitorConfigDisplay(1876, 20, raid: true, selfOnly: true, statusList: new uint[] { 1882, 1884, 1885 }, forcedName: "Melee Cards");  // Player / Balance (AST)
            StatusMonitorConfigDisplay(1877, 20, raid: true, selfOnly: true, statusList: new uint[] { 1883, 1886, 1887 }, forcedName: "Ranged Cards"); // Player / Bole (AST)

            ImGui.Columns(1);

            ImGui.TextWrapped("\nSomething Missing?\nPlease let Caraxi know on the goat place discord and it will be added.");

            ImGui.EndChild();
        }
Пример #22
0
        public override void Draw()
        {
            if (firstDraw)
            {
                firstDraw        = false;
                selectedUnitBase = (AtkUnitBase *)(Plugin.PluginConfig.Debugging.SelectedAtkUnitBase);
            }

            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;
                Service.PluginInterface.UiBuilder.Draw -= 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;
                }
            }
        }
Пример #23
0
        void FLPane()
        {
            var totalH = ImGui.GetWindowHeight();

            ImGuiExt.SplitterV(2f, ref fl_h1, ref fl_h2, 8, 8, -1);
            fl_h1 = totalH - fl_h2 - 6f;
            ImGui.BeginChild("1", new Vector2(-1, fl_h1), false, ImGuiWindowFlags.None);
            ImGui.Separator();
            //3DB list
            if (ImGui.TreeNodeEx("Model/"))
            {
                int i = 0;
                foreach (var mdl in output)
                {
                    FLTree(mdl, ref i);
                }
            }
            ImGui.EndChild();
            ImGui.BeginChild("2", new Vector2(-1, fl_h2), false, ImGuiWindowFlags.None);
            if (ImGuiExt.ToggleButton("Options", curTab == 0))
            {
                curTab = 0;
            }
            ImGui.SameLine();
            if (ImGuiExt.ToggleButton("Materials", curTab == 1))
            {
                curTab = 1;
            }
            ImGui.Separator();
            switch (curTab)
            {
            case 0:     //OPTIONS
                ImGui.AlignTextToFramePadding();
                ImGui.Text("Model Name:");
                ImGui.SameLine();
                modelNameBuffer.InputText("##mdlname", ImGuiInputTextFlags.None);
                ImGui.Checkbox("Generate Materials", ref generateMaterials);
                break;

            case 1:     //MATERIALS
                if (selected == null)
                {
                    ImGui.Text("No object selected");
                }
                else
                {
                    MatNameEdit();
                }
                break;
            }
            ImGui.EndChild();
        }
Пример #24
0
 public override void DrawSettingsMenu()
 {
     ImGui.BulletText($"v{PluginVersion}");
     ImGui.BulletText($"Last Updated: {buildDate}");
     idPop = 1;
     ImGui.PushStyleVar(StyleVar.ChildRounding, 5.0f);
     ImGuiNative.igGetContentRegionAvail(out var newcontentRegionArea);
     if (ImGui.BeginChild("RightSettings", new System.Numerics.Vector2(newcontentRegionArea.X, newcontentRegionArea.Y), true, WindowFlags.Default))
     {
         DelveMenu(idPop, out var newInt);
         idPop = newInt;
     }
 }
Пример #25
0
        protected override void renderSelf()
        {
            ImGui.BeginChild("tree");
            foreach (var node in Nodes)
            {
                node.OnSelectInChildren(select);
                node.FlagsInChildren(ImGuiTreeNodeFlags.OpenOnArrow | ImGuiTreeNodeFlags.DefaultOpen |
                                     ImGuiTreeNodeFlags.OpenOnDoubleClick);
                node.Render();
            }

            ImGui.EndChild();
        }
Пример #26
0
        private void RenderCurrentCaptureArea()
        {
            ImGui.SetNextWindowSize(new Vector2(_currentResizeOperation !.CurrentArea.Width, _currentResizeOperation.CurrentArea.Height));
            ImGui.SetNextWindowPos(new Vector2(_currentResizeOperation.CurrentArea.X, _currentResizeOperation.CurrentArea.Y));

            ImGui.Begin("CurrentSelection", NoDecoration);
            {
                ImGui.SetWindowFontScale(1f);
                ImGui.BeginChild("CurrentAreaText", new Vector2(), false, NoDecoration);
                ImGui.TextWrapped("Current active capture area. Hold and drag mouse to select new. Press Escape to cancel");
                ImGui.EndChild();
            }
        }
Пример #27
0
        public void Tick(float DeltaTime)
        {
            ImGui.Begin("Console");

            ImGui.BeginChild("Scrolling");
            for (int i = 0; i < ConsoleMessages.Count; i++)
            {
                ImGui.Text(ConsoleMessages[i]);
            }
            ImGui.EndChild();

            ImGui.End();
        }
Пример #28
0
        public void DrawRight()
        {
            ImGui.BeginChild("InstanceInfoChlid", new Vector2(0, ImGui.GetWindowHeight()));

            ImGui.Text(curInstance.type.Name);
            ImGui.SameLine();
            ImGui.Text(curInstance.name);
            foreach (IClassView i in subViews)
            {
                i.DrawView();
            }
            ImGui.EndChild();
        }
    void DrawObjectList()
    {
        ImGui.SetNextWindowPos(new Vector2(10, 30), ImGuiCond.Once, new Vector2(0.0f, 0.0f));
        ImGui.SetNextWindowSize(new Vector2(150, Screen.height - 125), ImGuiCond.Once);
        ImGui.Begin("Objects", ImGuiWindowFlags.NoSavedSettings);
        {
            if (ImGui.Checkbox("Camera View", ref camView))
            {
                ToggleCameraView();
            }

            ImGui.BeginChild("ObjectList", new Vector2(0, -ImGui.GetFrameHeightWithSpacing() * 2), true);
            {
                foreach (var obj in scriptObjects)
                {
                    if (ImGui.Selectable(obj.name, activeObject == obj))
                    {
                        activeObject = obj;
                    }
                }
            }
            ImGui.EndChild();

            if (ImGui.Button("+"))
            {
                var sfd = new SelectFileDialog()
                          .SetFilter("Image file\0*.jpg;*.png\0")
                          .SetTitle("Select image")
                          .SetDefaultExt("png")
                          .Show();

                if (sfd.IsSucessful)
                {
                    var gameObJ   = new GameObject();
                    var scriptObj = gameObJ.AddComponent <ScriptObject>();
                    scriptObj.TextureName = sfd.File;

                    var newKeyframe = KeyFrame.Empty();
                    newKeyframe.Position = transform.position + transform.rotation * new Vector3(0, 0, 5);
                    newKeyframe.Rotation = transform.eulerAngles;

                    scriptObj.KeyFrames.Add(newKeyframe);
                    scriptObj.Position = newKeyframe.Position;
                    scriptObj.Rotation = newKeyframe.Rotation;

                    scriptObjects.Add(scriptObj);
                }
            }
        }
        ImGui.End();
    }
Пример #30
0
        private void DrawSymbolsSelectBox(float reserveSize)
        {
            PlottedGraph?graph = _ActiveGraph;

            if (graph == null)
            {
                return;
            }

            if (_activeHighlights.LastExternNodeCount < graph.InternalProtoGraph.ExternalNodesCount)
            {
                RefreshExternHighlightData(graph.InternalProtoGraph.copyExternalNodeList());
            }

            ImGui.Text("Filter");
            ImGui.SameLine();
            ImGui.InputText("##SymFilter", ref _activeHighlights.SymFilterText, 255);

            ImGui.SameLine();
            if (ImGui.Button($"{ImGuiController.FA_ICON_TRASHCAN}"))
            {
                _activeHighlights.SymFilterText = "";
            }

            //ImGui.PushStyleColor(ImGuiCol.Text, 0xFF000000);

            ImGui.PushStyleColor(ImGuiCol.ChildBg, Themes.GetThemeColourUINT(Themes.eThemeColour.WindowBackground));
            ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, Vector2.Zero);
            if (ImGui.BeginChild(ImGui.GetID("htSymsFrameHeader"), new Vector2(ImGui.GetContentRegionAvail().X - 3, 20), true))
            {
                ImGui.SameLine(10);
                ImGui.Text("Symbol");
                ImGui.SameLine(200);
                ImGui.Text("Address");
                ImGui.SameLine(315);
                ImGui.Text("Unique Nodes");
                ImGui.EndChild();
            }
            ImGui.PopStyleVar();
            ImGui.PopStyleColor();

            ImGui.PushStyleColor(ImGuiCol.ChildBg, Themes.GetThemeColourUINT(Themes.eThemeColour.Frame));
            if (ImGui.BeginChild("htSymsFrame", new Vector2(ImGui.GetContentRegionAvail().X - 3, ImGui.GetContentRegionAvail().Y - reserveSize)))
            {
                DrawModSymTreeNodes(graph);
                ImGui.EndChild();
            }
            //ImGui.PopStyleColor();

            ImGui.PopStyleColor();
        }