public void Start() { holdingContainer = this.transform.GetComponentInParent <ItemContainerDisplay>(); itemObject = this.GetComponent <ItemDataComponent>(); SetAmountText(itemObject.itemData.stackSize.ToString()); CloudGoods.GetItemTexture(itemObject.itemData.imageName, OnReceivedItemTexture); SetFrameColor(ItemQuailityColorSelector.GetColorForItem(itemObject.itemData)); }
public string Setup() { item = GetComponent <ItemData>(); string formated = "[" + NGUITools.EncodeColor(ItemQuailityColorSelector.GetColorForItem(item)) + "]" + item.name; foreach (KeyValuePair <string, float> pair in item.stats) { if (pair.Key == "Not Available") { continue; } formated = string.Format("{0}\n [" + NGUITools.EncodeColor(Color.white) + "]{1}: {2}", formated, pair.Key, pair.Value); } return(formated); }
public string Setup() { item = GetComponent <ItemDataComponent>().itemData; string formated = ""; foreach (DisaplyOption selectedOption in displayOptions) { switch (selectedOption) { case DisaplyOption.name: if (isQualityColorUsed) { formated += item.itemName.ToRichColor(ItemQuailityColorSelector.GetColorForItem(item)); } else { formated += item.itemName; } break; case DisaplyOption.stats: foreach (KeyValuePair <string, string> pair in item.stats) { if (pair.Key == "Not Available") { continue; } formated = string.Format("{0}\n{1}: {2}", formated, pair.Key, pair.Value.ToString().ToRichColor(Color.yellow)); } break; case DisaplyOption.quantity: formated = string.Format("{0}\n{1}", formated, item.stackSize); break; case DisaplyOption.description: if (!string.IsNullOrEmpty(item.description)) { formated = string.Format("{0}\n{1}", formated, item.description); } break; case DisaplyOption.tag: string tags = ""; foreach (string tg in item.tags) { if (string.IsNullOrEmpty(tags)) { tags = tg; } else { tags = string.Format("{0}, {1}", tags, tg); } } if (item.tags.Count == 0) { if (ShowBlankLineForEmptySelection) { formated = string.Format("{0}\n"); } } else { formated = string.Format("{0}\n{1}", formated, tags); } break; case DisaplyOption.behaviour: foreach (BehaviourDefinition behaviour in item.behaviours) { formated = string.Format("{0}\n{1}", formated, behaviour.Name); } if (item.behaviours.Count == 0 && ShowBlankLineForEmptySelection) { formated = string.Format("{0}\n", formated); } break; case DisaplyOption.behaviourWithDescription: foreach (BehaviourDefinition behaviour in item.behaviours) { formated = string.Format("{0}\n{1}: {2}", formated, behaviour.Name.ToRichColor(Color.white), behaviour.Description.ToRichColor(Color.grey)); } if (item.behaviours.Count == 0 && ShowBlankLineForEmptySelection) { formated = string.Format("{0}\n", formated); } break; case DisaplyOption.space: formated = string.Format("{0}\n", formated); break; case DisaplyOption.varianceID: formated = string.Format("{0}\n{1}", formated, item.ItemID); break; case DisaplyOption.itemID: formated = string.Format("{0}\n{1}", formated, item.CollectionID); break; case DisaplyOption.classID: formated = string.Format("{0}\n{1}", formated, item.classID); break; case DisaplyOption.energy: formated = string.Format("{0}\n{1}", formated, item.totalEnergy); break; case DisaplyOption.stackID: formated = string.Format("{0}\n{1}", formated, item.stackID.ToString()); break; default: break; } } return(formated); }
void Start() { NGUIContainerGameItem containerItem = GetComponent <NGUIContainerGameItem>(); frameSprite.color = ItemQuailityColorSelector.GetColorForItem(containerItem.itemData); }
public string Setup() { item = GetComponent <ItemData>(); string formated = ""; foreach (DisaplyOption selectedOption in displayOptions) { switch (selectedOption) { case DisaplyOption.name: if (isQualityColorUsed) { formated += "[" + NGUITools.EncodeColor(ItemQuailityColorSelector.GetColorForItem(item)) + "]"; } else { formated += "[" + NGUITools.EncodeColor(Color.white) + "]"; } formated += item.name; break; case DisaplyOption.stats: foreach (KeyValuePair <string, float> pair in item.stats) { if (pair.Key == "Not Available") { continue; } formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}: {2}", formated, pair.Key, pair.Value); } break; case DisaplyOption.quantity: formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}", formated, item.stackSize); break; case DisaplyOption.description: if (!string.IsNullOrEmpty(item.description)) { formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}", formated, item.description); } break; case DisaplyOption.salePrice: formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}", formated, item.salePrice); break; case DisaplyOption.behaviour: foreach (BehaviourDefinition behaviour in item.behaviours) { formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}", formated, behaviour.Name); } break; case DisaplyOption.behaviourPlus: foreach (BehaviourDefinition behaviour in item.behaviours) { formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}: {2}", formated, behaviour.Name, behaviour.Description); } break; case DisaplyOption.space: formated = string.Format("{0}\n", formated); break; case DisaplyOption.varianceID: formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}", formated, item.varianceID); break; case DisaplyOption.itemID: formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}", formated, item.itemID); break; case DisaplyOption.classID: formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}", formated, item.classID); break; case DisaplyOption.energy: formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}", formated, item.totalEnergy); break; case DisaplyOption.stackID: formated = string.Format("{0}\n[" + NGUITools.EncodeColor(Color.white) + "]{1}", formated, item.stackID.ToString()); break; default: break; } } return(formated); }