@@ -20,6 +20,7 @@ internal class Configuration : IPluginConfiguration
|
||||
public bool HideWhenUiHidden = true;
|
||||
public bool HideInLoadingScreens;
|
||||
public bool HideInBattle;
|
||||
public bool ShowCloseButton = true;
|
||||
public bool NativeItemTooltips = true;
|
||||
public bool PrettierTimestamps = true;
|
||||
public bool MoreCompactPretty;
|
||||
|
||||
Generated
+18
@@ -2831,6 +2831,24 @@ namespace ChatTwo.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Show a close button next to the settings button. The chat window can be returned by pressing return or slash to focus it..
|
||||
/// </summary>
|
||||
internal static string Options_ShowCloseButton_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_ShowCloseButton_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Show close button.
|
||||
/// </summary>
|
||||
internal static string Options_ShowCloseButton_Name {
|
||||
get {
|
||||
return ResourceManager.GetString("Options_ShowCloseButton_Name", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Replaces words with their emote version, currently supports BetterTTV..
|
||||
/// </summary>
|
||||
|
||||
@@ -163,6 +163,12 @@
|
||||
<data name="Options_ShowNoviceNetwork_Description">
|
||||
<value>Show the Novice Network join button next to the settings button if logged in as a mentor.</value>
|
||||
</data>
|
||||
<data name="Options_ShowCloseButton_Name" xml:space="preserve">
|
||||
<value>Show close button</value>
|
||||
</data>
|
||||
<data name="Options_ShowCloseButton_Description" xml:space="preserve">
|
||||
<value>Show a close button next to the settings button. The chat window can be returned by pressing return or slash to focus it.</value>
|
||||
</data>
|
||||
<data name="Options_FontSize_Name">
|
||||
<value>Font size</value>
|
||||
</data>
|
||||
|
||||
@@ -662,7 +662,8 @@ public sealed class ChatLogWindow : Window
|
||||
|
||||
var buttonWidth = afterIcon.X - beforeIcon.X;
|
||||
var showNovice = Plugin.Config.ShowNoviceNetwork && GameFunctions.GameFunctions.IsMentor();
|
||||
var inputWidth = ImGui.GetContentRegionAvail().X - buttonWidth * (showNovice ? 2 : 1);
|
||||
var buttonsRight = (showNovice ? 1 : 0) + (Plugin.Config.ShowCloseButton ? 1 : 0);
|
||||
var inputWidth = ImGui.GetContentRegionAvail().X - buttonWidth * (1 + buttonsRight);
|
||||
|
||||
var inputType = TempChannel?.ToChatType() ?? activeTab?.Channel?.ToChatType() ?? Plugin.Functions.Chat.Channel.Channel.ToChatType();
|
||||
var isCommand = Chat.Trim().StartsWith('/');
|
||||
@@ -774,9 +775,16 @@ public sealed class ChatLogWindow : Window
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.Cog))
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.Cog, width: (int)buttonWidth))
|
||||
Plugin.SettingsWindow.Toggle();
|
||||
|
||||
if (Plugin.Config.ShowCloseButton)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.Times, width: (int)buttonWidth))
|
||||
UserHide();
|
||||
}
|
||||
|
||||
if (!showNovice)
|
||||
return;
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ internal sealed class ChatLog : ISettingsTab
|
||||
ImGuiUtil.OptionCheckbox(ref Mutable.ShowNoviceNetwork, Language.Options_ShowNoviceNetwork_Name, Language.Options_ShowNoviceNetwork_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref Mutable.ShowCloseButton, Language.Options_ShowCloseButton_Name, Language.Options_ShowCloseButton_Description);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref Mutable.NativeItemTooltips, Language.Options_NativeItemTooltips_Name, string.Format(Language.Options_NativeItemTooltips_Description, Plugin.PluginName));
|
||||
ImGui.Spacing();
|
||||
|
||||
|
||||
@@ -172,14 +172,20 @@ internal static class ImGuiUtil
|
||||
return textEnd;
|
||||
}
|
||||
|
||||
internal static bool IconButton(FontAwesomeIcon icon, string? id = null, string? tooltip = null)
|
||||
internal static bool IconButton(FontAwesomeIcon icon, string? id = null, string? tooltip = null, int width = 0)
|
||||
{
|
||||
var label = icon.ToIconString();
|
||||
if (id != null)
|
||||
label += $"##{id}";
|
||||
|
||||
Plugin.FontManager.FontAwesome.Push();
|
||||
var ret = ImGui.Button(label);
|
||||
var size = new Vector2(0, 0);
|
||||
if (width > 0)
|
||||
{
|
||||
var style = ImGui.GetStyle();
|
||||
size.X = width - 2 * style.CellPadding.X;
|
||||
}
|
||||
var ret = ImGui.Button(label, size);
|
||||
Plugin.FontManager.FontAwesome.Pop();
|
||||
|
||||
if (tooltip != null && ImGui.IsItemHovered())
|
||||
|
||||
Reference in New Issue
Block a user