Compare commits
No commits in common. "c306b5b5de2ea8866bd3401742e71b207ee35476" and "a6f5389545d1d48dbb412e06c84c535dd63a8794" have entirely different histories.
c306b5b5de
...
a6f5389545
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>1.1.0</Version>
|
<Version>1.0.0</Version>
|
||||||
<TargetFramework>net5.0-windows</TargetFramework>
|
<TargetFramework>net5.0-windows</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
@ -47,7 +47,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="DalamudPackager" Version="2.1.5"/>
|
|
||||||
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0"/>
|
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0"/>
|
||||||
<PackageReference Include="Siggingway" Version="1.1.1"/>
|
<PackageReference Include="Siggingway" Version="1.1.1"/>
|
||||||
<PackageReference Include="XivCommon" Version="4.0.0"/>
|
<PackageReference Include="XivCommon" Version="4.0.0"/>
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
name: Chat 2
|
|
||||||
author: ascclemens
|
|
||||||
punchline: Electric Boogaloo - ♪ A whole new chat, a new fantastic chat window ♪
|
|
||||||
description: |-
|
|
||||||
Chat 2 is a complete rewrite of the in-game chat window as a plugin. It
|
|
||||||
supports:
|
|
||||||
|
|
||||||
- Unlimited tabs
|
|
||||||
- Tabs that always send to a certain channel
|
|
||||||
- More flexible filtering
|
|
||||||
- RGB channel colouring
|
|
||||||
- Completely variable font size
|
|
||||||
- Sidebar tabs
|
|
||||||
- Unread counts
|
|
||||||
- Screenshot mode (obfuscate names)
|
|
||||||
repo_url: https://git.annaclemens.io/ascclemens/ChatTwo
|
|
@ -40,7 +40,7 @@ internal class Tab {
|
|||||||
return this.ChatCodes.TryGetValue(message.Code.Type, out var sources) && (message.Code.Source is 0 or (ChatSource) 1 || sources.HasFlag(message.Code.Source));
|
return this.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) {
|
||||||
this.MessagesMutex.WaitOne();
|
this.MessagesMutex.WaitOne();
|
||||||
this.Messages.Add(message);
|
this.Messages.Add(message);
|
||||||
if (this.Messages.Count > 1000) {
|
if (this.Messages.Count > 1000) {
|
||||||
@ -49,10 +49,8 @@ internal class Tab {
|
|||||||
|
|
||||||
this.MessagesMutex.ReleaseMutex();
|
this.MessagesMutex.ReleaseMutex();
|
||||||
|
|
||||||
if (unread) {
|
|
||||||
this.Unread += 1;
|
this.Unread += 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
internal Tab Clone() {
|
internal Tab Clone() {
|
||||||
return new Tab {
|
return new Tab {
|
||||||
|
@ -75,17 +75,17 @@ internal class Store : IDisposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void FilterAllTabs(bool unread = true) {
|
internal void FilterAllTabs() {
|
||||||
foreach (var tab in this.Plugin.Config.Tabs) {
|
foreach (var tab in this.Plugin.Config.Tabs) {
|
||||||
this.FilterTab(tab, unread);
|
this.FilterTab(tab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void FilterTab(Tab tab, bool unread) {
|
internal void FilterTab(Tab tab) {
|
||||||
using var messages = this.GetMessages();
|
using var messages = this.GetMessages();
|
||||||
foreach (var message in messages.Messages) {
|
foreach (var message in messages.Messages) {
|
||||||
if (tab.Matches(message)) {
|
if (tab.Matches(message)) {
|
||||||
tab.AddMessage(message, unread);
|
tab.AddMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
using ChatTwo.Code;
|
using ChatTwo.Code;
|
||||||
using ChatTwo.Util;
|
using ChatTwo.Util;
|
||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
using Dalamud.Interface;
|
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
|
|
||||||
namespace ChatTwo.Ui;
|
namespace ChatTwo.Ui;
|
||||||
@ -87,33 +86,16 @@ internal sealed class Settings : IUiComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.TreeNodeEx("Tabs")) {
|
if (ImGui.TreeNodeEx("Tabs")) {
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.Plus, tooltip: "Add")) {
|
if (ImGui.Button("Add")) {
|
||||||
this._tabs.Add(new Tab());
|
this._tabs.Add(new Tab());
|
||||||
}
|
}
|
||||||
|
|
||||||
var toRemove = -1;
|
|
||||||
for (var i = 0; i < this._tabs.Count; i++) {
|
for (var i = 0; i < this._tabs.Count; i++) {
|
||||||
var tab = this._tabs[i];
|
var tab = this._tabs[i];
|
||||||
|
|
||||||
if (ImGui.TreeNodeEx($"{tab.Name}###tab-{i}")) {
|
if (ImGui.TreeNodeEx($"{tab.Name}###tab-{i}")) {
|
||||||
ImGui.PushID($"tab-{i}");
|
ImGui.PushID($"tab-{i}");
|
||||||
|
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.TrashAlt, tooltip: "Delete")) {
|
|
||||||
toRemove = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.ArrowUp, tooltip: "Move up") && i > 0) {
|
|
||||||
(this._tabs[i - 1], this._tabs[i]) = (this._tabs[i], this._tabs[i - 1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.ArrowDown, tooltip: "Move down") && i < this._tabs.Count - 1) {
|
|
||||||
(this._tabs[i + 1], this._tabs[i]) = (this._tabs[i], this._tabs[i + 1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.InputText("Name", ref tab.Name, 512, ImGuiInputTextFlags.EnterReturnsTrue);
|
ImGui.InputText("Name", ref tab.Name, 512, ImGuiInputTextFlags.EnterReturnsTrue);
|
||||||
ImGui.Checkbox("Show unread count", ref tab.DisplayUnread);
|
ImGui.Checkbox("Show unread count", ref tab.DisplayUnread);
|
||||||
ImGui.Checkbox("Show timestamps", ref tab.DisplayTimestamp);
|
ImGui.Checkbox("Show timestamps", ref tab.DisplayTimestamp);
|
||||||
@ -125,7 +107,7 @@ internal sealed class Settings : IUiComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (var channel in Enum.GetValues<InputChannel>()) {
|
foreach (var channel in Enum.GetValues<InputChannel>()) {
|
||||||
if (ImGui.Selectable(channel.ToChatType().Name(), tab.Channel == channel)) {
|
if (ImGui.Selectable(channel.ToChatType().Name() ?? "???", tab.Channel == channel)) {
|
||||||
tab.Channel = channel;
|
tab.Channel = channel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,10 +151,6 @@ internal sealed class Settings : IUiComponent {
|
|||||||
ImGui.PopID();
|
ImGui.PopID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toRemove > -1) {
|
|
||||||
this._tabs.RemoveAt(toRemove);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.EndChild();
|
ImGui.EndChild();
|
||||||
@ -212,7 +190,7 @@ internal sealed class Settings : IUiComponent {
|
|||||||
|
|
||||||
this.Ui.Plugin.SaveConfig();
|
this.Ui.Plugin.SaveConfig();
|
||||||
|
|
||||||
this.Ui.Plugin.Store.FilterAllTabs(false);
|
this.Ui.Plugin.Store.FilterAllTabs();
|
||||||
|
|
||||||
if (fontSizeChanged) {
|
if (fontSizeChanged) {
|
||||||
this.Ui.Plugin.Interface.UiBuilder.RebuildFonts();
|
this.Ui.Plugin.Interface.UiBuilder.RebuildFonts();
|
||||||
|
@ -81,7 +81,7 @@ internal static class ImGuiUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static bool IconButton(FontAwesomeIcon icon, string? id = null, string? tooltip = null) {
|
internal static bool IconButton(FontAwesomeIcon icon, string? id = null) {
|
||||||
ImGui.PushFont(UiBuilder.IconFont);
|
ImGui.PushFont(UiBuilder.IconFont);
|
||||||
|
|
||||||
var label = icon.ToIconString();
|
var label = icon.ToIconString();
|
||||||
@ -93,12 +93,6 @@ internal static class ImGuiUtil {
|
|||||||
|
|
||||||
ImGui.PopFont();
|
ImGui.PopFont();
|
||||||
|
|
||||||
if (tooltip != null && ImGui.IsItemHovered()) {
|
|
||||||
ImGui.BeginTooltip();
|
|
||||||
ImGui.TextUnformatted(tooltip);
|
|
||||||
ImGui.EndTooltip();
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user