mirror of
https://github.com/kwsch/NHSE.git
synced 2026-04-24 23:27:14 -05:00
Update IsFlowerGene usage
probably should re-dump itemkind to be more aware of gene/nonGene flower item types, whatever
This commit is contained in:
parent
d6961b0d3d
commit
3dd6b56647
|
|
@ -149,7 +149,7 @@ public string GetItemName(Item item)
|
|||
|
||||
var kind = ItemInfo.GetItemKind(index);
|
||||
|
||||
if (kind.IsFlowerGene())
|
||||
if (kind.IsFlowerGene(index))
|
||||
{
|
||||
var display = GetItemName(index);
|
||||
if (item.Genes != 0)
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ public static class ItemKindExtensions
|
|||
|
||||
public static bool IsFlower(this ItemKind k) => (Kind_Flower <= k && k <= Kind_FlowerBud) || (UnitIcon_FlwAnemone <= k && k <= UnitIcon_FlwTulip);
|
||||
public static bool IsFlowerPicked(this ItemKind k) => k == Kind_Flower || (UnitIcon_FlwAnemone <= k && k <= UnitIcon_FlwTulip);
|
||||
public static bool IsFlowerGene(this ItemKind k) => k.IsFlower() && !k.IsFlowerPicked();
|
||||
public static bool IsFlowerGene(this ItemKind k, ushort id) => k.IsFlower() && (id >= 60_000 || !k.IsFlowerPicked());
|
||||
public static bool IsClothing(this ItemKind k) => Clothing.Contains(k);
|
||||
public static bool IsCrafting(this ItemKind k) => k == Kind_Ore || k == Kind_CraftMaterial || k == Kind_CraftPhoneCase || k == Kind_CraftRemake;
|
||||
public static bool IsFurniture(this ItemKind k) => Furniture.Contains(k);
|
||||
|
|
|
|||
|
|
@ -88,8 +88,9 @@ private static void DrawDirectionals(int[] data, ItemLayer layer, int w, int x0,
|
|||
else if (tile.IsExtension)
|
||||
DrawDirectional(data, tile, (x - x0) * scale, (y - y0) * scale, scale, w);
|
||||
|
||||
var kind = ItemInfo.GetItemKind(tile.DisplayItemId);
|
||||
if (kind.IsFlowerGene())
|
||||
var id = tile.DisplayItemId;
|
||||
var kind = ItemInfo.GetItemKind(id);
|
||||
if (kind.IsFlowerGene(id))
|
||||
{
|
||||
int geneIndex;
|
||||
if (tile.IsRoot)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public Item LoadItem(Item item)
|
|||
CB_ItemID.SelectedValue = (int)id;
|
||||
var kind = ItemInfo.GetItemKind(id);
|
||||
|
||||
if (kind.IsFlowerGene())
|
||||
if (kind.IsFlowerGene(id))
|
||||
{
|
||||
LoadGenes(item.Genes);
|
||||
CHK_Gold.Checked = item.IsWateredGold;
|
||||
|
|
@ -120,7 +120,7 @@ public Item SetItem(Item item)
|
|||
var kind = ItemInfo.GetItemKind(id);
|
||||
|
||||
item.ItemId = id;
|
||||
if (kind.IsFlowerGene())
|
||||
if (kind.IsFlowerGene(id))
|
||||
{
|
||||
item.Genes = SaveGenes();
|
||||
item.DaysWatered = (int) NUD_WaterDays.Value;
|
||||
|
|
@ -178,7 +178,7 @@ private void CB_ItemID_SelectedValueChanged(object sender, EventArgs e)
|
|||
ChangeItem(itemID, itemCount);
|
||||
var kind = ItemInfo.GetItemKind(itemID);
|
||||
|
||||
ToggleEditorVisibility(kind);
|
||||
ToggleEditorVisibility(kind, itemID);
|
||||
if (!Loading)
|
||||
LoadItemTypeValues(kind, itemID);
|
||||
|
||||
|
|
@ -232,9 +232,9 @@ private void LoadItemTypeValues(ItemKind k, ushort index)
|
|||
FLP_Flag1.Visible = false;
|
||||
}
|
||||
|
||||
private void ToggleEditorVisibility(ItemKind k)
|
||||
private void ToggleEditorVisibility(ItemKind k, ushort id)
|
||||
{
|
||||
if (k.IsFlowerGene())
|
||||
if (k.IsFlowerGene(id))
|
||||
{
|
||||
CB_Recipe.Visible = false;
|
||||
FLP_Uses.Visible = FLP_Count.Visible = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user