unsafe void OnVarDragDrop(INodeGraph bp) { ImGuiPayloadPtr pPayload = ImGui.AcceptDragDropPayload("VAR_DRAG"); if (pPayload.NativePtr == null) { return; } int varID = *(int *)pPayload.Data; m_PopupVarGetSet.Show(varID, OnSelectVarGetSet); Logger.Info("Var Drop. ID:" + varID); }
static bool EditVector3(string label, object obj, string properyName) { var input = obj.GetType().GetProperty(properyName); var inputValue = (Syroot.Maths.Vector3F)input.GetValue(obj); var vec3 = new Vector3(inputValue.X, inputValue.Y, inputValue.Z); bool edited = ImGui.InputFloat3(label, ref vec3); if (edited) { input.SetValue(obj, new Syroot.Maths.Vector3F(vec3.X, vec3.Y, vec3.Z)); } return(edited); }
/// <summary> /// Draws a light grey-ish, main-viewport-big filled rect in the background draw list alongside a text indicating gamepad mode. /// </summary> public override void Draw() { var drawList = ImGui.GetBackgroundDrawList(); drawList.PushClipRectFullScreen(); drawList.AddRectFilled(Vector2.Zero, ImGuiHelpers.MainViewport.Size, 0x661A1A1A); drawList.AddText( Vector2.One, 0xFFFFFFFF, Loc.Localize( "DalamudGamepadModeNotifierText", "Gamepad mode is ON. Press L1+L3 to deactivate, press R3 to toggle PluginInstaller.")); drawList.PopClipRect(); }
private void PlayerOverride_NamePlateColorSwatchRow(int min, int max) { ImGui.Spacing(); for (var i = min; i < max; i++) { if (ImGui.ColorButton("###PlayerTrack_PlayerNamePlateColor_Swatch_" + i, this.colorPalette[i])) { this.SelectedPlayer !.NamePlateColor = this.colorPalette[i]; this.plugin.PlayerService.UpdatePlayerNamePlateColor(this.SelectedPlayer); } ImGui.SameLine(); } }
private void DrawIndexedMaterialMenu(MaterialPropsAndBuffer propsAndBuffer) { MaterialProperties props = propsAndBuffer.Properties; float intensity = props.SpecularIntensity.X; float reflectivity = props.Reflectivity; if (ImGui.SliderFloat("Intensity", ref intensity, 0f, 10f, intensity.ToString(), 1f) | ImGui.SliderFloat("Power", ref props.SpecularPower, 0f, 1000f, props.SpecularPower.ToString(), 1f) | ImGui.SliderFloat("Reflectivity", ref props.Reflectivity, 0f, 1f, props.Reflectivity.ToString(), 1f)) { props.SpecularIntensity = new Vector3(intensity); propsAndBuffer.Properties = props; } }
private void DisplayEditor() { ImGui.SetNextWindowPos(new System.Numerics.Vector2(0f, 200f), ImGuiCond.Once); ImGui.SetNextWindowSize(new System.Numerics.Vector2(210f, 200f), ImGuiCond.Always); ImGuiWindowFlags Flags = ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse; Vector4 NameColor = Color.Lime.ToVector4(); Vector4 Blue = Color.CadetBlue.ToVector4(); Vector4 Red = Color.IndianRed.ToVector4(); ImGui.Begin("Selected Unit", Flags); if (SelectedUnit != null) { ImGui.TextColored(new System.Numerics.Vector4(NameColor.X, NameColor.Y, NameColor.Z, NameColor.W), SelectedUnit.Name); ImGui.SameLine(); if (SelectedUnit.Team == Team.Red) { ImGui.TextColored(new System.Numerics.Vector4(Red.X, Red.Y, Red.Z, Red.W), "(Red Team)"); } else if (SelectedUnit.Team == Team.Blue) { ImGui.TextColored(new System.Numerics.Vector4(Blue.X, Blue.Y, Blue.Z, Blue.W), "(Blue Team)"); } ImGui.Separator(); if (ImGui.CollapsingHeader("Stats")) { ImGui.Text("Health - " + SelectedUnit.Stats.Health); ImGui.Text("Attack - " + SelectedUnit.Stats.Attack); ImGui.Text("Defense - " + SelectedUnit.Stats.Defense); ImGui.Text("Attack Range - " + SelectedUnit.Stats.AttackRange); ImGui.Text("Attack Speed - " + SelectedUnit.Stats.AttackSpeed + "s"); ImGui.Text("Critical Chance - " + SelectedUnit.Stats.CriticalChance + "%%"); ImGui.Text("Field Of View - " + SelectedUnit.Stats.FieldOfView); } ImGui.Separator(); if (ImGui.CollapsingHeader("Body")) { ImGui.Text("Velocity - [" + SelectedUnit.Body.Velocity.X.ToString("0.00") + " " + SelectedUnit.Body.Velocity.Y.ToString("0.00") + "]"); ImGui.Text("Max Velocity - " + SelectedUnit.Body.MaxVelocity); ImGui.Text("Interior Radius - " + SelectedUnit.Body.InteriorRadius); ImGui.Text("Exterior Radius - " + SelectedUnit.Body.ExteriorRadius); } } ImGui.End(); }
private static unsafe void DrawButtonShowSettingsPanel() { var Textcolor = *ImGui.GetStyleColorVec4(ImGuiCol.Text); ImGui.SameLine(); if (config.showSettingsPanel) ImGui.PushStyleColor(ImGuiCol.Text, 0x9C60FF8E); else ImGui.PushStyleColor(ImGuiCol.Text, Textcolor); if (ImGui.Button(FontAwesomeIcon.Cog.ToIconString())) config.showSettingsPanel ^= true; ImGui.PopStyleColor(); ToolTip("Toggle settings panel".Localize()); }
/// <summary> /// Recreates the device texture used to render text. /// </summary> public void RecreateFontDeviceTexture() { ImGuiIOPtr io = ImGui.GetIO(); io.Fonts.GetTexDataAsRGBA32(out IntPtr pixels, out int width, out int height, out int bytesPerPixel); _fontTexture = new Texture("ImGui Text Atlas", width, height, pixels); _fontTexture.SetMagFilter(TextureMagFilter.Linear); _fontTexture.SetMinFilter(TextureMinFilter.Linear); io.Fonts.SetTexID((IntPtr)_fontTexture.GLTexture); io.Fonts.ClearTexData(); }
public override void Draw() { foreach (SettingsEntry settingsEntry in Entries) { if (settingsEntry.IsVisible) { settingsEntry.Draw(); } ImGui.Dummy(new Vector2(10) * ImGuiHelpers.GlobalScale); } base.Draw(); }
private static unsafe void DrawButtonShowPlayerControl() { var Textcolor = *ImGui.GetStyleColorVec4(ImGuiCol.Text); ImGui.SameLine(); if (config.showMusicControlPanel) ImGui.PushStyleColor(ImGuiCol.Text, 0x9C60FF8E); else ImGui.PushStyleColor(ImGuiCol.Text, Textcolor); if (ImGui.Button((FontAwesomeIcon.Music).ToIconString())) config.showMusicControlPanel ^= true; ImGui.PopStyleColor(); ToolTip("Toggle player control panel".Localize()); }
public bool Draw() { if (ImGui.TreeNode(_uniq, _name)) { if (_tip != null && ImGui.IsItemHovered()) { ImGui.SetTooltip(_tip); } return(true); } return(false); }
private void BuildModulesMenu(ImGui gui, ref bool closed) { if (model.modules == null) { model.RecordUndo(true).modules = new ModuleFillerParameters(model); } gui.BuildText("Auto modules", Font.subheader); ModuleFillerParametersScreen.BuildSimple(gui, model.modules); if (gui.BuildButton("More settings")) { ModuleFillerParametersScreen.Show(model.modules); closed = true; } }
public bool HeaderValue(ref object value, ToolState state) { var header = string.Empty; var type = value.GetType(); var template = this.Templater.GetTemplate(type); if (template.ValueHeader) { header = value?.ToString() ?? string.Empty; } ImGui.Text(header); return(false); }
private void ListComponents() { ImGui.Checkbox("Show readonly properties", ref ObjectTool.ShowReadOnlyProperties); Tool.BeginTable("components"); if (this.SelectedEntity.HasValue) { var components = this.Components.GetComponents(this.SelectedEntity.Value); foreach (var component in components) { this.DrawComponent(component); } } Tool.EndTable(); }
public override void Draw() { if (groupManager == null) { groupManager = (GroupManager *)Service.SigScanner.GetStaticAddressFromSig("48 8D 0D ?? ?? ?? ?? 44 8B E7"); } DebugManager.ClickToCopyText($"{(ulong) groupManager:X}"); ImGui.SameLine(); DebugManager.PrintOutObject(*groupManager, (ulong)groupManager, new List <string>()); if (groupManager->MemberCount < 1) { ImGui.Text("Not in a party"); } else { ImGui.Text($"Party Member Count: {groupManager->MemberCount}"); var partyMembers = (PartyMember *)groupManager->PartyMembers; for (var i = 0; i < 8 && i < groupManager->MemberCount; i++) { var partyMember = partyMembers[i]; var name = Marshal.PtrToStringAnsi(new IntPtr(partyMember.Name)); ImGui.Text($"[{(ulong)&partyMember:X}] Lv {partyMember.Level}, {partyMember.ObjectID:X}, {name}"); PlayerCharacter chara = null; for (var a = 0; a < Service.Objects.Length; a += 2) { var actor = Service.Objects[a]; if (actor == null) { continue; } if ((uint)actor.ObjectId == partyMember.ObjectID && actor is PlayerCharacter pc) { chara = pc; } } if (chara != null) { DebugManager.PrintOutObject(chara, (ulong)chara.Address.ToInt64(), new List <string>()); } } } }
void DrawInstanceButton(int index, ClassInstance classInstance) { Utils.Caller.Try(() => { if (classInstance.instance != null) { if (ImGui.Selectable(classInstance.name + "##InstanceList" + index)) { //SetNewType(classInstance.type, classInstance.instance); SetNewType(classInstance); } } }); }
protected override void DrawWindowContent() { m_TabBarView.OnGui(); ImGuiView.TableView("##ClassWindowTable", () => { ImGui.TableNextRow(); ImGui.TableNextColumn(); DrawInstanceList(); ImGui.TableNextColumn(); DrawSubViews(); }, 2, ImGuiTableFlags.Resizable); }
private unsafe void UpdateImGuiInput(InputSnapshot snapshot) { IO io = ImGui.GetIO(); Vector2 mousePosition = snapshot.MousePosition; io.MousePosition = mousePosition; io.MouseDown[0] = snapshot.IsMouseDown(MouseButton.Left); io.MouseDown[1] = snapshot.IsMouseDown(MouseButton.Right); io.MouseDown[2] = snapshot.IsMouseDown(MouseButton.Middle); float delta = snapshot.WheelDelta; io.MouseWheel = delta; ImGui.GetIO().MouseWheel = delta; IReadOnlyList <char> keyCharPresses = snapshot.KeyCharPresses; for (int i = 0; i < keyCharPresses.Count; i++) { char c = keyCharPresses[i]; ImGui.AddInputCharacter(c); } IReadOnlyList <KeyEvent> keyEvents = snapshot.KeyEvents; for (int i = 0; i < keyEvents.Count; i++) { KeyEvent keyEvent = keyEvents[i]; io.KeysDown[(int)keyEvent.Key] = keyEvent.Down; if (keyEvent.Key == Key.ControlLeft) { _controlDown = keyEvent.Down; } if (keyEvent.Key == Key.ShiftLeft) { _shiftDown = keyEvent.Down; } if (keyEvent.Key == Key.AltLeft) { _altDown = keyEvent.Down; } } io.CtrlPressed = _controlDown; io.AltPressed = _altDown; io.ShiftPressed = _shiftDown; }
/// <summary> /// Maps ImGui keys to XNA keys. We use this later on to tell ImGui what keys were pressed /// </summary> void SetupInput() { var io = ImGui.GetIO(); #if FNA // forward clipboard methods to SDL io.SetClipboardTextFn = Marshal.GetFunctionPointerForDelegate<SetClipboardTextDelegate>( SetClipboardText ); io.GetClipboardTextFn = Marshal.GetFunctionPointerForDelegate<GetClipboardTextDelegate>( SDL2.SDL.SDL_GetClipboardText ); #endif _keys.Add(io.KeyMap[(int) ImGuiKey.Tab] = (int) Keys.Tab); _keys.Add(io.KeyMap[(int) ImGuiKey.LeftArrow] = (int) Keys.Left); _keys.Add(io.KeyMap[(int) ImGuiKey.RightArrow] = (int) Keys.Right); _keys.Add(io.KeyMap[(int) ImGuiKey.UpArrow] = (int) Keys.Up); _keys.Add(io.KeyMap[(int) ImGuiKey.DownArrow] = (int) Keys.Down); _keys.Add(io.KeyMap[(int) ImGuiKey.PageUp] = (int) Keys.PageUp); _keys.Add(io.KeyMap[(int) ImGuiKey.PageDown] = (int) Keys.PageDown); _keys.Add(io.KeyMap[(int) ImGuiKey.Home] = (int) Keys.Home); _keys.Add(io.KeyMap[(int) ImGuiKey.End] = (int) Keys.End); _keys.Add(io.KeyMap[(int) ImGuiKey.Delete] = (int) Keys.Delete); _keys.Add(io.KeyMap[(int) ImGuiKey.Backspace] = (int) Keys.Back); _keys.Add(io.KeyMap[(int) ImGuiKey.Enter] = (int) Keys.Enter); _keys.Add(io.KeyMap[(int) ImGuiKey.Escape] = (int) Keys.Escape); _keys.Add(io.KeyMap[(int) ImGuiKey.A] = (int) Keys.A); _keys.Add(io.KeyMap[(int) ImGuiKey.C] = (int) Keys.C); _keys.Add(io.KeyMap[(int) ImGuiKey.V] = (int) Keys.V); _keys.Add(io.KeyMap[(int) ImGuiKey.X] = (int) Keys.X); _keys.Add(io.KeyMap[(int) ImGuiKey.Y] = (int) Keys.Y); _keys.Add(io.KeyMap[(int) ImGuiKey.Z] = (int) Keys.Z); #if !FNA Core.Instance.Window.TextInput += (s, a) => { if (a.Character == '\t') return; io.AddInputCharacter(a.Character); }; #else TextInputEXT.TextInput += c => { if( c == '\t' ) return; ImGui.GetIO().AddInputCharacter( c ); }; #endif }
public override void Draw() { if (ImGui.BeginTabBar(Name)) { if (ImGui.BeginTabItem($"Sheet Cache##luminaDebugging")) { cacheField ??= Plugin.PluginInterface.Data.Excel.GetType().GetField("_sheetCache", BindingFlags.Instance | BindingFlags.NonPublic); if (cacheField == null) { ImGui.Text("Missing Field: _sheetCache"); return; } var cache = (Dictionary <Tuple <Language, ulong>, ExcelSheetImpl>)(cacheField.GetValue(Plugin.PluginInterface.Data.Excel)); if (ImGui.Button("Clear all Cache")) { cache.Clear(); } ImGui.Columns(4); Tuple <Language, ulong> delete = null; foreach (var kvp in cache) { ImGui.Text($"{kvp.Key.Item1}"); ImGui.NextColumn(); ImGui.Text($"{kvp.Value.Name}"); ImGui.NextColumn(); ImGui.Text($"{kvp.Key.Item2:X}"); ImGui.NextColumn(); if (ImGui.SmallButton($"Remove##{kvp.Key.Item2}_{kvp.Key.Item1}_{kvp.Value.Name}")) { delete = kvp.Key; } ImGui.NextColumn(); } if (delete != null) { cache.Remove(delete); } ImGui.Columns(); ImGui.EndTabItem(); } ImGui.EndTabBar(); } }
private void DrawPanelGeneralSettings() { //ImGui.SliderInt("Playlist size".Localize(), ref config.playlistSizeY, 2, 50, // config.playlistSizeY.ToString(), ImGuiSliderFlags.AlwaysClamp); //ToolTip("Play list rows number.".Localize()); //ImGui.SliderInt("Player width".Localize(), ref config.playlistSizeX, 356, 1000, config.playlistSizeX.ToString(), ImGuiSliderFlags.AlwaysClamp); //ToolTip("Player window max width.".Localize()); //var inputDevices = InputDevice.GetAll().ToList(); //var currentDeviceInt = inputDevices.FindIndex(device => device == CurrentInputDevice); //if (ImGui.Combo(CurrentInputDevice.ToString(), ref currentDeviceInt, inputDevices.Select(i => $"{i.Id} {i.Name}").ToArray(), inputDevices.Count)) //{ // //CurrentInputDevice.Connect(CurrentOutputDevice); //} if (ImGui.Combo("UI Language".Localize(), ref config.uiLang, uilangStrings, 2)) { localizer = new Localizer((UILang)config.uiLang); } ImGui.Checkbox("Auto open MidiBard".Localize(), ref config.AutoOpenPlayerWhenPerforming); HelpMarker("Open MidiBard window automatically when entering performance mode".Localize()); //ImGui.Checkbox("Auto Confirm Ensemble Ready Check".Localize(), ref config.AutoConfirmEnsembleReadyCheck); //if (localizer.Language == UILang.CN) HelpMarker("在收到合奏准备确认时自动选择确认。"); ImGui.SameLine(ImGui.GetWindowContentRegionWidth() / 2); ImGui.Checkbox("Monitor ensemble".Localize(), ref config.MonitorOnEnsemble); HelpMarker("Auto start ensemble when entering in-game party ensemble mode.".Localize()); ImGui.Checkbox("Auto transpose".Localize(), ref config.autoPitchShift); HelpMarker("Auto transpose notes on demand. If you need this, \nplease add #transpose number# before file name.\nE.g. #-12#demo.mid".Localize()); ImGui.SameLine(ImGui.GetWindowContentRegionWidth() / 2); ImGui.Checkbox("Auto switch instrument".Localize(), ref config.autoSwitchInstrument); HelpMarker("Auto switch instrument on demand. If you need this, \nplease add #instrument name# before file name.\nE.g. #harp#demo.mid".Localize()); ImGui.Checkbox("Override Guitar Tones".Localize(), ref config.OverrideGuitarTones); ImGui.SameLine(ImGui.GetWindowContentRegionWidth() / 2); if (ImGui.Button("Debug info", new Vector2(-1, ImGui.GetFrameHeight()))) Debug = !Debug; //if (ImGui.ColorPicker4("Theme Color", ref config.ThemeColor, ImGuiColorEditFlags.AlphaBar)) //{ //} }
private static Func <bool> DrawBackgroundConfig(Configuration config) { return(() => { var changed = false; var backgroundStyle = (int)config.ImGuiCompassBackground; ImGui.Text("Background"); changed |= ImGui.RadioButton("Filled##ImGui", ref backgroundStyle, 0); ImGui.SameLine(); changed |= ImGui.RadioButton("Border##ImGui", ref backgroundStyle, 1); ImGui.SameLine(); changed |= ImGui.RadioButton("Border Filled##ImGui", ref backgroundStyle, 2); ImGui.SameLine(); changed |= ImGui.RadioButton("Line##ImGui", ref backgroundStyle, 3); if (changed) { config.ImGuiCompassBackground = (ImGuiCompassBackgroundStyle)backgroundStyle; } if (config.ImGuiCompassBackground is ImGuiCompassBackgroundStyle.Filled or ImGuiCompassBackgroundStyle.FilledAndBorder) { changed |= ImGui.ColorEdit4("Fill Colour##ImGui", ref config.ImGuiBackgroundColour); } if (config.ImGuiCompassBackground is ImGuiCompassBackgroundStyle.Border or ImGuiCompassBackgroundStyle.FilledAndBorder) { changed |= ImGui.ColorEdit4("Border Colour##ImGui", ref config.ImGuiBackgroundBorderColour); changed |= ImGui.SliderFloat("Border Thickness##ImGui", ref config.ImGuiBackgroundBorderThickness, 1, 10, "%.f", ImGuiSliderFlags.AlwaysClamp); } if (config.ImGuiCompassBackground is ImGuiCompassBackgroundStyle.Line) { changed |= ImGui.ColorEdit4("Line Colour##ImGui", ref config.ImGuiBackgroundLineColour); changed |= ImGui.SliderFloat("Line Thickness##ImGui", ref config.ImGuiBackgroundLineThickness, 1, 20, "%.f", ImGuiSliderFlags.AlwaysClamp); changed |= ImGui.DragInt("Line Offset##ImGui", ref config.ImGuiCompassBackgroundLineOffset); } if (config.ImGuiCompassBackground is ImGuiCompassBackgroundStyle.Border or ImGuiCompassBackgroundStyle.FilledAndBorder or ImGuiCompassBackgroundStyle.Filled) { changed |= ImGui.SliderFloat("Rounding##ImGui", ref config.ImGuiCompassBackgroundRounding, 0f, 15f, "%.f", ImGuiSliderFlags.AlwaysClamp); } return changed; }); }
internal int FocusIdxTabRequestNext; // " internal ImGuiWindow(string name) { DC = new ImGuiDrawContext(); IDStack = new ImVector <uint>(); StateStorage = new ImGuiStorage(); MenuColumns = new ImGuiSimpleColumns(); DrawList = new ImDrawList(); Name = name; ID = ImGui.Hash(0, name); IDStack.push_back(ID); MoveID = GetID("#MOVE"); Flags = 0; PosFloat = Pos = new ImVec2(0.0f, 0.0f); Size = SizeFull = new ImVec2(0.0f, 0.0f); SizeContents = SizeContentsExplicit = new ImVec2(0.0f, 0.0f); WindowPadding = new ImVec2(0.0f, 0.0f); Scroll = new ImVec2(0.0f, 0.0f); ScrollTarget = new ImVec2(float.MaxValue, float.MaxValue); ScrollTargetCenterRatio = new ImVec2(0.5f, 0.5f); ScrollbarX = ScrollbarY = false; ScrollbarSizes = new ImVec2(0.0f, 0.0f); BorderSize = 0.0f; Active = WasActive = false; Accessed = false; Collapsed = false; SkipItems = false; BeginCount = 0; PopupID = 0; AutoFitFramesX = AutoFitFramesY = -1; AutoFitOnlyGrows = false; AutoPosLastDirection = -1; HiddenFrames = 0; SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = (int)(ImGuiSetCond.ImGuiSetCond_Always | ImGuiSetCond.ImGuiSetCond_Once | ImGuiSetCond.ImGuiSetCond_FirstUseEver | ImGuiSetCond.ImGuiSetCond_Appearing); SetWindowPosCenterWanted = false; LastFrameActive = -1; ItemWidthDefault = 0.0f; FontWindowScale = 1.0f; RootWindow = null; RootNonPopupWindow = null; FocusIdxAllCounter = FocusIdxTabCounter = -1; FocusIdxAllRequestCurrent = FocusIdxTabRequestCurrent = int.MaxValue; FocusIdxAllRequestNext = FocusIdxTabRequestNext = int.MaxValue; }
public override void Start() { Context.Input.SetMouseVisible(true); // Viewport _scene = new Scene(Context); _scene.CreateComponent <Octree>(); _camera = _scene.CreateChild("Camera"); _viewport = new Viewport(Context); _viewport.Scene = _scene; _viewport.Camera = _camera.CreateComponent <Camera>(); Context.Renderer.SetViewport(0, _viewport); // Background Context.Renderer.DefaultZone.FogColor = new Color(0.5f, 0.5f, 0.7f); // Scene _camera.Position = new Vector3(0, 2, -2); _camera.LookAt(Vector3.Zero); // Cube _cube = _scene.CreateChild("Cube"); var model = _cube.CreateComponent <StaticModel>(); model.SetModel(Context.Cache.GetResource <Model>("Models/Box.mdl")); model.SetMaterial(0, Context.Cache.GetResource <Material>("Materials/Stone.xml")); // RotateObject component is implemented in Data/Scripts/RotateObject.cs _cube.CreateComponent("ScriptRotateObject"); // Light _light = _scene.CreateChild("Light"); _light.CreateComponent <Light>(); _light.Position = new Vector3(0, 2, -1); _light.LookAt(Vector3.Zero); SubscribeToEvent(E.Update, args => { var timestep = args[E.Update.TimeStep].Float; Debug.Assert(this != null); if (ImGui.Begin("Urho3D.NET")) { ImGui.TextColored(Color.Red, $"Hello world from C#.\nFrame time: {timestep}"); } ImGui.End(); }); }
private void DrawStatusPanel() { ImGui.BeginChild("statusbar", new Vector2(0, 30), true, 0); ImGui.Text($"{Path.GetFileName(_bigArchive.FilePath)} | Version: {_bigArchive.Version} | Size: {ImGuiUtility.GetFormatedSize(_bigArchive.Size)} | Files: {_bigArchive.Entries.Count}"); ImGui.SameLine(); if (_currentFileName != null) { ImGui.Text($"| Selected file: {_currentFileName}"); } ImGui.EndChild(); // end statusbar }
private void DrawFileContent() { ImGui.BeginChild("content"); if (_currentView != null) { _currentView.Draw(); } else { ImGui.Text("Select a text file to see its contents here."); } ImGui.EndChild(); }
private void Display() { // this is more or less part of what reshade/etc do to avoid having to manually // set the cursor inside the ui // This will just tell ImGui to draw its own software cursor instead of using the hardware cursor // The scene internally will handle hiding and showing the hardware (game) cursor // If the player has the game software cursor enabled, we can't really do anything about that and // they will see both cursors. // Doing this here because it's somewhat application-specific behavior //ImGui.GetIO().MouseDrawCursor = ImGui.GetIO().WantCaptureMouse; this.LastImGuiIoPtr = ImGui.GetIO(); this.lastWantCapture = this.LastImGuiIoPtr.WantCaptureMouse; OnDraw?.Invoke(); }
private static void WindowSizeCallback(Window *window, int width, int height) { ImGuiViewport *viewport = ImGui.FindViewportByPlatformHandle(window); if (viewport is not null) { ViewportData *viewportData = (ViewportData *)viewport->PlatformUserData; if (viewportData is not null && ImGui.GetFrameCount() < viewportData->IgnoreWindowSizeEventFrame + 1) { return; } viewport->PlatformRequestResize = true; } }
public static void SizedText(string text, float width) { ImGui.PushStyleColor(ImGuiCol.Button, Colors.Transparent); ImGui.PushStyleColor(ImGuiCol.ButtonHovered, Colors.Transparent); ImGui.PushStyleColor(ImGuiCol.ButtonActive, Colors.Transparent); var s = ImGui.CalcTextSize(text); ImGui.Text(text); ImGui.SameLine(); if (width > s.X) { ImGui.Button("", new Vector2(width - s.X, 1f)); } ImGui.PopStyleColor(3); }
/// <summary> /// Updates the <see cref="Effect" /> to the current matrices and texture /// </summary> Effect UpdateEffect(Texture2D texture) { _effect = _effect ?? new BasicEffect(Core.GraphicsDevice); var io = ImGui.GetIO(); _effect.World = Matrix.Identity; _effect.View = Matrix.Identity; _effect.Projection = Matrix.CreateOrthographicOffCenter(0, io.DisplaySize.X, io.DisplaySize.Y, 0, -1f, 1f); _effect.TextureEnabled = true; _effect.Texture = texture; _effect.VertexColorEnabled = true; return _effect; }