Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: fixed social update.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 29, 2023
1 parent 1d0a965 commit 80f2af4
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
6 changes: 5 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,5 +327,9 @@
25886,
25891,
25741,
25742
25742,
25672,
25685,
25690,
25701
]
6 changes: 5 additions & 1 deletion RotationSolver/RotationSolverPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using RotationSolver.Basic.Configuration;
using RotationSolver.Commands;
using RotationSolver.Data;
using RotationSolver.Helpers;
using RotationSolver.Localization;
using RotationSolver.UI;
using RotationSolver.Updaters;
Expand Down Expand Up @@ -78,6 +77,11 @@ public RotationSolverPlugin(DalamudPluginInterface pluginInterface)
#endif
ChangeUITranslation();

OpenLinkPayload = pluginInterface.AddChatLinkHandler(0, (id, str) =>
{
if (id == 0) OpenConfigWindow();
});

Task.Run(async () =>
{
await RotationUpdater.GetAllCustomRotationsAsync(DownloadOption.Download);
Expand Down
21 changes: 21 additions & 0 deletions RotationSolver/UI/RotationConfigWindowNew.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
using Dalamud.Interface.Windowing;
using RotationSolver.Updaters;

namespace RotationSolver.UI;

public class RotationConfigWindowNew : Window
{
private static float _scale => ImGuiHelpers.GlobalScale;
private static float _sideBarWidth => 100;
public RotationConfigWindowNew()
: base(nameof(RotationConfigWindowNew), 0, false)
{
Expand All @@ -14,5 +17,23 @@ public RotationConfigWindowNew()

public override void Draw()
{
ImGui.Columns(2);
DrawSideBar();
ImGui.NextColumn();
DrawBody();
ImGui.Columns(1);
}

private void DrawSideBar()
{
//var rotations = RotationUpdater.CustomRotations
}

private void DrawBody()
{
if (ImGui.BeginChild("Action List", new Vector2(0f, -1f), true))
{
ImGui.EndChild();
}
}
}
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/RotationUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal static class RotationUpdater
internal static SortedList<JobRole, CustomRotationGroup[]> CustomRotationsDict { get; private set; } = new SortedList<JobRole, CustomRotationGroup[]>();

internal static SortedList<string, string> AuthorHashes { get; private set; } = new SortedList<string, string>();
static CustomRotationGroup[] CustomRotations { get; set; } = Array.Empty<CustomRotationGroup>();
internal static CustomRotationGroup[] CustomRotations { get; set; } = Array.Empty<CustomRotationGroup>();

public static ICustomRotation RightNowRotation { get; private set; }
public static IAction[] RightRotationActions { get; private set; } = Array.Empty<IAction>();
Expand Down
11 changes: 5 additions & 6 deletions RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ private static async void SayHelloToAuthor()
})
.Where(p => !string.IsNullOrEmpty(p.nameDesc));


foreach (var (c, nameDesc) in authors)
{
while (!c.IsTargetable() && !DataCenter.InCombat)
Expand All @@ -183,7 +184,9 @@ private static async void SayHelloToAuthor()
Svc.Targets.Target = c;
Chat.Instance.SendMessage($"/{_macroToAuthor[new Random().Next(_macroToAuthor.Count)]} <t>");
#endif
var message = new SeString(new IconPayload(BitmapFontIcon.Mentor),
Svc.Chat.PrintChat(new Dalamud.Game.Text.XivChatEntry()
{
Message = new SeString(new IconPayload(BitmapFontIcon.Mentor),

new UIForegroundPayload(31),
new PlayerPayload(c.Name.TextValue, c.HomeWorld.Id),
Expand All @@ -198,11 +201,7 @@ private static async void SayHelloToAuthor()
UIForegroundPayload.UIForegroundOff,
RawPayload.LinkTerminator,

new TextPayload(". So say hello to him/her!"));

Svc.Chat.PrintChat(new Dalamud.Game.Text.XivChatEntry()
{
Message = message,
new TextPayload(". So say hello to him/her!")),
Type = Dalamud.Game.Text.XivChatType.Notice,
});
UIModule.PlaySound(20, 0, 0, 0);
Expand Down

0 comments on commit 80f2af4

Please sign in to comment.