candrei98

[PY]Cube needed item with count

Dec 18th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1. ### pack/root/uicube.py || Scorpion1453
  2.  
  3. ## Find || Arat: (Around 336th line || 336.satır civarlarında)
  4. def __OverInMaterialSlot(self, trash, resultIndex, col):
  5. ## Change definition(function) || Fonksiyonu değiştir:
  6.     def __OverInMaterialSlot(self, trash, resultIndex, col):
  7.         self.tooltipItem.ClearToolTip()
  8.         self.tooltipItem.SetCannotUseItemForceSetDisableColor(FALSE)
  9.  
  10.         resultIndex = resultIndex + self.firstSlotIndex
  11.  
  12.         if resultIndex not in self.cubeMaterialInfos:
  13.             return
  14.  
  15.         i = 0
  16.         materialInfo = self.cubeMaterialInfos[resultIndex]
  17.         materialCount = len(materialInfo[col])
  18.  
  19.         for itemVnum, count in materialInfo[col]:
  20.             item.SelectItem(itemVnum)
  21.             if player.GetItemCountByVnum(itemVnum) >= count:
  22.                 self.tooltipItem.AppendTextLine("%s" % (item.GetItemName()), grp.GenerateColor(0.5411, 0.7254, 0.5568, 1.0)).SetFeather()
  23.             else:
  24.                 self.tooltipItem.AppendTextLine("%s" % (item.GetItemName()), grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)).SetFeather()
  25.            
  26.             if i < materialCount - 1:
  27.                 self.tooltipItem.AppendTextLine(uiScriptLocale.CUBE_REQUIRE_MATERIAL_OR)
  28.                
  29.             i = i + 1
  30.  
  31.         self.tooltipItem.Show()
Advertisement
Add Comment
Please, Sign In to add comment