Trineks Manager - WIP implementation

This commit is contained in:
2025-11-20 20:51:58 +01:00
parent 78ed61380e
commit 66d4e8b4b2
13 changed files with 3798 additions and 1034 deletions

View File

@@ -24,6 +24,12 @@ namespace Beyond
[HideInInspector]
public bItemType type;
// --- NEW TRINKET FIELD ---
// Removed [HideInInspector] so you can see it in default inspector
// If you have a custom Editor script for bItem, you may need to add a line there to draw this property.
public TrinketColor trinketColor;
// -------------------------
[HideInInspector]
public Sprite icon, secondaryIcon, teriaryIcon;
@@ -94,9 +100,6 @@ namespace Beyond
onDestroy.Invoke(this);
}
/// <summary>
/// Convert Sprite icon to texture
/// </summary>
public Texture2D iconTexture
{
get
@@ -124,22 +127,12 @@ namespace Beyond
}
}
/// <summary>
/// Get the Item Attribute via <seealso cref="vItemAttribute"/>
/// </summary>
/// <param name="attribute"></param>
/// <returns></returns>
public bItemAttribute GetItemAttribute(bItemAttributes attribute)
{
if (attributes != null) return attributes.Find(_attribute => _attribute.name == attribute);
return null;
}
/// <summary>
/// Get the Item Attribute via string
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public bItemAttribute GetItemAttribute(string name)
{
if (attributes != null)
@@ -147,11 +140,6 @@ namespace Beyond
return null;
}
/// <summary>
/// Get Selected Item Attributes via <seealso cref="vItemAttribute"/> by ignoring the ones you don't want
/// </summary>
/// <param name="ignore"></param>
/// <returns></returns>
public string GetItemAttributesText(List<bItemAttributes> ignore = null)
{
System.Text.StringBuilder text = new System.Text.StringBuilder();
@@ -163,29 +151,15 @@ namespace Beyond
return text.ToString();
}
/// <summary>
/// Get Item Attribute Text
/// </summary>
/// <param name="i"></param>
/// <returns></returns>
protected string GetItemAttributeText(int i)
{
if (attributes.Count > 0 && i < attributes.Count)
{
if (attributes.Count > 0 && i < attributes.Count)
{
return attributes[i].GetDisplayText();
}
return attributes[i].GetDisplayText();
}
return string.Empty;
}
/// <summary>
/// Get Item Attribut Text with a custom Format to display
/// </summary>
/// <param name="i"></param>
/// <param name="customFormat"></param>
/// <returns></returns>
protected string GetItemAttributeText(int i, string customFormat)
{
if (attributes.Count > 0 && i < attributes.Count)
@@ -195,20 +169,11 @@ namespace Beyond
return string.Empty;
}
/// <summary>
/// Get Default Item type text
/// </summary>
/// <returns></returns>
public string ItemTypeText()
{
return ItemTypeText(type.DisplayFormat());
}
/// <summary>
/// Get Custom Item type text
/// </summary>
/// <param name="format"> Custom format for text </param>
/// <returns></returns>
public string ItemTypeText(string format)
{
var _text = format;
@@ -219,12 +184,6 @@ namespace Beyond
return _text;
}
/// <summary>
/// Get Item Full Description text including item Name, Type, Description and Attributes
/// </summary>
/// <param name="format">Custom format</param>
/// <param name="ignoreAttributes">Attributes to ignore</param>
/// <returns></returns>
public string GetFullItemDescription(string format = null, List<bItemAttributes> ignoreAttributes = null)
{
string text = "";