-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e68e4d
commit 6ba0539
Showing
7 changed files
with
130 additions
and
8 deletions.
There are no files selected for viewing
Submodule CriticalCommonLib
updated
3 files
+1 −1 | CriticalCommonLib.csproj | |
+1 −0 | Models/Icons.cs | |
+3 −3 | packages.lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
InventoryTools/Logic/ItemRenderers/ItemCompanyCraftDraftSourceRenderer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using AllaganLib.GameSheets.Caches; | ||
using AllaganLib.GameSheets.ItemSources; | ||
using AllaganLib.GameSheets.Sheets; | ||
using CriticalCommonLib.Models; | ||
using ImGuiNET; | ||
using OtterGui.Raii; | ||
|
||
namespace InventoryTools.Logic.ItemRenderers; | ||
|
||
public class ItemCompanyCraftDraftSourceRenderer : ItemInfoRenderer<ItemCompanyCraftDraftSource> | ||
{ | ||
private readonly ItemSheet _itemSheet; | ||
|
||
public ItemCompanyCraftDraftSourceRenderer(ItemSheet itemSheet) | ||
{ | ||
_itemSheet = itemSheet; | ||
} | ||
public override RendererType RendererType => RendererType.Use; | ||
public override ItemInfoType Type => ItemInfoType.CompanyCraftDraft; | ||
public override string SingularName => "Company Craft Prototype"; | ||
public override string HelpText => "Is this item used in the creation of a company craft prototype?"; | ||
public override bool ShouldGroup => true; | ||
public override Action<ItemSource> DrawTooltip => source => | ||
{ | ||
var asSource = AsSource(source); | ||
ImGui.Text($"Name: {asSource.CompanyCraftDraft.Value.Name.ExtractText()}"); | ||
ImGui.Text("Ingredients:"); | ||
using (ImRaii.PushIndent()) | ||
{ | ||
for (var index = 0; index < asSource.CompanyCraftDraft.Value.RequiredItem.Count; index++) | ||
{ | ||
var ingredient = asSource.CompanyCraftDraft.Value.RequiredItem[index]; | ||
var quantity = asSource.CompanyCraftDraft.Value.RequiredItemCount[index]; | ||
if (ingredient.RowId == 0) | ||
{ | ||
continue; | ||
} | ||
var item = _itemSheet.GetRow(ingredient.RowId); | ||
|
||
ImGui.Text($"{item.NameString} x {quantity}"); | ||
} | ||
} | ||
}; | ||
|
||
public override Func<ItemSource, string> GetName => source => | ||
{ | ||
var asSource = AsSource(source); | ||
return asSource.CompanyCraftDraft.Value.Name.ExtractText(); | ||
}; | ||
|
||
public override Func<ItemSource, int> GetIcon => source => | ||
{ | ||
return Icons.DraftBook; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System.Collections.Generic; | ||
using Dalamud.Game.ClientState.Conditions; | ||
using Dalamud.Plugin.Services; | ||
using InventoryTools.Logic.Settings.Abstract; | ||
using InventoryTools.Logic.Settings.Abstract.Generic; | ||
using InventoryTools.Services; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace InventoryTools.Logic.Settings; | ||
|
||
public enum CraftOverlayHide | ||
{ | ||
AlwaysShow, | ||
HideDuringDuties | ||
} | ||
|
||
public class CraftOverlayHideSetting : GenericEnumChoiceSetting<CraftOverlayHide> | ||
{ | ||
private readonly IClientState _clientState; | ||
private readonly ICondition _condition; | ||
|
||
public CraftOverlayHideSetting(ILogger<CraftOverlayHideSetting> logger, ImGuiService imGuiService, IClientState clientState, ICondition condition) : base("CraftOverlayHide", "Hide during duties?", "Should the craft overlay be hidden during duties/cutscenes/chocobo racing/etc?", CraftOverlayHide.HideDuringDuties, new Dictionary<CraftOverlayHide, string>() | ||
{ | ||
{ CraftOverlayHide.AlwaysShow, "Always show" }, | ||
{ CraftOverlayHide.HideDuringDuties, "Hide during duties" }, | ||
}, SettingCategory.CraftOverlay, SettingSubCategory.General, "1.11.0.9", logger, imGuiService) | ||
{ | ||
_clientState = clientState; | ||
_condition = condition; | ||
} | ||
|
||
public bool ShouldShow() | ||
{ | ||
return !_clientState.IsPvPExcludingDen | ||
&& !_condition[ConditionFlag.BoundByDuty] | ||
&& !_condition[ConditionFlag.WatchingCutscene] | ||
&& !_condition[ConditionFlag.WatchingCutscene78] | ||
&& !_condition[ConditionFlag.BoundByDuty95] | ||
&& !_condition[ConditionFlag.BoundByDuty56] | ||
&& !_condition[ConditionFlag.InDeepDungeon] | ||
&& !_condition[ConditionFlag.PlayingLordOfVerminion] | ||
&& !_condition[ConditionFlag.ChocoboRacing]; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters