Compare commits
10 Commits
1.42.0.69-
...
detached
| Author | SHA1 | Date | |
|---|---|---|---|
| e9b7eb47c0 | |||
|
|
ac8270e4ad | ||
|
|
4d0bf2d57e | ||
| 7f74f88302 | |||
|
|
934cdfbcf0 | ||
|
|
d2a68e6533 | ||
| 20008f904d | |||
|
|
54b50886c0 | ||
|
|
234fe5d360 | ||
|
|
05770d9a5b |
@@ -6,7 +6,9 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
PLUGIN_NAME: LightlessSync
|
PLUGIN_NAME: LightlessSync
|
||||||
DOTNET_VERSION: 10.x.x
|
DOTNET_VERSION: |
|
||||||
|
10.x.x
|
||||||
|
9.x.x
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tag-and-release:
|
tag-and-release:
|
||||||
@@ -19,12 +21,14 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: true
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup .NET 10 SDK
|
- name: Setup .NET 10 SDK
|
||||||
uses: actions/setup-dotnet@v5
|
uses: actions/setup-dotnet@v5
|
||||||
with:
|
with:
|
||||||
dotnet-version: 10.x.x
|
dotnet-version: |
|
||||||
|
10.x.x
|
||||||
|
9.x.x
|
||||||
|
|
||||||
- name: Download Dalamud
|
- name: Download Dalamud
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -69,6 +69,58 @@ namespace LightlessSync;
|
|||||||
#pragma warning restore S125 // Sections of code should not be commented out
|
#pragma warning restore S125 // Sections of code should not be commented out
|
||||||
// thank you dark 🙏
|
// thank you dark 🙏
|
||||||
|
|
||||||
|
/*
|
||||||
|
---------
|
||||||
|
-------------------------
|
||||||
|
-------------- ##++++ -------------
|
||||||
|
----------+##+++++++++++++++++++###--------
|
||||||
|
+------ ####++++++++++++++++++++++++##### -----
|
||||||
|
------- #####++++++++++++++++++++++++++++++###### +++++
|
||||||
|
------+#####++++++++++++++++++++++++++++++++++########+++++
|
||||||
|
------######++++++++++++++++++++++++++++++++++++++#########++++
|
||||||
|
------######+++++++++++++++++++++++++++++++++++++##############+++
|
||||||
|
-----#######+++++++++++++++++++++++++++++++#######################+++
|
||||||
|
---- #######++++++++++++++++++++++++++++############################ ++
|
||||||
|
-----########+++++++++++++++++++++++++++##################################
|
||||||
|
----+########+++++++++++++++++++++++++#######################################
|
||||||
|
---- ########+++++++++++++++++++++++-+#########################################
|
||||||
|
-----#########++++++++++++++++++++--+###########################################
|
||||||
|
----#########+++++++++++++++++++---+#######+++++++++#############################
|
||||||
|
----##########+++++++++++++++++----###+--------.......---+####################### #
|
||||||
|
---###########+++++++++++++++-----#+------..................-#######################
|
||||||
|
----###########++++++++++++++----------..----..................-+####################
|
||||||
|
---+###########+++++++++++++--------.-+########+-................-###################
|
||||||
|
----############++++++++++++--------+##############+................+#################
|
||||||
|
----############++++---+---------.-#################+................-################
|
||||||
|
---+####+++++-------------------..###################+...............--###############
|
||||||
|
----+#############++-------------.+####################-...............--###############
|
||||||
|
----+##############++++++++------.+####################+...............---##############
|
||||||
|
----+##############+++++++++-----.+####################+...............---+#############
|
||||||
|
---++##############++++++++-------####################.................---#############
|
||||||
|
----+################++++++++-----+##################-......-..........---+############
|
||||||
|
----++################+++++++-------################-......+...........---+############
|
||||||
|
----++##################++++++--------+##########+-......-#-..........----+###########
|
||||||
|
--- ++##################+++++--------..--+++---........+#-.........------+###########
|
||||||
|
+++++++####################++----------.............-+#+-......-.--------+##########
|
||||||
|
+++ +++######################+---------..........+###+-......-----------+##########
|
||||||
|
++++-+++##########################+++------+++######-......--------.----##########
|
||||||
|
++++----+########################################+-.......------------+#########
|
||||||
|
++++ ----+####################################--.....----------------#########
|
||||||
|
+++ -----++###############################+------------------------########
|
||||||
|
+++ ------++###########++##+++++#+++----------------------------+#######
|
||||||
|
+++ ----------++########-----------...------------------------+#######
|
||||||
|
+++ -------------------------------------------------------#######
|
||||||
|
++# ---------------------------------------------------+######
|
||||||
|
## ------------------------------------------------######
|
||||||
|
### -------------------------------------------+#####
|
||||||
|
### --------------------------------------+#####
|
||||||
|
# -------------------------------####
|
||||||
|
----------------------++###
|
||||||
|
------------#
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Just a shitty fork, still with love.
|
||||||
|
|
||||||
public class LightlessPlugin : MediatorSubscriberBase, IHostedService
|
public class LightlessPlugin : MediatorSubscriberBase, IHostedService
|
||||||
{
|
{
|
||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
|
|||||||
@@ -28,10 +28,10 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Blake3" Version="2.0.0" />
|
<PackageReference Include="Blake3" Version="2.0.0" />
|
||||||
<PackageReference Include="Brio.API" Version="3.0.0" />
|
<PackageReference Include="Brio.API" Version="3.0.1" />
|
||||||
<PackageReference Include="Downloader" Version="4.0.3" />
|
<PackageReference Include="Downloader" Version="4.0.3" />
|
||||||
<PackageReference Include="K4os.Compression.LZ4.Legacy" Version="1.3.8" />
|
<PackageReference Include="K4os.Compression.LZ4.Legacy" Version="1.3.8" />
|
||||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.212">
|
<PackageReference Include="Meziantou.Analyzer" Version="2.0.264">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
@@ -39,13 +39,13 @@
|
|||||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="10.0.1" />
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="10.0.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.1" />
|
||||||
<PackageReference Include="Glamourer.Api" Version="2.8.0" />
|
<PackageReference Include="Glamourer.Api" Version="2.8.0" />
|
||||||
<PackageReference Include="NReco.Logging.File" Version="1.2.2" />
|
<PackageReference Include="NReco.Logging.File" Version="1.3.1" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
|
||||||
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.7.0.110445">
|
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.17.0.131074">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.7.0" />
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.15.0" />
|
||||||
<PackageReference Include="YamlDotNet" Version="16.3.0" />
|
<PackageReference Include="YamlDotNet" Version="16.3.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ public sealed class CommandManagerService : IDisposable
|
|||||||
"\t /light gpose - Opens the Lightless Character Data Hub window" + Environment.NewLine +
|
"\t /light gpose - Opens the Lightless Character Data Hub window" + Environment.NewLine +
|
||||||
"\t /light analyze - Opens the Lightless Character Data Analysis window" + Environment.NewLine +
|
"\t /light analyze - Opens the Lightless Character Data Analysis window" + Environment.NewLine +
|
||||||
"\t /light settings - Opens the Lightless Settings window" + Environment.NewLine +
|
"\t /light settings - Opens the Lightless Settings window" + Environment.NewLine +
|
||||||
"\t /light finder - Opens the Lightfinder window"
|
"\t /light finder - Opens the Lightfinder window" + Environment.NewLine +
|
||||||
|
"\t /light finder - Opens the Lightless Chat window"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,5 +134,9 @@ public sealed class CommandManagerService : IDisposable
|
|||||||
{
|
{
|
||||||
_mediator.Publish(new UiToggleMessage(typeof(LightFinderUI)));
|
_mediator.Publish(new UiToggleMessage(typeof(LightFinderUI)));
|
||||||
}
|
}
|
||||||
|
else if (string.Equals(splitArgs[0], "chat", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
_mediator.Publish(new UiToggleMessage(typeof(ZoneChatUi)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -629,8 +629,9 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
var seString = SeStringUtils.BuildFormattedPlayerName(uidText, vanityTextColor, vanityGlowColor);
|
var seString = SeStringUtils.BuildFormattedPlayerName(uidText, vanityTextColor, vanityGlowColor);
|
||||||
var cursorPos = ImGui.GetCursorScreenPos();
|
var cursorPos = ImGui.GetCursorScreenPos();
|
||||||
var fontPtr = ImGui.GetFont();
|
var targetFontSize = ImGui.GetFontSize();
|
||||||
SeStringUtils.RenderSeStringWithHitbox(seString, cursorPos, fontPtr, "uid-header");
|
var font = ImGui.GetFont();
|
||||||
|
SeStringUtils.RenderSeStringWithHitbox(seString, cursorPos, targetFontSize ,font , "uid-header");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -716,8 +717,9 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
var seString = SeStringUtils.BuildFormattedPlayerName(_apiController.UID, vanityTextColor, vanityGlowColor);
|
var seString = SeStringUtils.BuildFormattedPlayerName(_apiController.UID, vanityTextColor, vanityGlowColor);
|
||||||
var cursorPos = ImGui.GetCursorScreenPos();
|
var cursorPos = ImGui.GetCursorScreenPos();
|
||||||
var fontPtr = ImGui.GetFont();
|
var targetFontSize = ImGui.GetFontSize();
|
||||||
SeStringUtils.RenderSeStringWithHitbox(seString, cursorPos, fontPtr, "uid-footer");
|
var font = ImGui.GetFont();
|
||||||
|
SeStringUtils.RenderSeStringWithHitbox(seString, cursorPos, targetFontSize, font, "uid-footer");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -332,7 +332,7 @@ public partial class EditProfileUi
|
|||||||
saveTooltip: "Apply the selected tags to this syncshell profile.",
|
saveTooltip: "Apply the selected tags to this syncshell profile.",
|
||||||
submitAction: payload => SubmitGroupTagChanges(payload),
|
submitAction: payload => SubmitGroupTagChanges(payload),
|
||||||
allowReorder: true,
|
allowReorder: true,
|
||||||
sortPayloadBeforeSubmit: true,
|
sortPayloadBeforeSubmit: false,
|
||||||
onPayloadPrepared: payload =>
|
onPayloadPrepared: payload =>
|
||||||
{
|
{
|
||||||
_tagEditorSelection.Clear();
|
_tagEditorSelection.Clear();
|
||||||
@@ -586,7 +586,7 @@ public partial class EditProfileUi
|
|||||||
IsNsfw: null,
|
IsNsfw: null,
|
||||||
IsDisabled: null)).ConfigureAwait(false);
|
IsDisabled: null)).ConfigureAwait(false);
|
||||||
|
|
||||||
_profileTagIds = payload.Length == 0 ? Array.Empty<int>() : payload.ToArray();
|
_profileTagIds = payload.Length == 0 ? [] : [.. payload];
|
||||||
Mediator.Publish(new ClearProfileGroupDataMessage(_groupInfo.Group));
|
Mediator.Publish(new ClearProfileGroupDataMessage(_groupInfo.Group));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ public class IdDisplayHandler
|
|||||||
|
|
||||||
if (!string.Equals(_editEntry, pair.UserData.UID, StringComparison.Ordinal))
|
if (!string.Equals(_editEntry, pair.UserData.UID, StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
|
var targetFontSize = ImGui.GetFontSize();
|
||||||
var font = textIsUid ? UiBuilder.MonoFont : ImGui.GetFont();
|
var font = textIsUid ? UiBuilder.MonoFont : ImGui.GetFont();
|
||||||
var rowWidth = MathF.Max(editBoxWidth.Invoke(), 0f);
|
var rowWidth = MathF.Max(editBoxWidth.Invoke(), 0f);
|
||||||
float rowRightLimit = 0f;
|
float rowRightLimit = 0f;
|
||||||
@@ -183,7 +184,7 @@ public class IdDisplayHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SeStringUtils.RenderSeStringWithHitbox(seString, rowStart, font, pair.UserData.UID);
|
SeStringUtils.RenderSeStringWithHitbox(seString, rowStart, targetFontSize, font, pair.UserData.UID);
|
||||||
nameRectMin = ImGui.GetItemRectMin();
|
nameRectMin = ImGui.GetItemRectMin();
|
||||||
nameRectMax = ImGui.GetItemRectMax();
|
nameRectMax = ImGui.GetItemRectMax();
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ public sealed class ZoneChatUi : WindowMediatorSubscriberBase
|
|||||||
private float _currentWindowOpacity = DefaultWindowOpacity;
|
private float _currentWindowOpacity = DefaultWindowOpacity;
|
||||||
private bool _isWindowPinned;
|
private bool _isWindowPinned;
|
||||||
private bool _showRulesOverlay;
|
private bool _showRulesOverlay;
|
||||||
|
private bool _refocusChatInput;
|
||||||
|
private string? _refocusChatInputKey;
|
||||||
|
|
||||||
private string? _selectedChannelKey;
|
private string? _selectedChannelKey;
|
||||||
private bool _scrollToBottom = true;
|
private bool _scrollToBottom = true;
|
||||||
@@ -308,46 +310,60 @@ public sealed class ZoneChatUi : WindowMediatorSubscriberBase
|
|||||||
_draftMessages.TryGetValue(channel.Key, out var draft);
|
_draftMessages.TryGetValue(channel.Key, out var draft);
|
||||||
draft ??= string.Empty;
|
draft ??= string.Empty;
|
||||||
|
|
||||||
|
var style = ImGui.GetStyle();
|
||||||
|
var sendButtonWidth = 100f * ImGuiHelpers.GlobalScale;
|
||||||
|
var counterWidth = ImGui.CalcTextSize($"{MaxMessageLength}/{MaxMessageLength}").X;
|
||||||
|
var reservedWidth = sendButtonWidth + counterWidth + style.ItemSpacing.X * 2f;
|
||||||
|
|
||||||
|
ImGui.SetNextItemWidth(-reservedWidth);
|
||||||
|
var inputId = $"##chat-input-{channel.Key}";
|
||||||
|
if (_refocusChatInput && string.Equals(_refocusChatInputKey, channel.Key, StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
ImGui.SetKeyboardFocusHere();
|
||||||
|
_refocusChatInput = false;
|
||||||
|
_refocusChatInputKey = null;
|
||||||
|
}
|
||||||
|
ImGui.InputText(inputId, ref draft, MaxMessageLength);
|
||||||
|
var enterPressed = ImGui.IsItemFocused()
|
||||||
|
&& (ImGui.IsKeyPressed(ImGuiKey.Enter) || ImGui.IsKeyPressed(ImGuiKey.KeypadEnter));
|
||||||
|
_draftMessages[channel.Key] = draft;
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
ImGui.AlignTextToFramePadding();
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudGrey3);
|
||||||
|
ImGui.TextUnformatted($"{draft.Length}/{MaxMessageLength}");
|
||||||
|
ImGui.PopStyleColor();
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
var buttonScreenPos = ImGui.GetCursorScreenPos();
|
||||||
|
var rightEdgeScreen = ImGui.GetWindowPos().X + ImGui.GetWindowContentRegionMax().X;
|
||||||
|
var desiredButtonX = rightEdgeScreen - sendButtonWidth;
|
||||||
|
var minButtonX = buttonScreenPos.X + style.ItemSpacing.X;
|
||||||
|
var finalButtonX = MathF.Max(minButtonX, desiredButtonX);
|
||||||
|
ImGui.SetCursorScreenPos(new Vector2(finalButtonX, buttonScreenPos.Y));
|
||||||
|
var sendColor = UIColors.Get("LightlessPurpleDefault");
|
||||||
|
var sendHovered = UIColors.Get("LightlessPurple");
|
||||||
|
var sendActive = UIColors.Get("LightlessPurpleActive");
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.Button, sendColor);
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.ButtonHovered, sendHovered);
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.ButtonActive, sendActive);
|
||||||
|
ImGui.PushStyleVar(ImGuiStyleVar.FrameRounding, 6f * ImGuiHelpers.GlobalScale);
|
||||||
|
var sendClicked = false;
|
||||||
using (ImRaii.Disabled(!canSend))
|
using (ImRaii.Disabled(!canSend))
|
||||||
{
|
{
|
||||||
var style = ImGui.GetStyle();
|
if (_uiSharedService.IconTextButton(FontAwesomeIcon.PaperPlane, $"Send##chat-send-{channel.Key}", 100f * ImGuiHelpers.GlobalScale, center: true))
|
||||||
var sendButtonWidth = 100f * ImGuiHelpers.GlobalScale;
|
|
||||||
var counterWidth = ImGui.CalcTextSize($"{MaxMessageLength}/{MaxMessageLength}").X;
|
|
||||||
var reservedWidth = sendButtonWidth + counterWidth + style.ItemSpacing.X * 2f;
|
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(-reservedWidth);
|
|
||||||
var inputId = $"##chat-input-{channel.Key}";
|
|
||||||
var send = ImGui.InputText(inputId, ref draft, MaxMessageLength, ImGuiInputTextFlags.EnterReturnsTrue);
|
|
||||||
_draftMessages[channel.Key] = draft;
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
ImGui.AlignTextToFramePadding();
|
|
||||||
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudGrey3);
|
|
||||||
ImGui.TextUnformatted($"{draft.Length}/{MaxMessageLength}");
|
|
||||||
ImGui.PopStyleColor();
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
var buttonScreenPos = ImGui.GetCursorScreenPos();
|
|
||||||
var rightEdgeScreen = ImGui.GetWindowPos().X + ImGui.GetWindowContentRegionMax().X;
|
|
||||||
var desiredButtonX = rightEdgeScreen - sendButtonWidth;
|
|
||||||
var minButtonX = buttonScreenPos.X + style.ItemSpacing.X;
|
|
||||||
var finalButtonX = MathF.Max(minButtonX, desiredButtonX);
|
|
||||||
ImGui.SetCursorScreenPos(new Vector2(finalButtonX, buttonScreenPos.Y));
|
|
||||||
var sendColor = UIColors.Get("LightlessPurpleDefault");
|
|
||||||
var sendHovered = UIColors.Get("LightlessPurple");
|
|
||||||
var sendActive = UIColors.Get("LightlessPurpleActive");
|
|
||||||
ImGui.PushStyleColor(ImGuiCol.Button, sendColor);
|
|
||||||
ImGui.PushStyleColor(ImGuiCol.ButtonHovered, sendHovered);
|
|
||||||
ImGui.PushStyleColor(ImGuiCol.ButtonActive, sendActive);
|
|
||||||
ImGui.PushStyleVar(ImGuiStyleVar.FrameRounding, 6f * ImGuiHelpers.GlobalScale);
|
|
||||||
if (_uiSharedService.IconTextButton(FontAwesomeIcon.PaperPlane, "Send", 100f * ImGuiHelpers.GlobalScale, center: true))
|
|
||||||
{
|
{
|
||||||
send = true;
|
sendClicked = true;
|
||||||
}
|
}
|
||||||
ImGui.PopStyleVar();
|
}
|
||||||
ImGui.PopStyleColor(3);
|
ImGui.PopStyleVar();
|
||||||
|
ImGui.PopStyleColor(3);
|
||||||
|
|
||||||
if (send && TrySendDraft(channel, draft))
|
if (canSend && (enterPressed || sendClicked))
|
||||||
|
{
|
||||||
|
_refocusChatInput = true;
|
||||||
|
_refocusChatInputKey = channel.Key;
|
||||||
|
if (TrySendDraft(channel, draft))
|
||||||
{
|
{
|
||||||
_draftMessages[channel.Key] = string.Empty;
|
_draftMessages[channel.Key] = string.Empty;
|
||||||
_scrollToBottom = true;
|
_scrollToBottom = true;
|
||||||
@@ -969,6 +985,12 @@ public sealed class ZoneChatUi : WindowMediatorSubscriberBase
|
|||||||
_draftMessages.Remove(key);
|
_draftMessages.Remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_refocusChatInputKey is not null && !existingKeys.Contains(_refocusChatInputKey))
|
||||||
|
{
|
||||||
|
_refocusChatInputKey = null;
|
||||||
|
_refocusChatInput = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawConnectionControls()
|
private void DrawConnectionControls()
|
||||||
|
|||||||
@@ -559,17 +559,11 @@ public static class SeStringUtils
|
|||||||
|
|
||||||
ImGui.Dummy(new Vector2(0f, textSize.Y));
|
ImGui.Dummy(new Vector2(0f, textSize.Y));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vector2 RenderSeStringWithHitbox(DalamudSeString seString, Vector2 position, ImFontPtr? font = null, string? id = null)
|
public static Vector2 RenderSeStringWithHitbox(DalamudSeString seString, Vector2 position, ImFontPtr? font = null, string? id = null)
|
||||||
{
|
{
|
||||||
var drawList = ImGui.GetWindowDrawList();
|
var drawList = ImGui.GetWindowDrawList();
|
||||||
var usedFont = font ?? UiBuilder.MonoFont;
|
var usedFont = font ?? UiBuilder.MonoFont;
|
||||||
var drawParams = new SeStringDrawParams
|
|
||||||
{
|
|
||||||
Font = usedFont,
|
|
||||||
Color = 0xFFFFFFFF,
|
|
||||||
WrapWidth = float.MaxValue,
|
|
||||||
TargetDrawList = drawList
|
|
||||||
};
|
|
||||||
|
|
||||||
var textSize = ImGui.CalcTextSize(seString.TextValue);
|
var textSize = ImGui.CalcTextSize(seString.TextValue);
|
||||||
if (textSize.Y <= 0f)
|
if (textSize.Y <= 0f)
|
||||||
@@ -584,11 +578,17 @@ public static class SeStringUtils
|
|||||||
var verticalOffset = MathF.Max((hitboxHeight - textSize.Y) * 0.5f, 0f);
|
var verticalOffset = MathF.Max((hitboxHeight - textSize.Y) * 0.5f, 0f);
|
||||||
|
|
||||||
var drawPos = new Vector2(position.X, position.Y + verticalOffset);
|
var drawPos = new Vector2(position.X, position.Y + verticalOffset);
|
||||||
ImGui.SetCursorScreenPos(drawPos);
|
var drawParams = new SeStringDrawParams
|
||||||
|
{
|
||||||
|
FontSize = usedFont.FontSize,
|
||||||
|
ScreenOffset = drawPos,
|
||||||
|
Font = usedFont,
|
||||||
|
Color = 0xFFFFFFFF,
|
||||||
|
WrapWidth = float.MaxValue,
|
||||||
|
TargetDrawList = drawList
|
||||||
|
};
|
||||||
|
|
||||||
drawParams.ScreenOffset = drawPos;
|
ImGui.SetCursorScreenPos(drawPos);
|
||||||
drawParams.Font = usedFont;
|
|
||||||
drawParams.FontSize = usedFont.FontSize;
|
|
||||||
|
|
||||||
ImGuiHelpers.SeStringWrapped(seString.Encode(), drawParams);
|
ImGuiHelpers.SeStringWrapped(seString.Encode(), drawParams);
|
||||||
|
|
||||||
@@ -614,6 +614,64 @@ public static class SeStringUtils
|
|||||||
return new Vector2(textSize.X, hitboxHeight);
|
return new Vector2(textSize.X, hitboxHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Vector2 RenderSeStringWithHitbox(DalamudSeString seString, Vector2 position, float? targetFontSize, ImFontPtr? font = null, string? id = null)
|
||||||
|
{
|
||||||
|
var drawList = ImGui.GetWindowDrawList();
|
||||||
|
var usedFont = font ?? ImGui.GetFont();
|
||||||
|
|
||||||
|
ImGui.PushFont(usedFont);
|
||||||
|
Vector2 rawSize;
|
||||||
|
float usedEffectiveSize;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
usedEffectiveSize = ImGui.GetFontSize();
|
||||||
|
rawSize = ImGui.CalcTextSize(seString.TextValue);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
ImGui.PopFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
var desiredSize = targetFontSize ?? usedEffectiveSize;
|
||||||
|
var scale = usedEffectiveSize > 0 ? (desiredSize / usedEffectiveSize) : 1f;
|
||||||
|
|
||||||
|
var textSize = rawSize * scale;
|
||||||
|
|
||||||
|
var style = ImGui.GetStyle();
|
||||||
|
var frameHeight = desiredSize + style.FramePadding.Y * 2f;
|
||||||
|
var hitboxHeight = MathF.Max(frameHeight, textSize.Y);
|
||||||
|
var verticalOffset = MathF.Max((hitboxHeight - textSize.Y) * 0.5f, 0f);
|
||||||
|
|
||||||
|
var drawPos = new Vector2(position.X, position.Y + verticalOffset);
|
||||||
|
|
||||||
|
var drawParams = new SeStringDrawParams
|
||||||
|
{
|
||||||
|
TargetDrawList = drawList,
|
||||||
|
ScreenOffset = drawPos,
|
||||||
|
Font = usedFont,
|
||||||
|
FontSize = desiredSize,
|
||||||
|
Color = 0xFFFFFFFF,
|
||||||
|
WrapWidth = float.MaxValue,
|
||||||
|
};
|
||||||
|
|
||||||
|
ImGui.SetCursorScreenPos(drawPos);
|
||||||
|
ImGuiHelpers.SeStringWrapped(seString.Encode(), drawParams);
|
||||||
|
|
||||||
|
ImGui.SetCursorScreenPos(position);
|
||||||
|
ImGui.PushID(id ?? Interlocked.Increment(ref _seStringHitboxCounter).ToString());
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ImGui.InvisibleButton("##hitbox", new Vector2(textSize.X, hitboxHeight));
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
ImGui.PopID();
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Vector2(textSize.X, hitboxHeight);
|
||||||
|
}
|
||||||
|
|
||||||
public static Vector2 RenderIconWithHitbox(int iconId, Vector2 position, ImFontPtr? font = null, string? id = null)
|
public static Vector2 RenderIconWithHitbox(int iconId, Vector2 position, ImFontPtr? font = null, string? id = null)
|
||||||
{
|
{
|
||||||
var drawList = ImGui.GetWindowDrawList();
|
var drawList = ImGui.GetWindowDrawList();
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
},
|
},
|
||||||
"Brio.API": {
|
"Brio.API": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[3.0.0, )",
|
"requested": "[3.0.1, )",
|
||||||
"resolved": "3.0.0",
|
"resolved": "3.0.1",
|
||||||
"contentHash": "0g7BTpSj/Nwfnpkz3R2FCzDIauhUdCb5zEt9cBWB0xrDrhugvUW7/irRyB48gyHDaK4Cv13al2IGrfW7l/jBUg=="
|
"contentHash": "40MD49ETqyGsdHGoG3JF/BFcNAphRqi27+ZxfDk2Aj7gAkzDFe7C2UVGirUByrUIj8lxiz9eEoB2i7O9lefEPQ=="
|
||||||
},
|
},
|
||||||
"DalamudPackager": {
|
"DalamudPackager": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
@@ -52,9 +52,9 @@
|
|||||||
},
|
},
|
||||||
"Meziantou.Analyzer": {
|
"Meziantou.Analyzer": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[2.0.212, )",
|
"requested": "[2.0.264, )",
|
||||||
"resolved": "2.0.212",
|
"resolved": "2.0.264",
|
||||||
"contentHash": "U91ktjjTRTccUs3Lk+hrLD9vW+2+lhnsOf4G1GpRSJi1pLn3uK5CU6wGP9Bmz1KlJs6Oz1GGoMhxQBoqQsmAuQ=="
|
"contentHash": "zRG13RDG446rZNdd/YjKRd4utpbjleRDUqNQSrX0etMnH8Rz9NBlXUpS5aR2ExoOokhNfkdOW8HpLzjLj5x0hQ=="
|
||||||
},
|
},
|
||||||
"Microsoft.AspNetCore.SignalR.Client": {
|
"Microsoft.AspNetCore.SignalR.Client": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
@@ -108,35 +108,35 @@
|
|||||||
},
|
},
|
||||||
"NReco.Logging.File": {
|
"NReco.Logging.File": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[1.2.2, )",
|
"requested": "[1.3.1, )",
|
||||||
"resolved": "1.2.2",
|
"resolved": "1.3.1",
|
||||||
"contentHash": "UyUIkyDiHi2HAJlmEWqeKN9/FxTF0DPNdyatzMDMTXvUpgvqBFneJ2qDtZkXRJNG8eR6jU+KsbGeMmChgUdRUg==",
|
"contentHash": "4aFUEW1OFJsuKtg46dnqxZUyb37f9dzaWOXjUv2x/wzoHKovR9yqiMzXtCZt3+a9G78YCIAtSEz2g/GaNYbxSQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.Extensions.Logging": "8.0.1",
|
"Microsoft.Extensions.Logging": "10.0.0",
|
||||||
"Microsoft.Extensions.Logging.Configuration": "8.0.1",
|
"Microsoft.Extensions.Logging.Configuration": "10.0.0",
|
||||||
"Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0"
|
"Microsoft.Extensions.Options.ConfigurationExtensions": "10.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"SixLabors.ImageSharp": {
|
"SixLabors.ImageSharp": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[3.1.11, )",
|
"requested": "[3.1.12, )",
|
||||||
"resolved": "3.1.11",
|
"resolved": "3.1.12",
|
||||||
"contentHash": "JfPLyigLthuE50yi6tMt7Amrenr/fA31t2CvJyhy/kQmfulIBAqo5T/YFUSRHtuYPXRSaUHygFeh6Qd933EoSw=="
|
"contentHash": "iAg6zifihXEFS/t7fiHhZBGAdCp3FavsF4i2ZIDp0JfeYeDVzvmlbY1CNhhIKimaIzrzSi5M/NBFcWvZT2rB/A=="
|
||||||
},
|
},
|
||||||
"SonarAnalyzer.CSharp": {
|
"SonarAnalyzer.CSharp": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[10.7.0.110445, )",
|
"requested": "[10.17.0.131074, )",
|
||||||
"resolved": "10.7.0.110445",
|
"resolved": "10.17.0.131074",
|
||||||
"contentHash": "U4v2LWopxADYkUv7Z5CX7ifKMdDVqHb7a1bzppIQnQi4WQR6z1Zi5rDkCHlVYGEd1U/WMz1IJCU8OmFZLJpVig=="
|
"contentHash": "N8agHzX1pK3Xv/fqMig/mHspPAmh/aKkGg7lUC1xfezAhFtPTuRqBjuyas622Tvy5jnsN5zCXJVclvNkfJJ4rQ=="
|
||||||
},
|
},
|
||||||
"System.IdentityModel.Tokens.Jwt": {
|
"System.IdentityModel.Tokens.Jwt": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[8.7.0, )",
|
"requested": "[8.15.0, )",
|
||||||
"resolved": "8.7.0",
|
"resolved": "8.15.0",
|
||||||
"contentHash": "8dKL3A9pVqYCJIXHd4H2epQqLxSvKeNxGonR0e5g89yMchyvsM/NLuB06otx29BicUd6+LUJZgNZmvYjjPsPGg==",
|
"contentHash": "dpodi7ixz6hxK8YCBYAWzm0IA8JYXoKcz0hbCbNifo519//rjUI0fBD8rfNr+IGqq+2gm4oQoXwHk09LX5SqqQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.IdentityModel.JsonWebTokens": "8.7.0",
|
"Microsoft.IdentityModel.JsonWebTokens": "8.15.0",
|
||||||
"Microsoft.IdentityModel.Tokens": "8.7.0"
|
"Microsoft.IdentityModel.Tokens": "8.15.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"YamlDotNet": {
|
"YamlDotNet": {
|
||||||
@@ -490,32 +490,32 @@
|
|||||||
},
|
},
|
||||||
"Microsoft.IdentityModel.Abstractions": {
|
"Microsoft.IdentityModel.Abstractions": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "8.7.0",
|
"resolved": "8.15.0",
|
||||||
"contentHash": "OQd5aVepYvh5evOmBMeAYjMIpEcTf1ZCBZaU7Nh/RlhhdXefjFDJeP1L2F2zeNT1unFr+wUu/h3Ac2Xb4BXU6w=="
|
"contentHash": "e/DApa1GfxUqHSBHcpiQg8yaghKAvFVBQFcWh25jNoRobDZbduTUACY8bZ54eeGWXvimGmEDdF0zkS5Dq16XPQ=="
|
||||||
},
|
},
|
||||||
"Microsoft.IdentityModel.JsonWebTokens": {
|
"Microsoft.IdentityModel.JsonWebTokens": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "8.7.0",
|
"resolved": "8.15.0",
|
||||||
"contentHash": "uzsSAWhNhbrkWbQKBTE8QhzviU6sr3bJ1Bkv7gERlhswfSKOp7HsxTRLTPBpx/whQ/GRRHEwMg8leRIPbMrOgw==",
|
"contentHash": "3513f5VzvOZy3ELd42wGnh1Q3e83tlGAuXFSNbENpgWYoAhLLzgFtd5PiaOPGAU0gqKhYGVzKavghLUGfX3HQg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.IdentityModel.Tokens": "8.7.0"
|
"Microsoft.IdentityModel.Tokens": "8.15.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Microsoft.IdentityModel.Logging": {
|
"Microsoft.IdentityModel.Logging": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "8.7.0",
|
"resolved": "8.15.0",
|
||||||
"contentHash": "Bs0TznPAu+nxa9rAVHJ+j3CYECHJkT3tG8AyBfhFYlT5ldsDhoxFT7J+PKxJHLf+ayqWfvDZHHc4639W2FQCxA==",
|
"contentHash": "1gJLjhy0LV2RQMJ9NGzi5Tnb2l+c37o8D8Lrk2mrvmb6OQHZ7XJstd/XxvncXgBpad4x9CGXdipbZzJJCXKyAg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.IdentityModel.Abstractions": "8.7.0"
|
"Microsoft.IdentityModel.Abstractions": "8.15.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Microsoft.IdentityModel.Tokens": {
|
"Microsoft.IdentityModel.Tokens": {
|
||||||
"type": "Transitive",
|
"type": "Transitive",
|
||||||
"resolved": "8.7.0",
|
"resolved": "8.15.0",
|
||||||
"contentHash": "5Z6voXjRXAnGklhmZd1mKz89UhcF5ZQQZaZc2iKrOuL4Li1UihG2vlJx8IbiFAOIxy/xdbsAm0A+WZEaH5fxng==",
|
"contentHash": "zUE9ysJXBtXlHHRtcRK3Sp8NzdCI1z/BRDTXJQ2TvBoI0ENRtnufYIep0O5TSCJRJGDwwuLTUx+l/bEYZUxpCA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
|
"Microsoft.Extensions.Logging.Abstractions": "10.0.0",
|
||||||
"Microsoft.IdentityModel.Logging": "8.7.0"
|
"Microsoft.IdentityModel.Logging": "8.15.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Microsoft.NET.StringTools": {
|
"Microsoft.NET.StringTools": {
|
||||||
@@ -619,7 +619,7 @@
|
|||||||
"FlatSharp.Runtime": "[7.9.0, )",
|
"FlatSharp.Runtime": "[7.9.0, )",
|
||||||
"OtterGui": "[1.0.0, )",
|
"OtterGui": "[1.0.0, )",
|
||||||
"Penumbra.Api": "[5.13.0, )",
|
"Penumbra.Api": "[5.13.0, )",
|
||||||
"Penumbra.String": "[1.0.6, )"
|
"Penumbra.String": "[1.0.7, )"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"penumbra.string": {
|
"penumbra.string": {
|
||||||
|
|||||||
Reference in New Issue
Block a user