Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added facewear and some small tweaks. #1379

Merged
merged 10 commits into from
Sep 3, 2024
1 change: 1 addition & 0 deletions Anamnesis/Actor/DefaultCharacterFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public static class DefaultCharacterFile
Bust = 50,
FacePaint = 0,
FacePaintColor = 0,
Glasses = new CharacterFile.GlassesSave(),
MainHand = new CharacterFile.WeaponSave()
{
Color = Color.Black,
Expand Down
5 changes: 5 additions & 0 deletions Anamnesis/Actor/Extensions/INpcBaseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public static string ToStringKey(this INpcBase npc)
{
t = 'M';
}
else if (type == typeof(Ornament))
{
t = 'O';
}
else
{
throw new Exception($"Unknown Npc Type: {type}");
Expand Down Expand Up @@ -65,6 +69,7 @@ public static INpcBase FromStringKey(string stringKey)
'E' => GameDataService.EventNPCs.Get(key),
'C' => GameDataService.Companions.Get(key),
'M' => GameDataService.Mounts.Get(key),
'O' => GameDataService.Ornaments.Get(key),
_ => throw new Exception($"Unrecognized Npc type key: {t}"),
};
}
Expand Down
2 changes: 1 addition & 1 deletion Anamnesis/Actor/Extensions/ItemSlotsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static BitmapImage GetIcon(this ItemSlots self)
}
catch (Exception ex)
{
throw new Exception($"Failed to get icon for slot: {self}", ex);
throw new Exception($"Failed to get icon for slot {self}", ex);
}
}
}
4 changes: 2 additions & 2 deletions Anamnesis/Actor/Items/ChocoboSkinItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public ChocoboSkinItem(INpcBase mount, ushort variant)

public bool IsFavorite
{
get => FavoritesService.IsFavorite(this);
set => FavoritesService.SetFavorite(this, value);
get => FavoritesService.IsFavorite<IItem>(this);
set => FavoritesService.SetFavorite<IItem>(this, nameof(FavoritesService.Favorites.Items), value);
}

public bool CanOwn => false;
Expand Down
4 changes: 2 additions & 2 deletions Anamnesis/Actor/Items/DummyItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public ushort ModelSet

public bool IsFavorite
{
get => FavoritesService.IsFavorite(this);
set => FavoritesService.SetFavorite(this, value);
get => FavoritesService.IsFavorite<IItem>(this);
set => FavoritesService.SetFavorite<IItem>(this, nameof(FavoritesService.Favorites.Items), value);
}

public bool CanOwn => false;
Expand Down
4 changes: 2 additions & 2 deletions Anamnesis/Actor/Items/DummyNoneDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class DummyNoneDye : IDye

public bool IsFavorite
{
get => FavoritesService.IsFavorite(this);
set => FavoritesService.SetFavorite(this, value);
get => FavoritesService.IsFavorite<IDye>(this);
set => FavoritesService.SetFavorite<IDye>(this, nameof(FavoritesService.Favorites.Dyes), value);
}
}
4 changes: 2 additions & 2 deletions Anamnesis/Actor/Items/DummyNoneItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class DummyNoneItem : IItem

public bool IsFavorite
{
get => FavoritesService.IsFavorite(this);
set => FavoritesService.SetFavorite(this, value);
get => FavoritesService.IsFavorite<IItem>(this);
set => FavoritesService.SetFavorite<IItem>(this, nameof(FavoritesService.Favorites.Items), value);
}

public bool CanOwn => false;
Expand Down
44 changes: 44 additions & 0 deletions Anamnesis/Actor/Items/EmperorsAccessoryItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// © Anamnesis.
// Licensed under the MIT license.

namespace Anamnesis.Actor.Items;

using Anamnesis.GameData.Sheets;
using Anamnesis.GameData;
using Anamnesis.Services;
using Anamnesis.TexTools;

public class EmperorsAccessoryItem : IItem
{
public string Name => LocalizationService.GetString("Item_EmperorsBody");
public string Description => LocalizationService.GetString("Item_EmperorsBodyDesc");
public ImageReference? Icon => GameDataService.Items.Get(10033)?.Icon;
public ushort ModelBase => 53;
public ushort ModelVariant => 1;
public ushort ModelSet => 0;
public uint RowId => 0;
public bool IsWeapon => false;
public bool HasSubModel => false;
public ushort SubModelBase => 0;
public ushort SubModelVariant => 0;
public ushort SubModelSet => 0;
public Classes EquipableClasses => Classes.All;
public Mod? Mod => TexToolsService.GetMod(this.Name);
public byte EquipLevel => 0;

public bool IsFavorite
{
get => FavoritesService.IsFavorite<IItem>(this);
set => FavoritesService.SetFavorite<IItem>(this, nameof(FavoritesService.Favorites.Items), value);
}

public bool CanOwn => false;
public bool IsOwned { get; set; }

public ItemCategories Category => ItemCategories.Standard;

public bool FitsInSlot(ItemSlots slot)
{
return slot == ItemSlots.Ears || slot == ItemSlots.Neck || slot == ItemSlots.Wrists || slot == ItemSlots.LeftRing || slot == ItemSlots.RightRing;
}
}
44 changes: 44 additions & 0 deletions Anamnesis/Actor/Items/EmperorsEquipItem.cs
CaptainSticky marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// © Anamnesis.
// Licensed under the MIT license.

namespace Anamnesis.Actor.Items;

using Anamnesis.GameData.Sheets;
using Anamnesis.GameData;
using Anamnesis.Services;
using Anamnesis.TexTools;

public class EmperorsEquipItem : IItem
{
public string Name => LocalizationService.GetString("Item_EmperorsBody");
public string Description => LocalizationService.GetString("Item_EmperorsBodyDesc");
public ImageReference? Icon => GameDataService.Items.Get(10033)?.Icon;
public ushort ModelBase => 279;
public ushort ModelVariant => 1;
public ushort ModelSet => 0;
public uint RowId => 0;
public bool IsWeapon => false;
public bool HasSubModel => false;
public ushort SubModelBase => 0;
public ushort SubModelVariant => 0;
public ushort SubModelSet => 0;
public Classes EquipableClasses => Classes.All;
public Mod? Mod => TexToolsService.GetMod(this.Name);
public byte EquipLevel => 0;

public bool IsFavorite
{
get => FavoritesService.IsFavorite<IItem>(this);
set => FavoritesService.SetFavorite<IItem>(this, nameof(FavoritesService.Favorites.Items), value);
}

public bool CanOwn => false;
public bool IsOwned { get; set; }

public ItemCategories Category => ItemCategories.Standard;

public bool FitsInSlot(ItemSlots slot)
{
return slot == ItemSlots.Head || slot == ItemSlots.Body || slot == ItemSlots.Feet || slot == ItemSlots.Hands || slot == ItemSlots.Legs;
}
}
4 changes: 2 additions & 2 deletions Anamnesis/Actor/Items/InvisibleBodyItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class InvisibleBodyItem : IItem

public bool IsFavorite
{
get => FavoritesService.IsFavorite(this);
set => FavoritesService.SetFavorite(this, value);
get => FavoritesService.IsFavorite<IItem>(this);
set => FavoritesService.SetFavorite<IItem>(this, nameof(FavoritesService.Favorites.Items), value);
}

public bool CanOwn => false;
Expand Down
4 changes: 2 additions & 2 deletions Anamnesis/Actor/Items/InvisibleHeadItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class InvisibleHeadItem : IItem

public bool IsFavorite
{
get => FavoritesService.IsFavorite(this);
set => FavoritesService.SetFavorite(this, value);
get => FavoritesService.IsFavorite<IItem>(this);
set => FavoritesService.SetFavorite<IItem>(this, nameof(FavoritesService.Favorites.Items), value);
}

public bool CanOwn => false;
Expand Down
4 changes: 2 additions & 2 deletions Anamnesis/Actor/Items/NpcBodyItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class NpcBodyItem : IItem

public bool IsFavorite
{
get => FavoritesService.IsFavorite(this);
set => FavoritesService.SetFavorite(this, value);
get => FavoritesService.IsFavorite<IItem>(this);
set => FavoritesService.SetFavorite<IItem>(this, nameof(FavoritesService.Favorites.Items), value);
}

public bool CanOwn => false;
Expand Down
Loading