Don't show base classes in /gbrowser (too niche)

This commit is contained in:
Liza 2024-06-17 22:02:33 +02:00
parent 6dd5148599
commit 894c0d2f69
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 26 additions and 4 deletions

View File

@ -47,6 +47,20 @@ internal enum EClassJob : uint
internal static class EClassJobExtensions
{
public static EClassJob AsJob(this EClassJob classJob) => classJob switch
{
EClassJob.Gladiator => EClassJob.Paladin,
EClassJob.Marauder => EClassJob.Warrior,
EClassJob.Pugilist => EClassJob.Monk,
EClassJob.Lancer => EClassJob.Dragoon,
EClassJob.Rogue => EClassJob.Ninja,
EClassJob.Archer => EClassJob.Bard,
EClassJob.Conjurer => EClassJob.WhiteMage,
EClassJob.Thaumaturge => EClassJob.BlackMage,
EClassJob.Arcanist => EClassJob.Summoner,
_ => classJob,
};
public static bool IsTank(this EClassJob classJob) =>
classJob is EClassJob.Gladiator
or EClassJob.Paladin

View File

@ -33,16 +33,24 @@ internal sealed class EquipmentBrowserWindow : Window
public EquipmentBrowserWindow(GearsetterPlugin plugin, GameDataHolder dataHolder, IClientState clientState,
IChatGui chatGui)
: base("Equipment Browser")
: base("Equipment Browser###GearsetterBrowser")
{
_plugin = plugin;
_dataHolder = dataHolder;
_clientState = clientState;
_chatGui = chatGui;
_classJobNames = dataHolder.ClassJobNames.Select(x => x.Name).ToArray();
_classJobIds = dataHolder.ClassJobNames.Select(x => x.ClassJob).ToArray();
_classJobNames = dataHolder.ClassJobNames
.Where(x => x.ClassJob.AsJob() == x.ClassJob)
.Select(x => x.Name)
.ToArray();
_classJobIds = dataHolder.ClassJobNames
.Where(x => x.ClassJob.AsJob() == x.ClassJob)
.Select(x => x.ClassJob)
.ToArray();
UpdateEquipmentCategories();
Size = new Vector2(800, 500);
SizeCondition = ImGuiCond.FirstUseEver;
SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new Vector2(800, 500)
@ -52,7 +60,7 @@ internal sealed class EquipmentBrowserWindow : Window
public override void OnOpen()
{
if (_clientState.LocalPlayer != null)
_selectedClassJob = (EClassJob)_clientState.LocalPlayer.ClassJob.Id;
_selectedClassJob = ((EClassJob)_clientState.LocalPlayer.ClassJob.Id).AsJob();
UpdateEquipmentCategories();
}