public void Log(string text) { Text textElement = TextElements.Grab(Holder); textElement.text = text; EditorLog.Log(text); }
public void Log(string text) { var textElement = textElements.Grab(holder); textElement.text = text; if (state == State.FadingOut) { state = State.FadingIn; currentTime = 1.0f - currentTime; } else if (state == State.Waiting) { currentTime = 0.0f; } else if (state == State.Hidden) { state = State.FadingIn; currentTime = 0.0f; } }
public void Render(ItemSurrogate target) { statsPool.Flush(); effectTextPool.Flush(); enchantmentTextPool.Flush(); slotRender.RenderItem(target); itemUsage.text = target.EquiptableSlot.ToString(); Description.text = target.Description; var equippableNode = target.Template.GetNode <EquiptableItemNode>(); if (equippableNode != null) { if (equippableNode.RequiredLevel != 0) { itemRequirements.text = "Requires Level <color=#fff>" + equippableNode.RequiredLevel + "</color>"; } } else { itemRequirements.text = ""; } var weaponNode = target.Template.GetNode <WeaponInputNode>(); if (weaponNode != null) { statsPool.Grab(tableHolder).Setup("Damage", weaponNode.GetStats(target).Attack.Value.ToString("0") + " Phys", weaponNode.GetStats(target).Attack.ModifiersCount > 1); statsPool.Grab(tableHolder).Setup("Attack Speed", weaponNode.GetStats(target).AttackSpeed.Value.ToString("0.00"), weaponNode.GetStats(target).AttackSpeed.ModifiersCount > 1); statsPool.Grab(tableHolder).Setup("Critical Chance", weaponNode.GetStats(target).CriticalStrikeChance.Value.ToString("0.0") + " %", weaponNode.GetStats(target).CriticalStrikeChance.ModifiersCount > 1); statsPool.Grab(tableHolder).Setup("Critical Multiplier", weaponNode.GetStats(target).CriticalStrikeMultiplier.Value.ToString("0.0"), weaponNode.GetStats(target).CriticalStrikeMultiplier.ModifiersCount > 1); } var armourNode = target.Template.GetNode <ArmourInputNode>(); if (armourNode != null) { statsPool.Grab(tableHolder).Setup("Armour", armourNode.GetStats(target).Armour.Value.ToString("0"), armourNode.GetStats(target).Armour.ModifiersCount > 1); } var tooltipNodes = target.Template.GetNodes <INodeDescription>(); if (tooltipNodes.Length != 0) { effectsHolder.gameObject.SetActive(true); for (int i = 0; i < tooltipNodes.Length; i++) { effectTextPool.Grab(effectsHolder).text = tooltipNodes[i].Description(target); } } else { effectsHolder.gameObject.SetActive(false); } bool found = false; foreach (var Enchantment in target.Enchantments) { if (Enchantment == null) { continue; } var enchantmentTooltipNodes = Enchantment.Template.GetNodes <INodeDescription>(); if (enchantmentTooltipNodes.Length != 0) { found = true; for (int i = 0; i < enchantmentTooltipNodes.Length; i++) { enchantmentTextPool.Grab(enchantmentsHolder).text = enchantmentTooltipNodes[i].Description(Enchantment); } } } enchantmentsHolder.gameObject.SetActive(found); }
public void Render(ItemSurrogate target) { statsPool.Flush(); effectTextPool.Flush(); enchantmentTextPool.Flush(); slotRender.RenderItem(target); itemUsage.text = target.EquiptableSlot.ToString(); itemRequirements.text = "Requires Level <color=#fff>35</color>"; Description.text = target.Description; var weaponNode = target.Template.GetNode <WeaponInputNode> (); if (weaponNode != null) { statsPool.Grab(tableHolder).Setup("Damage", weaponNode.AttackDamage[target].Value.ToString("0") + "-" + weaponNode.AttackDamage[target].Value.ToString("0") + " Phys"); statsPool.Grab(tableHolder).Setup("Attack Speed", weaponNode.AttackSpeed[target].Value.ToString("0.00")); statsPool.Grab(tableHolder).Setup("Critical Chance", weaponNode.CriticalChance[target].Value.ToString("0.0") + " %"); statsPool.Grab(tableHolder).Setup("Critical Multiplier", weaponNode.CriticalMultiplier[target].Value.ToString("0.0")); } var armourNode = target.Template.GetNode <ArmourInputNode> (); if (armourNode != null) { statsPool.Grab(tableHolder).Setup("Armour", armourNode.Armour[target].Value.ToString("0")); } EffectTooltipNode[] tooltipNodes = target.Template.GetNodes <EffectTooltipNode> (); StatsNode[] nodes = target.Template.GetNodes <StatsNode> (); if (tooltipNodes.Length != 0 || nodes.Length != 0) { effectsHolder.gameObject.SetActive(true); for (int i = 0; i < tooltipNodes.Length; i++) { EffectTooltipNode statNode = tooltipNodes[i]; effectTextPool.Grab(effectsHolder).text = statNode.Description(target); } for (int i = 0; i < nodes.Length; i++) { StatsNode statNode = nodes[i]; effectTextPool.Grab(effectsHolder).text = statNode.Description(target); } } else { effectsHolder.gameObject.SetActive(false); } bool found = false; foreach (var Enchantment in target.Enchantments) { if (Enchantment == null) { continue; } EffectTooltipNode[] enchantmentTooltipNodes = Enchantment.Template.GetNodes <EffectTooltipNode> (); StatsNode[] enchantmentNodes = Enchantment.Template.GetNodes <StatsNode> (); if (enchantmentTooltipNodes.Length != 0 || enchantmentNodes.Length != 0) { found = true; for (int i = 0; i < enchantmentTooltipNodes.Length; i++) { EffectTooltipNode enchantmentTooltipNode = enchantmentTooltipNodes[i]; enchantmentTextPool.Grab(enchantmentsHolder).text = enchantmentTooltipNode.Description(Enchantment); } for (int i = 0; i < enchantmentNodes.Length; i++) { StatsNode enchantmentStatNode = enchantmentNodes[i]; enchantmentTextPool.Grab(enchantmentsHolder).text = enchantmentStatNode.Description(Enchantment); } } } enchantmentsHolder.gameObject.SetActive(found); }