Skip to content

Commit

Permalink
disable hotkey sort-of fix (#108)
Browse files Browse the repository at this point in the history
* added clicklib as submodule

* added dtrbar support

* redundant dtr setting removal & tooltip fix

* add ipc

* added punishlib

* disabled the about tab, kawaii pls fix

* disable hotkey fix?

* revert the readme

* fixed lootboxes results not printing to chat

* fixed logs that were supposed to be chat prints

* fixed multi line handling in selectyesno

* fixed zonelistwindow
  • Loading branch information
Jaksuhn authored Nov 5, 2023
1 parent cf55973 commit a25e1cd
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 21 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# YesAlready2
## YesAlready

It was so good it's being rewritten
### Update as of 2023/10/03 - YesAlready is now maintained by Puni.sh, support can be provided in our Discord community. Please update your repo url to the one found further below.

[![image](https://discordapp.com/api/guilds/1001823907193552978/embed.png?style=banner2)](https://discord.gg/Zzrcc8kmvy)

This plugin stores a list of Yes/No dialogs (among others) and clicks yes for you when they show up. Look, I already said yes once, don't ask me again. Like for all those little prompts in dungeons. Yes I really do want to teleport to the next area in Praetorium.

Each type of dialog needs to be manually added, if you would like one that is not currently supported, please let me know.

## In-game usage

- Type `/pyes` to pull up the GUI.
- Type `/pyes help` to view additional command line arguments.

## Installation

- Add `https://love.puni.sh/ment.json` to your list of repos in `/xlsettings`
4 changes: 2 additions & 2 deletions YesAlready/Features/AddonItemInspectionResultFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ protected unsafe void AddonSetup(AddonEvent eventType, AddonArgs addonInfo)
if (descText.Contains('※') || descText.Contains("liées à Garde-la-Reine"))
{
nameText.Payloads.Insert(0, new TextPayload("Received: "));
Svc.Log.Info(nameText.ToString());
Utils.SEString.PrintPluginMessage(nameText);
}

itemInspectionCount++;
var rateLimiter = P.Config.ItemInspectionResultRateLimiter;
if (rateLimiter != 0 && itemInspectionCount % rateLimiter == 0)
{
itemInspectionCount = 0;
Svc.Log.Info("Rate limited, pausing item inspection loop.");
Utils.SEString.PrintPluginMessage("Rate limited, pausing item inspection loop.");
return;
}

Expand Down
4 changes: 1 addition & 3 deletions YesAlready/Features/AddonSelectYesNoFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using ClickLib.Clicks;
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using Dalamud.Memory;
using ECommons.DalamudServices;
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Component.GUI;
Expand Down Expand Up @@ -38,8 +37,7 @@ protected unsafe void AddonSetup(AddonEvent eventType, AddonArgs addonInfo)
if (dataPtr == null)
return;

//var text = P.LastSeenDialogText = Utils.SEString.GetSeStringText(dataPtr->TextPtr);
var text = P.LastSeenDialogText = MemoryHelper.ReadSeStringNullTerminated(new nint(addon->AtkValues[0].String)).ToString();
var text = P.LastSeenDialogText = Utils.SEString.GetSeStringText(new nint(addon->AtkValues[0].String));
Svc.Log.Debug($"AddonSelectYesNo: text={text}");

if (P.ForcedYesKeyPressed)
Expand Down
6 changes: 3 additions & 3 deletions YesAlready/UI/ZoneListWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ internal class ZoneListWindow : Window
public ZoneListWindow()
: base("Yes Already Zone List")
{
this.Size = new Vector2(525, 600);
this.SizeCondition = ImGuiCond.FirstUseEver;
Size = new Vector2(525, 600);
SizeCondition = ImGuiCond.FirstUseEver;
}

public override void PreDraw()
Expand Down Expand Up @@ -46,7 +46,7 @@ public override void Draw()

var names = P.TerritoryNames.AsEnumerable();

if (this.sortZoneByName)
if (sortZoneByName)
names = names.ToList().OrderBy(kvp => kvp.Value);

foreach (var kvp in names)
Expand Down
30 changes: 19 additions & 11 deletions YesAlready/YesAlready.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class YesAlready : IDalamudPlugin
internal WindowSystem Ws;
internal MainWindow MainWindow;
internal Configuration Config;
private readonly ZoneListWindow zoneListWindow;
internal ZoneListWindow zoneListWindow;

internal static YesAlready P;
internal static DalamudPluginInterface pi;
Expand All @@ -49,7 +49,9 @@ public YesAlready(DalamudPluginInterface pluginInterface)
ECommonsMain.Init(pi, P);
Ws = new();
MainWindow = new();
zoneListWindow = new();
Ws.AddWindow(MainWindow);
Ws.AddWindow(zoneListWindow);
BlockListHandler = new();

Config = pi.GetPluginConfig() as Configuration ?? new Configuration();
Expand Down Expand Up @@ -119,6 +121,7 @@ public void Dispose()

Ws.RemoveAllWindows();
MainWindow = null;
zoneListWindow = null;
Ws = null;
ECommonsMain.Dispose();
pi = null;
Expand Down Expand Up @@ -156,16 +159,21 @@ private void LoadTerritories()
}
}

private bool wasDisableKeyPressed;
private void FrameworkUpdate(object framework)
{
// This doesn't respect the plugin being turned off manually.
if (Config.DisableKey != VirtualKey.NO_KEY)
{
DisableKeyPressed = Svc.KeyState[Config.DisableKey];
}
else
{
DisableKeyPressed = false;
}

if (DisableKeyPressed && !wasDisableKeyPressed)
P.Config.Enabled = false;
else if (!DisableKeyPressed && wasDisableKeyPressed)
P.Config.Enabled = true;

wasDisableKeyPressed = DisableKeyPressed;

if (Config.ForcedYesKey != VirtualKey.NO_KEY)
{
Expand Down Expand Up @@ -264,7 +272,7 @@ private static void CommandHelpMenu()
sb.AppendLine($"{Command} lasttalk - Add the last seen target during a Talk dialog.");
sb.AppendLine($"{Command} dutyconfirm - Toggle duty confirm.");
sb.AppendLine($"{Command} onetimeconfirm - Toggles duty confirm as well as one-time confirm.");
Svc.Log.Info(sb.ToString());
Utils.SEString.PrintPluginMessage(sb.ToString());
}

private void CommandAddNode(bool zoneRestricted, bool createFolder, bool selectNo)
Expand All @@ -280,7 +288,7 @@ private void CommandAddNode(bool zoneRestricted, bool createFolder, bool selectN
Configuration.CreateTextNode(Config.RootFolder, zoneRestricted, createFolder, selectNo);
Config.Save();

Svc.Log.Info("Added a new text entry.");
Utils.SEString.PrintPluginMessage("Added a new text entry.");
}

private void CommandAddListNode()
Expand All @@ -306,7 +314,7 @@ private void CommandAddListNode()
parent.Children.Add(newNode);
Config.Save();

Svc.Log.Info("Added a new list entry.");
Utils.SEString.PrintPluginMessage("Added a new list entry.");
}

private void CommandAddTalkNode()
Expand All @@ -325,7 +333,7 @@ private void CommandAddTalkNode()
parent.Children.Add(newNode);
Config.Save();

Svc.Log.Info("Added a new talk entry.");
Utils.SEString.PrintPluginMessage("Added a new talk entry.");
}

private void ToggleDutyConfirm()
Expand All @@ -335,7 +343,7 @@ private void ToggleDutyConfirm()
Config.Save();

var state = Config.ContentsFinderConfirmEnabled ? "enabled" : "disabled";
Svc.Log.Info($"Duty Confirm {state}.");
Utils.SEString.PrintPluginMessage($"Duty Confirm {state}.");
}

private void ToggleOneTimeConfirm()
Expand All @@ -345,7 +353,7 @@ private void ToggleOneTimeConfirm()
Config.Save();

var state = Config.ContentsFinderOneTimeConfirmEnabled ? "enabled" : "disabled";
Svc.Log.Info($"Duty Confirm and One Time Confirm {state}.");
Utils.SEString.PrintPluginMessage($"Duty Confirm and One Time Confirm {state}.");
}

#endregion
Expand Down

0 comments on commit a25e1cd

Please sign in to comment.