Add user configurable tooltip offset
This commit is contained in:
+71
-69
@@ -45,6 +45,7 @@ internal class Configuration : IPluginConfiguration {
|
|||||||
public string GlobalFont = Fonts.GlobalFonts[0].Name;
|
public string GlobalFont = Fonts.GlobalFonts[0].Name;
|
||||||
public string JapaneseFont = Fonts.JapaneseFonts[0].Item1;
|
public string JapaneseFont = Fonts.JapaneseFonts[0].Item1;
|
||||||
|
|
||||||
|
public float TooltipOffset = 10f;
|
||||||
public float WindowAlpha = 100f;
|
public float WindowAlpha = 100f;
|
||||||
public Dictionary<ChatType, uint> ChatColours = new();
|
public Dictionary<ChatType, uint> ChatColours = new();
|
||||||
public List<Tab> Tabs = new();
|
public List<Tab> Tabs = new();
|
||||||
@@ -52,50 +53,51 @@ internal class Configuration : IPluginConfiguration {
|
|||||||
public uint DatabaseMigration = LatestDbVersion;
|
public uint DatabaseMigration = LatestDbVersion;
|
||||||
|
|
||||||
internal void UpdateFrom(Configuration other) {
|
internal void UpdateFrom(Configuration other) {
|
||||||
this.HideChat = other.HideChat;
|
HideChat = other.HideChat;
|
||||||
this.HideDuringCutscenes = other.HideDuringCutscenes;
|
HideDuringCutscenes = other.HideDuringCutscenes;
|
||||||
this.HideWhenNotLoggedIn = other.HideWhenNotLoggedIn;
|
HideWhenNotLoggedIn = other.HideWhenNotLoggedIn;
|
||||||
this.HideWhenUiHidden = other.HideWhenUiHidden;
|
HideWhenUiHidden = other.HideWhenUiHidden;
|
||||||
this.NativeItemTooltips = other.NativeItemTooltips;
|
NativeItemTooltips = other.NativeItemTooltips;
|
||||||
this.PrettierTimestamps = other.PrettierTimestamps;
|
PrettierTimestamps = other.PrettierTimestamps;
|
||||||
this.MoreCompactPretty = other.MoreCompactPretty;
|
MoreCompactPretty = other.MoreCompactPretty;
|
||||||
this.HideSameTimestamps = other.HideSameTimestamps;
|
HideSameTimestamps = other.HideSameTimestamps;
|
||||||
this.ShowNoviceNetwork = other.ShowNoviceNetwork;
|
ShowNoviceNetwork = other.ShowNoviceNetwork;
|
||||||
this.SidebarTabView = other.SidebarTabView;
|
SidebarTabView = other.SidebarTabView;
|
||||||
this.CommandHelpSide = other.CommandHelpSide;
|
CommandHelpSide = other.CommandHelpSide;
|
||||||
this.KeybindMode = other.KeybindMode;
|
KeybindMode = other.KeybindMode;
|
||||||
this.LanguageOverride = other.LanguageOverride;
|
LanguageOverride = other.LanguageOverride;
|
||||||
this.CanMove = other.CanMove;
|
CanMove = other.CanMove;
|
||||||
this.CanResize = other.CanResize;
|
CanResize = other.CanResize;
|
||||||
this.ShowTitleBar = other.ShowTitleBar;
|
ShowTitleBar = other.ShowTitleBar;
|
||||||
this.ShowPopOutTitleBar = other.ShowPopOutTitleBar;
|
ShowPopOutTitleBar = other.ShowPopOutTitleBar;
|
||||||
this.DatabaseBattleMessages = other.DatabaseBattleMessages;
|
DatabaseBattleMessages = other.DatabaseBattleMessages;
|
||||||
this.LoadPreviousSession = other.LoadPreviousSession;
|
LoadPreviousSession = other.LoadPreviousSession;
|
||||||
this.FilterIncludePreviousSessions = other.FilterIncludePreviousSessions;
|
FilterIncludePreviousSessions = other.FilterIncludePreviousSessions;
|
||||||
this.SharedMode = other.SharedMode;
|
SharedMode = other.SharedMode;
|
||||||
this.SortAutoTranslate = other.SortAutoTranslate;
|
SortAutoTranslate = other.SortAutoTranslate;
|
||||||
this.CollapseDuplicateMessages = other.CollapseDuplicateMessages;
|
CollapseDuplicateMessages = other.CollapseDuplicateMessages;
|
||||||
this.FontsEnabled = other.FontsEnabled;
|
FontsEnabled = other.FontsEnabled;
|
||||||
this.ExtraGlyphRanges = other.ExtraGlyphRanges;
|
ExtraGlyphRanges = other.ExtraGlyphRanges;
|
||||||
this.FontSize = other.FontSize;
|
FontSize = other.FontSize;
|
||||||
this.JapaneseFontSize = other.JapaneseFontSize;
|
JapaneseFontSize = other.JapaneseFontSize;
|
||||||
this.SymbolsFontSize = other.SymbolsFontSize;
|
SymbolsFontSize = other.SymbolsFontSize;
|
||||||
this.GlobalFont = other.GlobalFont;
|
GlobalFont = other.GlobalFont;
|
||||||
this.JapaneseFont = other.JapaneseFont;
|
JapaneseFont = other.JapaneseFont;
|
||||||
this.WindowAlpha = other.WindowAlpha;
|
TooltipOffset = other.TooltipOffset;
|
||||||
this.ChatColours = other.ChatColours.ToDictionary(entry => entry.Key, entry => entry.Value);
|
WindowAlpha = other.WindowAlpha;
|
||||||
this.Tabs = other.Tabs.Select(t => t.Clone()).ToList();
|
ChatColours = other.ChatColours.ToDictionary(entry => entry.Key, entry => entry.Value);
|
||||||
this.DatabaseMigration = other.DatabaseMigration;
|
Tabs = other.Tabs.Select(t => t.Clone()).ToList();
|
||||||
|
DatabaseMigration = other.DatabaseMigration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Migrate() {
|
public void Migrate() {
|
||||||
var loop = true;
|
var loop = true;
|
||||||
while (loop && this.Version < LatestVersion) {
|
while (loop && Version < LatestVersion) {
|
||||||
switch (this.Version) {
|
switch (Version) {
|
||||||
case 1: {
|
case 1: {
|
||||||
this.Version = 2;
|
Version = 2;
|
||||||
|
|
||||||
foreach (var tab in this.Tabs) {
|
foreach (var tab in Tabs) {
|
||||||
#pragma warning disable CS0618
|
#pragma warning disable CS0618
|
||||||
tab.UnreadMode = tab.DisplayUnread ? UnreadMode.Unseen : UnreadMode.None;
|
tab.UnreadMode = tab.DisplayUnread ? UnreadMode.Unseen : UnreadMode.None;
|
||||||
#pragma warning restore CS0618
|
#pragma warning restore CS0618
|
||||||
@@ -104,26 +106,26 @@ internal class Configuration : IPluginConfiguration {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
this.Version = 3;
|
Version = 3;
|
||||||
|
|
||||||
this.JapaneseFontSize = this.FontSize;
|
JapaneseFontSize = FontSize;
|
||||||
this.SymbolsFontSize = this.FontSize;
|
SymbolsFontSize = FontSize;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
this.Version = 4;
|
Version = 4;
|
||||||
|
|
||||||
this.WindowAlpha *= 100f;
|
WindowAlpha *= 100f;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
this.Version = 5;
|
Version = 5;
|
||||||
|
|
||||||
foreach (var tab in this.Tabs) {
|
foreach (var tab in Tabs) {
|
||||||
tab.ExtraChatAll = true;
|
tab.ExtraChatAll = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Plugin.Log.Warning($"Couldn't migrate config version {this.Version}");
|
Plugin.Log.Warning($"Couldn't migrate config version {Version}");
|
||||||
loop = false;
|
loop = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -181,53 +183,53 @@ internal class Tab {
|
|||||||
public List<Message> Messages = new();
|
public List<Message> Messages = new();
|
||||||
|
|
||||||
~Tab() {
|
~Tab() {
|
||||||
this.MessagesMutex.Dispose();
|
MessagesMutex.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool Matches(Message message) {
|
internal bool Matches(Message message) {
|
||||||
if (message.ExtraChatChannel != Guid.Empty) {
|
if (message.ExtraChatChannel != Guid.Empty) {
|
||||||
return this.ExtraChatAll || this.ExtraChatChannels.Contains(message.ExtraChatChannel);
|
return ExtraChatAll || ExtraChatChannels.Contains(message.ExtraChatChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
return message.Code.Type.IsGm()
|
return message.Code.Type.IsGm()
|
||||||
|| this.ChatCodes.TryGetValue(message.Code.Type, out var sources) && (message.Code.Source is 0 or (ChatSource) 1 || sources.HasFlag(message.Code.Source));
|
|| ChatCodes.TryGetValue(message.Code.Type, out var sources) && (message.Code.Source is 0 or (ChatSource) 1 || sources.HasFlag(message.Code.Source));
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void AddMessage(Message message, bool unread = true) {
|
internal void AddMessage(Message message, bool unread = true) {
|
||||||
this.MessagesMutex.Wait();
|
MessagesMutex.Wait();
|
||||||
this.Messages.Add(message);
|
Messages.Add(message);
|
||||||
while (this.Messages.Count > Store.MessagesLimit) {
|
while (Messages.Count > Store.MessagesLimit) {
|
||||||
this.Messages.RemoveAt(0);
|
Messages.RemoveAt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.MessagesMutex.Release();
|
MessagesMutex.Release();
|
||||||
|
|
||||||
if (unread) {
|
if (unread) {
|
||||||
this.Unread += 1;
|
Unread += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void Clear() {
|
internal void Clear() {
|
||||||
this.MessagesMutex.Wait();
|
MessagesMutex.Wait();
|
||||||
this.Messages.Clear();
|
Messages.Clear();
|
||||||
this.MessagesMutex.Release();
|
MessagesMutex.Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal Tab Clone() {
|
internal Tab Clone() {
|
||||||
return new Tab {
|
return new Tab {
|
||||||
Name = this.Name,
|
Name = Name,
|
||||||
ChatCodes = this.ChatCodes.ToDictionary(entry => entry.Key, entry => entry.Value),
|
ChatCodes = ChatCodes.ToDictionary(entry => entry.Key, entry => entry.Value),
|
||||||
ExtraChatAll = this.ExtraChatAll,
|
ExtraChatAll = ExtraChatAll,
|
||||||
ExtraChatChannels = this.ExtraChatChannels.ToHashSet(),
|
ExtraChatChannels = ExtraChatChannels.ToHashSet(),
|
||||||
#pragma warning disable CS0618
|
#pragma warning disable CS0618
|
||||||
DisplayUnread = this.DisplayUnread,
|
DisplayUnread = DisplayUnread,
|
||||||
#pragma warning restore CS0618
|
#pragma warning restore CS0618
|
||||||
UnreadMode = this.UnreadMode,
|
UnreadMode = UnreadMode,
|
||||||
DisplayTimestamp = this.DisplayTimestamp,
|
DisplayTimestamp = DisplayTimestamp,
|
||||||
Channel = this.Channel,
|
Channel = Channel,
|
||||||
PopOut = this.PopOut,
|
PopOut = PopOut,
|
||||||
IndependentOpacity = this.IndependentOpacity,
|
IndependentOpacity = IndependentOpacity,
|
||||||
Opacity = this.Opacity,
|
Opacity = Opacity,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ public sealed class PayloadHandler {
|
|||||||
|
|
||||||
var x = isLeft ? window.X : LogWindow.LastWindowPos.X - atkSize.X;
|
var x = isLeft ? window.X : LogWindow.LastWindowPos.X - atkSize.X;
|
||||||
var y = Math.Clamp(window.Y - atkSize.Y, 0, float.MaxValue);
|
var y = Math.Clamp(window.Y - atkSize.Y, 0, float.MaxValue);
|
||||||
y -= isTop ? 0 : 10; // small offset to prevent cut-off on the bottom
|
y -= isTop ? 0 : LogWindow.Plugin.Config.TooltipOffset; // offset to prevent cut-off on the bottom
|
||||||
atk->SetPosition((short) x, (short) y);
|
atk->SetPosition((short) x, (short) y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Generated
+18
@@ -2165,6 +2165,24 @@ namespace ChatTwo.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Use this option if you experience cut-off tooltips..
|
||||||
|
/// </summary>
|
||||||
|
internal static string Options_TooltipOffset_Desc {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Options_TooltipOffset_Desc", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Tooltip offset .
|
||||||
|
/// </summary>
|
||||||
|
internal static string Options_TooltipOffset_Name {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Options_TooltipOffset_Name", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Window opacity.
|
/// Looks up a localized string similar to Window opacity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -865,4 +865,10 @@
|
|||||||
<data name="Context_AdventurerPlateError" xml:space="preserve">
|
<data name="Context_AdventurerPlateError" xml:space="preserve">
|
||||||
<value>Unable to open adventurer plate at this moment</value>
|
<value>Unable to open adventurer plate at this moment</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Options_TooltipOffset_Name" xml:space="preserve">
|
||||||
|
<value>Tooltip offset </value>
|
||||||
|
</data>
|
||||||
|
<data name="Options_TooltipOffset_Desc" xml:space="preserve">
|
||||||
|
<value>Use this option if you experience cut-off tooltips.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -10,80 +10,83 @@ internal sealed class Display : ISettingsTab {
|
|||||||
public string Name => Language.Options_Display_Tab + "###tabs-display";
|
public string Name => Language.Options_Display_Tab + "###tabs-display";
|
||||||
|
|
||||||
internal Display(Configuration mutable) {
|
internal Display(Configuration mutable) {
|
||||||
this.Mutable = mutable;
|
Mutable = mutable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Draw(bool changed) {
|
public void Draw(bool changed) {
|
||||||
ImGui.PushTextWrapPos();
|
ImGui.PushTextWrapPos();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.HideChat, Language.Options_HideChat_Name, Language.Options_HideChat_Description);
|
ImGuiUtil.OptionCheckbox(ref Mutable.HideChat, Language.Options_HideChat_Name, Language.Options_HideChat_Description);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(
|
ImGuiUtil.OptionCheckbox(
|
||||||
ref this.Mutable.HideDuringCutscenes,
|
ref Mutable.HideDuringCutscenes,
|
||||||
Language.Options_HideDuringCutscenes_Name,
|
Language.Options_HideDuringCutscenes_Name,
|
||||||
string.Format(Language.Options_HideDuringCutscenes_Description, Plugin.PluginName)
|
string.Format(Language.Options_HideDuringCutscenes_Description, Plugin.PluginName)
|
||||||
);
|
);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(
|
ImGuiUtil.OptionCheckbox(
|
||||||
ref this.Mutable.HideWhenNotLoggedIn,
|
ref Mutable.HideWhenNotLoggedIn,
|
||||||
Language.Options_HideWhenNotLoggedIn_Name,
|
Language.Options_HideWhenNotLoggedIn_Name,
|
||||||
string.Format(Language.Options_HideWhenNotLoggedIn_Description, Plugin.PluginName)
|
string.Format(Language.Options_HideWhenNotLoggedIn_Description, Plugin.PluginName)
|
||||||
);
|
);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(
|
ImGuiUtil.OptionCheckbox(
|
||||||
ref this.Mutable.HideWhenUiHidden,
|
ref Mutable.HideWhenUiHidden,
|
||||||
Language.Options_HideWhenUiHidden_Name,
|
Language.Options_HideWhenUiHidden_Name,
|
||||||
string.Format(Language.Options_HideWhenUiHidden_Description, Plugin.PluginName)
|
string.Format(Language.Options_HideWhenUiHidden_Description, Plugin.PluginName)
|
||||||
);
|
);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(
|
ImGuiUtil.OptionCheckbox(
|
||||||
ref this.Mutable.NativeItemTooltips,
|
ref Mutable.NativeItemTooltips,
|
||||||
Language.Options_NativeItemTooltips_Name,
|
Language.Options_NativeItemTooltips_Name,
|
||||||
string.Format(Language.Options_NativeItemTooltips_Description, Plugin.PluginName)
|
string.Format(Language.Options_NativeItemTooltips_Description, Plugin.PluginName)
|
||||||
);
|
);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(
|
ImGuiUtil.OptionCheckbox(
|
||||||
ref this.Mutable.SidebarTabView,
|
ref Mutable.SidebarTabView,
|
||||||
Language.Options_SidebarTabView_Name,
|
Language.Options_SidebarTabView_Name,
|
||||||
string.Format(Language.Options_SidebarTabView_Description, Plugin.PluginName)
|
string.Format(Language.Options_SidebarTabView_Description, Plugin.PluginName)
|
||||||
);
|
);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.PrettierTimestamps, Language.Options_PrettierTimestamps_Name, Language.Options_PrettierTimestamps_Description);
|
ImGuiUtil.OptionCheckbox(ref Mutable.PrettierTimestamps, Language.Options_PrettierTimestamps_Name, Language.Options_PrettierTimestamps_Description);
|
||||||
|
|
||||||
if (this.Mutable.PrettierTimestamps) {
|
if (Mutable.PrettierTimestamps) {
|
||||||
ImGui.TreePush();
|
ImGui.TreePush();
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.MoreCompactPretty, Language.Options_MoreCompactPretty_Name, Language.Options_MoreCompactPretty_Description);
|
ImGuiUtil.OptionCheckbox(ref Mutable.MoreCompactPretty, Language.Options_MoreCompactPretty_Name, Language.Options_MoreCompactPretty_Description);
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.HideSameTimestamps, Language.Options_HideSameTimestamps_Name, Language.Options_HideSameTimestamps_Description);
|
ImGuiUtil.OptionCheckbox(ref Mutable.HideSameTimestamps, Language.Options_HideSameTimestamps_Name, Language.Options_HideSameTimestamps_Description);
|
||||||
ImGui.TreePop();
|
ImGui.TreePop();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.CollapseDuplicateMessages, Language.Options_CollapseDuplicateMessages_Name, Language.Options_CollapseDuplicateMessages_Description);
|
ImGuiUtil.OptionCheckbox(ref Mutable.CollapseDuplicateMessages, Language.Options_CollapseDuplicateMessages_Name, Language.Options_CollapseDuplicateMessages_Description);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.ShowNoviceNetwork, Language.Options_ShowNoviceNetwork_Name, Language.Options_ShowNoviceNetwork_Description);
|
ImGuiUtil.OptionCheckbox(ref Mutable.ShowNoviceNetwork, Language.Options_ShowNoviceNetwork_Name, Language.Options_ShowNoviceNetwork_Description);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.DragFloatVertical(Language.Options_WindowOpacity_Name, ref this.Mutable.WindowAlpha, .25f, 0f, 100f, $"{this.Mutable.WindowAlpha:N2}%%", ImGuiSliderFlags.AlwaysClamp);
|
ImGuiUtil.DragFloatVertical(Language.Options_TooltipOffset_Name, Language.Options_TooltipOffset_Desc, ref Mutable.TooltipOffset, 1, 0f, 400f, $"{Mutable.TooltipOffset:N0}px", ImGuiSliderFlags.AlwaysClamp);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.CanMove, Language.Options_CanMove_Name);
|
ImGuiUtil.DragFloatVertical(Language.Options_WindowOpacity_Name, ref Mutable.WindowAlpha, .25f, 0f, 100f, $"{Mutable.WindowAlpha:N2}%%", ImGuiSliderFlags.AlwaysClamp);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.CanResize, Language.Options_CanResize_Name);
|
ImGuiUtil.OptionCheckbox(ref Mutable.CanMove, Language.Options_CanMove_Name);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.ShowTitleBar, Language.Options_ShowTitleBar_Name);
|
ImGuiUtil.OptionCheckbox(ref Mutable.CanResize, Language.Options_CanResize_Name);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.ShowPopOutTitleBar, Language.Options_ShowPopOutTitleBar_Name);
|
ImGuiUtil.OptionCheckbox(ref Mutable.ShowTitleBar, Language.Options_ShowTitleBar_Name);
|
||||||
|
ImGui.Spacing();
|
||||||
|
|
||||||
|
ImGuiUtil.OptionCheckbox(ref Mutable.ShowPopOutTitleBar, Language.Options_ShowPopOutTitleBar_Name);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
ImGui.PopTextWrapPos();
|
ImGui.PopTextWrapPos();
|
||||||
|
|||||||
@@ -225,6 +225,15 @@ internal static class ImGuiUtil {
|
|||||||
return ImGui.DragFloat($"##{label}", ref value, vSpeed, vMin, vMax, format, flags);
|
return ImGui.DragFloat($"##{label}", ref value, vSpeed, vMin, vMax, format, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static bool DragFloatVertical(string label, string description, ref float value, float vSpeed = 1.0f, float vMin = float.MinValue, float vMax = float.MaxValue, string? format = null, ImGuiSliderFlags flags = ImGuiSliderFlags.None) {
|
||||||
|
ImGui.TextUnformatted(label);
|
||||||
|
ImGui.SetNextItemWidth(-1);
|
||||||
|
var r = ImGui.DragFloat($"##{label}", ref value, vSpeed, vMin, vMax, format, flags);
|
||||||
|
HelpText(description);
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
internal static bool TryToImGui(this VirtualKey key, out ImGuiKey result) {
|
internal static bool TryToImGui(this VirtualKey key, out ImGuiKey result) {
|
||||||
result = key switch {
|
result = key switch {
|
||||||
VirtualKey.NO_KEY => ImGuiKey.None,
|
VirtualKey.NO_KEY => ImGuiKey.None,
|
||||||
|
|||||||
Reference in New Issue
Block a user