DEV Community

John
John

Posted on

Dev Log 23 - Fruitful Imports

🧠 Dev Log: “Fruitful Imports & Tooltip Resurrection”
Date: 21 Sept 2025
Mood: Focused, mildly amused Condition: 85 (Fresh)
Tags: #ImporterFix #TooltipObedience #ConditionSystem #FruitRecovery #RarityInjection #DurabilityTaxonomy

âś… Morning Rituals: Tooltip Panel Obedience
Problem: Tooltip panel was leaking editor text like a rookie intern showing debug logs to players. Fix:

Panel now starts visible but spiritually empty.

All text fields are cleared at runtime until a slot is clicked.

No more behind-the-curtain nonsense.

Bonus: Tooltip now shows Condition: 85 with a gradient from red (0) to green (100). No fluff, just numerical truth.

🍎 Fruit Item Resurrection
Issue: Fruit items were spiritually hollow—missing condition, lore, and any sense of identity. Fix:

Added condition field (0–100 scale)

Added loreTag (flavor text, not to be confused with actual flavor)

Added rarity field (defaults to Common, but can be Legendary Apple of Destiny if you’re feeling spicy)

Wired GetConditionLabel() to return "Fresh", "Rotten", "Inedible" etc. based on durability

🧬 InventoryItem Upgrade
Added to all item categories , as some were missing - ;

rarity field

category field

GetConditionLabel() with category-aware mapping

IsCooked property using CookingTags array

Result:

Tooltip now shows Condition: Rotten (10) for fruit and Condition: Very Good (85) for weapons.

No more “Fresh” apples with 0 durability. That lie has been purged.

🛠️ GeneralItemImporter Overhaul
New Powers:

Auto-injects condition, loreTag, and rarity during import

Uses category-aware label mapping (Food, Gear, Weapon, Liquid, Generic)

No more duplicate Sanitize() errors—those demons have been exorcised

Outcome:

Every item imported from ZImport.json now arrives with a soul, a story, and a survival rating.

đź§Ş Testing Notes
Tooltip obeys on click

Fruit items now show proper condition and lore

No editor leaks

No runtime exceptions

One apple showed Condition: 100 and I nearly wept, fighting the tooltip inspector for hours with many failed fixes, finally landed on the one that worked.

Extended condition label mapping to liquids, gear, and weapons

Auto-colour rarity in tooltip or inventory grid

đź§™ Mythic Summary
Today I reforged the tooltip, resurrected the fruit, Reloaded the entire fruit item asset files and even added some new additions, taught the importer to speak in tongues. The grind was real, but the outcome was modular. The system now obeys. The apple is fresh. The log is sealed.

âś… Dev Update: Item Data Unification Pass (Refactor v2)
Date: 21 Sept 2025

Scope: All ItemAsset, ItemEntry, and ItemData classes across food, gear, tools, weapons, liquids, seeds, and attachments.

đź”§ Goals
Standardize metadata across all item types for prefab-safe injection, tooltip display, and importer compatibility

Ensure every item supports fall-back condition labelling, rarity tiering, and category routing

Eliminate special cases and legacy inconsistencies from earlier rollout phases

ItemID, DisplayName, Description, Icon, Durability, RemainingUses

LoreTag, Rarity, Category, ConditionLabel, IsGear

đź§Ľ Cleanup
Removed deprecated slotSize field from ItemData

Ensured condition and durability are unified and respected across all systems

Added isPerishable flag to support future decay logic

Ensured all assets fallback to name if itemID or displayName is missing

🧱 Dev Log — Item Condition System & Tooltip Integration
Date: 21 Sept 2025

Subsystems: ItemConditionResolver.cs, ItemTooltipManager.cs, InventoryItem.cs

âś… Condition Taxonomy Expansion
Created modular condition scales for 18 item categories: Fruit, Vegetable, Fish, Meat, MiscFood, Liquid, Gear, Mechanical, RangedWeapon, RangedAttachment, MeleeWeapon, Tool, MiscItem, CookingItem, Seed, Ammo, Clothing, Armour

Each scale includes:

10-tier durability mapping

Lore-aware labels (e.g. "Viable", "Cracked", "Unstable", "Dead")

Gameplay impact notes (e.g. jam chance, hygiene risk, crop failure)

Centralized colour mapping via GetConditionColor(label)

Cooked state override for food categories ("Cooked" label, orange hue)

đź§  Tooltip System Integration
Refactored ItemTooltipManager.cs to:

Pull category, durability, and isCooked from item

Call ItemConditionResolver.GetConditionLabel() and .GetConditionColor()

Apply label and colour to condition text, durability text, and condition bar

Removed legacy durability colour logic (GetColorForDurability) "(Coding Americanised)

Tooltip now reflects full condition fidelity across all item types

đź§© InventoryItem Enhancements
Added IsCooked property using CookingTags array:

Tooltip text now dynamically reflects condition label and durability

đź§Ľ Cleanup & Safety
Removed hardcoded fallback logic from InventoryItem.GetConditionLabel()

Ensured prefab safety and modular routing across all condition categories

Future-proofed for JSON/modding integration, stat modifiers, and flavor text injection

⚡ This was a milestone day. We ( Me and Copilot ) didn’t just fix the tooltip—we taught it to obey. We didn’t just label the apple—we gave it a soul. We didn’t just unify the system—we made it modular, mythic, and simulation-grade. The grind was real. The apple is fresh. The log is sealed.

Example script for flavour : condition labels - resolver for tooltip manager and item data.

`using UnityEngine;

public static class ItemConditionResolver
{
public static string GetConditionLabel(string category, int durability, bool isCooked = false)
{
return category switch
{
"Fruit" => GetFruitConditionLabel(durability),
"Vegetable" => GetVegetableConditionLabel(durability),
"Fish" => GetFishConditionLabel(durability, isCooked),
"Meat" => GetMeatConditionLabel(durability, isCooked),
"MiscFood" => GetMiscFoodConditionLabel(durability, isCooked),
"Liquid" => GetLiquidConditionLabel(durability),
"Gear" => GetGearConditionLabel(durability),
"Mechanical" => GetMechanicalConditionLabel(durability),
"RangedWeapon" => GetRangedWeaponConditionLabel(durability),
"RangedAttachment" => GetRangedAttachmentConditionLabel(durability),
"MeleeWeapon" => GetMeleeWeaponConditionLabel(durability),
"Tool" => GetToolConditionLabel(durability),
"MiscItem" => GetMiscItemConditionLabel(durability),
"CookingItem" => GetCookingItemConditionLabel(durability),
"Seed" => GetSeedConditionLabel(durability),
_ => "Unknown"
};
}

public static Color GetConditionColor(string label)
{
    return label switch
    {
        // Shared edible states
        "Fresh" => new Color(0.3f, 0.9f, 0.3f),
        "Firm" => new Color(0.4f, 0.9f, 0.4f),
        "Good" => new Color(0.5f, 1.0f, 0.5f),
        "Aging" => new Color(0.8f, 0.9f, 0.4f),
        "Bruised" => new Color(1.0f, 0.65f, 0.0f),
        "Softening" => new Color(1.0f, 0.8f, 0.3f),
        "Wilted" => new Color(1.0f, 0.9f, 0.5f),
        "Overripe" => new Color(1.0f, 1.0f, 0.0f),
        "Fishy" => new Color(1.0f, 0.6f, 0.2f),
        "Gamey" => new Color(1.0f, 0.5f, 0.2f),
        "Flat" => new Color(0.9f, 0.9f, 0.6f),
        "Drying" => new Color(0.9f, 0.8f, 0.5f),
        "Compromised" => new Color(1.0f, 0.5f, 0.0f),
        "Spoiling" => new Color(1.0f, 0.4f, 0.0f),
        "Rotting" => new Color(1.0f, 0.2f, 0.2f),
        "Putrid" => new Color(0.6f, 0.0f, 0.0f),
        "Contaminated" => new Color(0.5f, 0.0f, 0.0f),
        "Toxic" => new Color(0.4f, 0.0f, 0.0f),
        "Dead" => new Color(0.3f, 0.0f, 0.0f),
        "Ruined" => new Color(0.2f, 0.2f, 0.2f),

        // Category-specific
        "Ripe" => new Color(0.0f, 1.0f, 0.0f),
        "Crisp" => new Color(0.0f, 1.0f, 0.0f),
        "Sealed" => new Color(0.6f, 0.9f, 1.0f),
        "Pure" => new Color(0.6f, 0.9f, 1.0f),
        "Clean" => new Color(0.5f, 1.0f, 0.8f),
        "Stable" => new Color(0.8f, 0.9f, 0.6f),
        "Viable" => new Color(0.3f, 1.0f, 0.3f),
        "Healthy" => new Color(0.4f, 1.0f, 0.4f),
        "Weak" => new Color(1.0f, 0.6f, 0.2f),

        // Cooked override
        "Cooked" => new Color(0.9f, 0.6f, 0.2f),

        // Gear and mechanical
        "New" => new Color(0.6f, 0.9f, 1.0f),
        "Pristine" => new Color(0.0f, 1.0f, 0.0f),
        "Very Good" => new Color(0.4f, 0.9f, 0.4f),
        "Worn" => new Color(1.0f, 0.65f, 0.0f),
        "Damaged" => new Color(1.0f, 0.3f, 0.3f),
        "Broken" => new Color(0.5f, 0.0f, 0.0f),

        _ => Color.gray
    };
}

private static string GetFruitConditionLabel(int durability)
{
    if (durability == 100) return "Ripe";
    if (durability >= 90) return "Fresh";
    if (durability >= 80) return "Firm";
    if (durability >= 70) return "Good";
    if (durability >= 60) return "Bruised";
    if (durability >= 50) return "Softening";
    if (durability >= 40) return "Overripe";
    if (durability >= 30) return "Spoiling";
    if (durability >= 15) return "Rotting";
    return "Ruined";
}

private static string GetVegetableConditionLabel(int durability)
{
    if (durability == 100) return "Crisp";
    if (durability >= 90) return "Fresh";
    if (durability >= 80) return "Firm";
    if (durability >= 70) return "Good";
    if (durability >= 60) return "Bruised";
    if (durability >= 50) return "Softening";
    if (durability >= 40) return "Wilted";
    if (durability >= 30) return "Spoiling";
    if (durability >= 15) return "Rotting";
    return "Ruined";
}

private static string GetFishConditionLabel(int durability, bool isCooked)
{
    if (isCooked) return "Cooked";
    if (durability == 100) return "Fresh";
    if (durability >= 90) return "Firm";
    if (durability >= 80) return "Good";
    if (durability >= 70) return "Aging";
    if (durability >= 60) return "Softening";
    if (durability >= 50) return "Fishy";
    if (durability >= 40) return "Spoiling";
    if (durability >= 30) return "Rotting";
    if (durability >= 15) return "Putrid";
    return "Ruined";
}

private static string GetMeatConditionLabel(int durability, bool isCooked)
{
    if (isCooked) return "Cooked";
    if (durability == 100) return "Fresh";
    if (durability >= 90) return "Firm";
    if (durability >= 80) return "Good";
    if (durability >= 70) return "Aging";
    if (durability >= 60) return "Softening";
    if (durability >= 50) return "Gamey";
    if (durability >= 40) return "Spoiling";
    if (durability >= 30) return "Rotting";
    if (durability >= 15) return "Putrid";
    return "Ruined";
}
private static string GetMiscFoodConditionLabel(int durability, bool isCooked)
{
    if (isCooked) return "Cooked";
    if (durability == 100) return "Sealed";
    if (durability >= 90) return "Fresh";
    if (durability >= 80) return "Good";
    if (durability >= 70) return "Stale";
    if (durability >= 60) return "Drying";
    if (durability >= 50) return "Aging";
    if (durability >= 40) return "Compromised";
    if (durability >= 30) return "Spoiling";
    if (durability >= 15) return "Contaminated";
    return "Ruined";
}

private static string GetLiquidConditionLabel(int durability)
{
    if (durability == 100) return "Pure";
    if (durability >= 90) return "Fresh";
    if (durability >= 80) return "Clean";
    if (durability >= 70) return "Stable";
    if (durability >= 60) return "Flat";
    if (durability >= 50) return "Aging";
    if (durability >= 40) return "Contaminated";
    if (durability >= 30) return "Spoiling";
    if (durability >= 15) return "Toxic";
    return "Ruined";
}

private static string GetGearConditionLabel(int durability)
{
    if (durability >= 90) return "Pristine";
    if (durability >= 75) return "Very Good";
    if (durability >= 60) return "Good";
    if (durability >= 45) return "Worn";
    if (durability >= 30) return "Damaged";
    if (durability >= 15) return "Broken";
    return "Ruined";
}

private static string GetMechanicalConditionLabel(int durability)
{
    if (durability == 100) return "New";
    if (durability >= 90) return "Pristine";
    if (durability >= 80) return "Excellent";
    if (durability >= 70) return "Good";
    if (durability >= 60) return "Used";
    if (durability >= 50) return "Worn";
    if (durability >= 40) return "Degraded";
    if (durability >= 30) return "Faulty";
    if (durability >= 15) return "Broken";
    return "Ruined";
}

private static string GetRangedWeaponConditionLabel(int durability)
{
    if (durability == 100) return "New";
    if (durability >= 90) return "Pristine";
    if (durability >= 80) return "Excellent";
    if (durability >= 70) return "Reliable";
    if (durability >= 60) return "Used";
    if (durability >= 50) return "Worn";
    if (durability >= 40) return "Unstable";
    if (durability >= 30) return "Faulty";
    if (durability >= 15) return "Broken";
    return "Ruined";
}

private static string GetRangedAttachmentConditionLabel(int durability)
{
    if (durability == 100) return "New";
    if (durability >= 90) return "Pristine";
    if (durability >= 80) return "Excellent";
    if (durability >= 70) return "Reliable";
    if (durability >= 60) return "Used";
    if (durability >= 50) return "Worn";
    if (durability >= 40) return "Unstable";
    if (durability >= 30) return "Faulty";
    if (durability >= 15) return "Broken";
    return "Ruined";
}

private static string GetMeleeWeaponConditionLabel(int durability)
{
    if (durability == 100) return "New";
    if (durability >= 90) return "Pristine";
    if (durability >= 80) return "Sharp";
    if (durability >= 70) return "Reliable";
    if (durability >= 60) return "Used";
    if (durability >= 50) return "Worn";
    if (durability >= 40) return "Dull";
    if (durability >= 30) return "Unbalanced";
    if (durability >= 15) return "Broken";
    return "Ruined";
}

private static string GetToolConditionLabel(int durability)
{
    if (durability == 100) return "New";
    if (durability >= 90) return "Pristine";
    if (durability >= 80) return "Functional";
    if (durability >= 70) return "Reliable";
    if (durability >= 60) return "Used";
    if (durability >= 50) return "Worn";
    if (durability >= 40) return "Degraded";
    if (durability >= 30) return "Faulty";
    if (durability >= 15) return "Broken";
    return "Ruined";
}
private static string GetMiscItemConditionLabel(int durability)
{
    if (durability == 100) return "New";
    if (durability >= 90) return "Pristine";
    if (durability >= 80) return "Intact";
    if (durability >= 70) return "Usable";
    if (durability >= 60) return "Worn";
    if (durability >= 50) return "Damaged";
    if (durability >= 40) return "Compromised";
    if (durability >= 30) return "Unreliable";
    if (durability >= 15) return "Broken";
    return "Ruined";
}

private static string GetCookingItemConditionLabel(int durability)
{
    if (durability == 100) return "New";
    if (durability >= 90) return "Pristine";
    if (durability >= 80) return "Clean";
    if (durability >= 70) return "Used";
    if (durability >= 60) return "Worn";
    if (durability >= 50) return "Stained";
    if (durability >= 40) return "Degraded";
    if (durability >= 30) return "Cracked";
    if (durability >= 15) return "Broken";
    return "Ruined";
}

private static string GetSeedConditionLabel(int durability)
{
    if (durability == 100) return "Viable";
    if (durability >= 90) return "Fresh";
    if (durability >= 80) return "Healthy";
    if (durability >= 70) return "Stable";
    if (durability >= 60) return "Drying";
    if (durability >= 50) return "Aging";
    if (durability >= 40) return "Weak";
    if (durability >= 30) return "Spoiling";
    if (durability >= 15) return "Dead";
    return "Ruined";
}

private static string GetAmmoConditionLabel(int durability)
{
    if (durability == 100) return "New";
    if (durability >= 90) return "Pristine";
    if (durability >= 80) return "Stable";
    if (durability >= 70) return "Reliable";
    if (durability >= 60) return "Used";
    if (durability >= 50) return "Worn";
    if (durability >= 40) return "Degraded";
    if (durability >= 30) return "Unstable";
    if (durability >= 15) return "Faulty";
    return "Ruined";
}
Enter fullscreen mode Exit fullscreen mode

}
`

May or may not be final , but is a good blueprint point. made some good progress again , even if slowed by a tooltip panel for a few hours. :/

Top comments (0)