generated from karashiiro/DalamudPluginProjectTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
UiTalkHandler.cs
41 lines (35 loc) · 1.28 KB
/
UiTalkHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// <copyright file="UiTalkHandler.cs" company="lokinmodar">
// Copyright (c) lokinmodar. All rights reserved.
// Licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License license.
// </copyright>
using System;
using System.Threading;
using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Echoglossian
{
public partial class Echoglossian
{
private readonly int delayBetweenVisibilityCheckForOverlay = 100;
private unsafe void TalkHandler(string addonName, int index)
{
IntPtr talk = GameGuiInterface.GetAddonByName(addonName, index);
if (talk != IntPtr.Zero)
{
AtkUnitBase* talkMaster = (AtkUnitBase*)talk;
while (talkMaster->IsVisible)
{
this.talkDisplayTranslation = true;
this.talkTextDimensions.X = talkMaster->RootNode->Width * talkMaster->Scale;
this.talkTextDimensions.Y = talkMaster->RootNode->Height * talkMaster->Scale;
this.talkTextPosition.X = talkMaster->RootNode->X;
this.talkTextPosition.Y = talkMaster->RootNode->Y;
Thread.Sleep(this.delayBetweenVisibilityCheckForOverlay);
#if DEBUG
// PluginLog.Debug("Inside Talk Handler.");
#endif
}
this.talkDisplayTranslation = false;
}
}
}
}