package ItemTooltipGen import initlater StatHandler import initlater EquipmentClassification import ItemTypeData string tooltipHeader string tooltipStats string tooltipDescription string tooltipRecipeReq public function tooltipReset() tooltipHeader = "" tooltipStats = "" tooltipDescription = "" tooltipRecipeReq = "" public function tooltipAddStatList(StatList statList) let iter = statList.iterator() for Stat s from iter if tooltipStats != "" tooltipStats += "\n" tooltipStats = tooltipStats + tooltipConvertStat(s, iter.currentValue()) iter.close() public function tooltipAddRecipeReq(ItemTypeData itemTypeData) tooltipRecipeReq = "|cffffcc00Requires:|r" if itemTypeData.recipeReq1 != 0 tooltipRecipeReq += "\n" + itemTypeData.recipeReq1.xGetItemTypeData().name if itemTypeData.recipeReq2 != 0 tooltipRecipeReq += "\n" + itemTypeData.recipeReq2.xGetItemTypeData().name if itemTypeData.recipeReq3 != 0 tooltipRecipeReq += "\n" + itemTypeData.recipeReq3.xGetItemTypeData().name if itemTypeData.recipeReq4 != 0 tooltipRecipeReq += "\n" + itemTypeData.recipeReq4.xGetItemTypeData().name if itemTypeData.recipeReq5 != 0 tooltipRecipeReq += "\n" + itemTypeData.recipeReq5.xGetItemTypeData().name if itemTypeData.recipeReq6 != 0 tooltipRecipeReq += "\n" + itemTypeData.recipeReq6.xGetItemTypeData().name if itemTypeData.recipeReq7 != 0 tooltipRecipeReq += "\n" + itemTypeData.recipeReq7.xGetItemTypeData().name if itemTypeData.recipeReq8 != 0 tooltipRecipeReq += "\n" + itemTypeData.recipeReq8.xGetItemTypeData().name public function tooltipAddDescription(string description) tooltipDescription = description public function tooltipAddEquipmentProperties(EqSlo equipmentSlot, EqCla equipmentClass) tooltipHeader = "|cffB3B3B3" switch equipmentSlot case MAI tooltipHeader += "Mainhand" case OFF tooltipHeader += "Offhand" case CHE tooltipHeader += "Chest" case HEL tooltipHeader += "Helmet" case MIS tooltipHeader += "Misc" case ACC tooltipHeader += "Accessory" tooltipHeader += " - " switch equipmentClass case SWO tooltipHeader += "Sword" case AXE tooltipHeader += "Axe" case DAG tooltipHeader += "Dagger" case TWO tooltipHeader += "Twohanded" case STA tooltipHeader += "Staff" case BOW tooltipHeader += "Bow" case SHI tooltipHeader += "Shield" case ORB tooltipHeader += "Orb" case QUI tooltipHeader += "Quiver" case KNI tooltipHeader += "Knife" case CHA tooltipHeader += "Chain" case LEA tooltipHeader += "Leather" case CLO tooltipHeader += "Cloth" case ACC tooltipHeader += "Accessory" tooltipHeader += "|r" public function tooltipAddMaterialProperties() tooltipHeader = "|cffB3B3B3Material|r" public function tooltipAddRecipeProperties() tooltipHeader = "|cffB3B3B3Recipe|r" public function tooltipGet() returns string string tooltip = "" // Add header: if tooltipHeader != "" tooltip += tooltipHeader // Add stats: if tooltipStats != "" if tooltip != "" tooltip += "\n\n" tooltip += tooltipStats // Add recipe requirements: if tooltipRecipeReq != "" if tooltip != "" tooltip += "\n\n" tooltip += tooltipRecipeReq // Add description: if tooltipDescription != "" if tooltip != "" tooltip += "\n\n" tooltip += tooltipDescription return tooltip public function tooltipColorizeItemName(string itemName, EqQua equipmentQuality) returns string string name = "" switch equipmentQuality case NOR name = itemName case RAR name = "|cff3B85ED" + itemName + "|r" case EPI name = "|cffA938FF" + itemName + "|r" return name function tooltipConvertStat(Stat stat, int value) returns string var name = "" var valueConverted = value var sign = "+" var suffix = "" switch stat case LIFE name = "Life" case MANA name = "Mana" case LREG name = "Lifereg" case MREG name = "Manareg" case STRE name = "Str" case AGIL name = "Agi" case INTE name = "Int" case DAMA name = "Attack Power" case DAMP name = "Attack Power" suffix = "%" case ARMO name = "Armor" case ASPD name = "Aspd" suffix = "%" case MOVE name = "Movespeed" case EVAS name = "Evasion" suffix = "%" case CCHA name = "Critchance" suffix = "%" case CMUL name = "Critdamage" suffix = "%" case CBON name = "Critbonus" case HREC name = "Heal Received" suffix = "%" case ATHR name = "Attack Threat" suffix = "%" case CSPE name = "Casttime" sign = "-" suffix = "%" case STRW case AGIW case INTW return name + " " + sign + valueConverted.toString() + suffix