Skip to content

Commit

Permalink
auto gimmicks
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Apr 9, 2024
1 parent f2e8ec6 commit cc83d9d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions YesAlready/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public partial class Configuration() : IPluginConfiguration
public bool LordOfVerminionQuit { get; set; } = false;
public bool ChocoboRacingQuit { get; set; } = false;
public bool PartyFinderJoinConfirm { get; set; } = false;
public bool GimmickYesNo { get; set; } = false;

public static Configuration Load(DirectoryInfo configDirectory)
{
Expand Down
8 changes: 8 additions & 0 deletions YesAlready/Features/AddonSelectYesNoFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using ECommons.DalamudServices;
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Component.GUI;
using Lumina.Excel.GeneratedSheets2;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -49,6 +50,13 @@ protected unsafe void AddonSetup(AddonEvent eventType, AddonArgs addonInfo)
return;
}

if (P.Config.GimmickYesNo && Svc.Data.GetExcelSheet<GimmickYesNo>().Where(x => !x.Unknown0.RawString.IsNullOrEmpty()).Select(x => x.Unknown0.RawString).ToList().Any(g => g.Equals(text)))
{
Svc.Log.Debug($"AddonSelectYesNo: Entry is a gimmick");
AddonSelectYesNoExecute((nint)addon, true);
return;
}

if (P.Config.PartyFinderJoinConfirm && GenericHelpers.TryGetAddonByName<AtkUnitBase>("LookingForGroupDetail", out var _) && lfgPatterns.Any(r => r.IsMatch(text)))
{
Svc.Log.Debug($"AddonSelectYesNo: Entry is party finder join confirmation");
Expand Down
9 changes: 9 additions & 0 deletions YesAlready/UI/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,15 @@ private static void DisplayTextButtons()
Utils.ImGuiEx.IconButton(FontAwesomeIcon.QuestionCircle, sb.ToString());
if (ImGui.IsItemHovered()) ImGui.SetTooltip(sb.ToString());

ImGui.SameLine();
var gimmickConfirm = P.Config.GimmickYesNo;
if (ImGui.Checkbox("Auto GimmickYesNo", ref gimmickConfirm))
{
P.Config.GimmickYesNo = gimmickConfirm;
P.Config.Save();
}
if (ImGui.IsItemHovered()) ImGui.SetTooltip("Automatically confirm any Yesno dialogs that are part of the GimmickYesNo sheet.\nThese are mostly the dungeon Yesnos like \"Unlock this door?\" or \"Pickup this item?\"");

ImGui.PopStyleVar(); // ItemSpacing
}

Expand Down
2 changes: 1 addition & 1 deletion YesAlready/YesAlready.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Authors>daemitus, croizat</Authors>
<Version>1.6.0.0</Version>
<Version>1.6.1.0</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down

0 comments on commit cc83d9d

Please sign in to comment.