예제 #1
0
        private void DrawActiveDocuments()
        {
            if (ImGui.BeginTabBar("Active documents", ImGuiTabBarFlags.Reorderable | ImGuiTabBarFlags.TabListPopupButton | ImGuiTabBarFlags.FittingPolicyScroll))
            {
                foreach (var document in documents)
                {
                    if (!document.IsOpen || !document.IsDocked)
                    {
                        continue;
                    }

                    var docOpen = document.IsOpen;
                    if (ImGui.BeginTabItem(document.Title, ref docOpen, ImGuiTabItemFlags.None))
                    {
                        document.Draw(context);
                        ImGui.EndTabItem();
                    }

                    document.IsOpen = docOpen;
                }

                ImGui.EndTabBar();
            }

            ImGui.End();
        }
    private static void ImGuiUn_Layout()
    {
        if (!doDebugViz)
        {
            return;
        }

        ImGuiWindowFlags flags = ImGuiWindowFlags.NoNavFocus | ImGuiWindowFlags.NoFocusOnAppearing
                                 | ImGuiWindowFlags.HorizontalScrollbar;

        ImGui.SetNextWindowBgAlpha(0.35f);
        ImGui.SetNextWindowSize(new Vector2(400, 300), ImGuiCond.FirstUseEver);
        if (ImGui.Begin("debug viz", ref p_open, flags))
        {
            ImGuiTabBarFlags f = ImGuiTabBarFlags.NoCloseWithMiddleMouseButton | ImGuiTabBarFlags.TabListPopupButton;
            if (ImGui.BeginTabBar("debug_viz_tab", f))
            {
                foreach (var v in vizs)
                {
                    if (ImGui.BeginTabItem(v.gameObject.name))
                    {
                        v.DrawDebugViz();
                        ImGui.EndTabItem();
                    }
                }
                ImGui.EndTabBar();
            }

            ImGui.End();
        }
    }
    public void DrawDebugViz()
    {
        bool _active = gameObject.activeInHierarchy;

        if (ImGui.Checkbox("gameobject active", ref _active))
        {
            gameObject.SetActive(_active);
        }

        ImGui.Spacing();

        ImGuiTabBarFlags f = ImGuiTabBarFlags.NoCloseWithMiddleMouseButton | ImGuiTabBarFlags.TabListPopupButton
                             | ImGuiTabBarFlags.FittingPolicyDefault | ImGuiTabBarFlags.Reorderable;

        if (ImGui.BeginTabBar(gameObject.name, f))
        {
            gameObject.SendMessage <IDebugViz>
                ((cmp) =>
            {
                if (ImGui.BeginTabItem(cmp.GetType().Name))
                {
                    cmp.DrawDebugViz();
                    ImGui.EndTabItem();
                }
            });
            ImGui.EndTabBar();
        }
    }
예제 #4
0
        public static void Draw()
        {
            if (!FreeCam.Enabled && DalamudApi.GameGui.GetAddonByName("Title", 1) != IntPtr.Zero)
            {
                DrawFreeCamButton();
            }

            if (!isVisible)
            {
                return;
            }

            ImGui.SetNextWindowSizeConstraints(new Vector2(700, 660) * ImGuiHelpers.GlobalScale, new Vector2(9999));
            ImGui.Begin("Cammy Configuration", ref isVisible);

            if (ImGui.BeginTabBar("CammyTabs"))
            {
                if (ImGui.BeginTabItem("Presets"))
                {
                    DrawPresetList();
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem("Other Settings"))
                {
                    DrawOtherSettings();
                    ImGui.EndTabItem();
                }

                ImGui.EndTabBar();
            }

            ImGui.End();
        }
예제 #5
0
    public override void Draw()
    {
        DebugManager.ClickToCopyText($"{Common.InventoryManagerAddress.ToInt64():X}");
        if (ImGui.BeginTabBar("inventoryDebuggingTabs"))
        {
            if (ImGui.BeginTabItem("Container/Slot"))
            {
                ImGui.PushItemWidth(200);
                if (ImGui.BeginCombo("###containerSelect", $"{inventoryType} [{(int)inventoryType}]"))
                {
                    foreach (var i in (InventoryType[])Enum.GetValues(typeof(InventoryType)))
                    {
                        if (ImGui.Selectable($"{i} [{(int) i}]##inventoryTypeSelect", i == inventoryType))
                        {
                            inventoryType = i;
                        }
                    }
                    ImGui.EndCombo();
                }

                var container = Common.GetContainer(inventoryType);

                ImGui.PopItemWidth();


                if (container != null)
                {
                    ImGui.Text($"Container Address:");
                    ImGui.SameLine();
                    DebugManager.ClickToCopyText($"{(ulong)container:X}");

                    ImGui.SameLine();
                    DebugManager.PrintOutObject(*container, (ulong)container, new List <string>());

                    if (ImGui.TreeNode("Items##containerItems"))
                    {
                        for (var i = 0; i < container->SlotCount; i++)
                        {
                            var item     = container->Items[i];
                            var itemAddr = ((ulong)container->Items) + (ulong)sizeof(InventoryItem) * (ulong)i;
                            DebugManager.ClickToCopyText($"{itemAddr:X}");
                            ImGui.SameLine();
                            DebugManager.PrintOutObject(item, (ulong)&item, new List <string> {
                                $"Items[{i}]"
                            }, false, $"[{i:00}] {item.Item?.Name ?? "<Not Found>"}");
                        }
                        ImGui.TreePop();
                    }
                }
                else
                {
                    ImGui.Text("Container not found.");
                }
                ImGui.EndTabItem();
            }

            ImGui.EndTabBar();
        }
    }
예제 #6
0
        private void DrawTabs()
        {
            if (ImGui.BeginTabBar("PriceCheckSettingsTabBar", ImGuiTabBarFlags.NoTooltip))
            {
                if (ImGui.BeginTabItem(Loc.Localize("General", "General") + "###PriceCheck_General_Tab"))
                {
                    this.currentTab = Tab.General;
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("Overlay", "Overlay") + "###PriceCheck_Overlay_Tab"))
                {
                    this.currentTab = Tab.Overlay;
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("Chat", "Chat") + "###PriceCheck_Chat_Tab"))
                {
                    this.currentTab = Tab.Chat;
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("Toast", "Toast") + "###PriceCheck_Toast_Tab"))
                {
                    this.currentTab = Tab.Toast;
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("Keybind", "Keybind") + "###PriceCheck_Keybind_Tab"))
                {
                    this.currentTab = Tab.Keybind;
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("Filters", "Filters") + "###PriceCheck_Filters_Tab"))
                {
                    this.currentTab = Tab.Filters;
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("Thresholds", "Thresholds") + "###PriceCheck_Thresholds_Tab"))
                {
                    this.currentTab = Tab.Thresholds;
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("ContextMenu", "Context Menu") + "###PriceCheck_ContextMenu_Tab"))
                {
                    this.currentTab = Tab.ContextMenu;
                    ImGui.EndTabItem();
                }

                ImGui.EndTabBar();
                ImGui.Spacing();
            }
        }
예제 #7
0
 private unsafe void SubmitEditorWindow()
 {
     ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 0);
     ImGui.SetNextWindowSizeConstraints(Vector2.One * 500 * RuntimeOptions.Current.UiScale, Vector2.One * Controller.Context.Width);
     if (ImGui.Begin("Shader Editor"))
     {
         ImGui.PushFont(RuntimeOptions.Current.EditorFont);
         if (ImGui.BeginTabBar("editor mode"))
         {
             if (ImGui.BeginTabItem("Advanced"))
             {
                 basicMode = false;
                 SubmitAdvancedEditor();
                 ImGui.EndTabItem();
             }
             if (ImGui.BeginTabItem("Basic"))
             {
                 basicMode = true;
                 if (ImGui.BeginChild("editor basic", Vector2.Zero, true))
                 {
                     Vector2 editorWindowSize = ImGui.GetWindowSize();
                     float   textSize         = ImGui.CalcTextSize(fragmentCode).Y + 32;
                     ImGui.PushItemWidth(-1);
                     ImGui.InputTextMultiline("",
                                              ref fragmentCode,
                                              MAXEDITORSTRINGLENGTH,
                                              new Vector2(editorWindowSize.X - 16, textSize > editorWindowSize.Y ? textSize : editorWindowSize.Y - 16),
                                              ImGuiInputTextFlags.AllowTabInput);
                     ImGui.PopItemWidth();
                 }
                 ImGui.EndTabItem();
             }
             ImGui.EndTabBar();
         }
         ImGui.PopFont();
         ImGui.End();
     }
     if (errorMessages.Count != 0)
     {
         ImGui.SetNextWindowSizeConstraints(new Vector2(500, 16), new Vector2(500, 500));
         ImGui.BeginTooltip();
         ImGui.PushTextWrapPos();
         for (int i = 0; i < errorMessages.Count; i++)
         {
             string errorMessage = errorMessages[i];
             if (string.IsNullOrWhiteSpace(errorMessage))
             {
                 continue;
             }
             ImGui.TextColored(RgbaFloat.Red.ToVector4(), errorMessage);
         }
         ImGui.PopTextWrapPos();
         ImGui.EndTooltip();
     }
     ImGui.PopStyleVar();
 }
예제 #8
0
        /// <inheritdoc/>
        public override void Draw()
        {
            if (ImGui.BeginTabBar("###PlayerTrack_Config_TabBar", ImGuiTabBarFlags.None))
            {
                if (ImGui.BeginTabItem(Loc.Localize("DisplayConfig", "Display")))
                {
                    WindowManager.SpacerWithTabs();
                    this.DisplayConfig();
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("ProcessingConfig", "Processing")))
                {
                    WindowManager.SpacerWithTabs();
                    this.ProcessingConfig();
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("IconConfig", "Icons")))
                {
                    WindowManager.SpacerWithTabs();
                    this.IconConfig();
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("NamePlateConfig", "NamePlates")))
                {
                    WindowManager.SpacerWithTabs();
                    this.NamePlateConfig();
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("IntegrationConfig", "Integrations")))
                {
                    WindowManager.SpacerWithTabs();
                    this.IntegrationsConfig();
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem(Loc.Localize("CategoryConfig", "Categories")))
                {
                    WindowManager.SpacerWithTabs();
                    this.CategoryConfig();
                    ImGui.EndTabItem();
                }

                ImGui.EndTabBar();
            }

            ImGui.Spacing();
        }
예제 #9
0
        public override void Draw()
        {
            ImGui.BeginTabBar("##tabs");
            int idx = typeIndex;

            ImGui.Combo("Type", ref typeIndex, typeNames, typeNames.Length);
            if (idx != typeIndex)
            {
                RecreateCurve();
            }
            if (ImGui.BeginTabItem("Points"))
            {
                ImGui.InputFloat4("Point", ref p);
                if (ImGui.Button("Add"))
                {
                    points.Add(p);
                    p = Vector4.Zero;
                    RecreateCurve();
                }

                ImGui.SameLine();
                if (ImGui.Button("Clear"))
                {
                    points.Clear();
                    RecreateCurve();
                }
                var height = ImGui.GetWindowHeight() - 110;
                ImGui.BeginChild("##points", new Vector2(-1, height), true);
                int ik = 0;
                foreach (var p in points)
                {
                    ImGui.Selectable(ImGuiExt.IDWithExtra(p.ToString(), ik++));
                }
                ImGui.EndChild();


                ImGui.EndTabItem();
            }

            if (ImGui.BeginTabItem("Graph"))
            {
                var gWidth  = ImGui.GetWindowContentRegionWidth() - 40;
                var gHeight = ImGui.GetWindowHeight() - 60;
                ImGui.PlotLines("##graph", ref values[0], values.Length, 0, "", scaleMin, scaleMax, new Vector2(gWidth, gHeight));
                ImGui.EndTabItem();
            }
            ImGui.EndTabBar();
        }
예제 #10
0
        public bool Draw()
        {
            ImGui.SetNextWindowSize(new Vector2(500, 500), ImGuiCond.Always);

            var isOpen = true;

            if (!ImGui.Begin("XIVLauncher Settings", ref isOpen, ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoResize))
            {
                ImGui.End();
                return(false);
            }

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

            if (ImGui.BeginTabBar("SetTabBar"))
            {
                if (ImGui.BeginTabItem("General"))
                {
                    ImGui.Text("General Chat Channel");
                    ImGui.Combo("##XlChatTypeCombo", ref this.dalamudMessagesChatType, this.chatTypes,
                                this.chatTypes.Length);
                    ImGui.TextColored(this.hintTextColor, "Select the chat channel that is to be used for general XIVLauncher messages.");
                }
            }

            ImGui.EndChild();


            if (ImGui.Button("Save"))
            {
                Save();
            }
            ImGui.SameLine();
            if (ImGui.Button("Save and Close"))
            {
                Save();
                isOpen = false;
            }

            ImGui.End();

            return(isOpen);
        }
예제 #11
0
        private int DrawTabs()
        {
            ImGui.BeginTabBar("tabs");

            if (ImGui.TabItemButton("Console"))
            {
                return(-1);
            }

            for (int i = 0; i < indexSelected.Count; i++)
            {
                int index = indexSelected[i];
                if (ImGui.TabItemButton($"{logs[i].type}: {index}", index == currentTab ? ImGuiTabItemFlags.SetSelected : ImGuiTabItemFlags.None))
                {
                    return(index);
                }
            }
            ImGui.EndTabBar();
            return(currentTab);
        }