Advertisement
dunc001

Untitled

Nov 16th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. function initialisemoreHUDArray()
  2. debug.trace("iEquip_WidgetCore initialisemoreHUDArray called")
  3.  
  4. int jItemIDs = jArray.object()
  5. int jIconNames = jArray.object()
  6. int Q = 0
  7.  
  8. while Q < 5
  9. int queueLength = JArray.count(targetQ[Q])
  10. int i = 0
  11. if Q == 3
  12. i = 3 ;Skip the potion groups in the consumables queue
  13. endIf
  14.  
  15. while i < queueLength
  16. ;Clear out any empty indices for good measure
  17. if !jMap.getStr(jArray.getObj(targetQ[Q], i), "Name")
  18. jArray.eraseIndex(targetQ[Q], i)
  19. queueLength -= 1
  20. endIf
  21. int itemID = jMap.getInt(jArray.getObj(targetQ[Q], i), "itemID")
  22. debug.trace("iEquip_WidgetCore initialisemoreHUDArray Q: " + Q + ", i: " + i + ", itemID: " + itemID + ", " + jMap.getStr(jArray.getObj(targetQ[Q], i), "Name"))
  23. if itemID == 0
  24. itemID = createItemID(jMap.getStr(jArray.getObj(targetQ[Q], i), "Name"), (jMap.getForm(jArray.getObj(targetQ[Q], i), "Form")).GetFormID())
  25. jMap.setInt(jArray.getObj(targetQ[Q], i), "itemID", itemID)
  26. endIf
  27. if itemID != 0
  28. int foundAt = -1
  29. if !(i == 0 && Q == 0)
  30. foundAt = jArray.findInt(jItemIDs, itemID)
  31. endIf
  32. if Q == 1 && foundAt != -1
  33. debug.trace("iEquip_WidgetCore initialisemoreHUDArray - itemID " + itemID + " already found at index " + foundAt + ", updating icon name to " + moreHUDIcons[3])
  34. jArray.setStr(jIconNames, foundAt, moreHUDIcons[3])
  35. else
  36. debug.trace("iEquip_WidgetCore initialisemoreHUDArray - adding itemID " + itemID + " to jItemIDs")
  37. jArray.addInt(jItemIDs, itemID)
  38. if Q < 2
  39. debug.trace("iEquip_WidgetCore initialisemoreHUDArray - adding " + moreHUDIcons[Q] + " to jIconNames")
  40. jArray.addStr(jIconNames, moreHUDIcons[Q])
  41. else
  42. debug.trace("iEquip_WidgetCore initialisemoreHUDArray - adding " + moreHUDIcons[2] + " to jIconNames")
  43. jArray.addStr(jIconNames, moreHUDIcons[2])
  44. endIf
  45. endIf
  46. endIf
  47. i += 1
  48. endWhile
  49.  
  50. Q += 1
  51. endWhile
  52. debug.trace("iEquip_WidgetCore initialisemoreHUDArray - jItemIds contains " + jArray.count(jItemIDs) + " entries")
  53. debug.trace("iEquip_WidgetCore initialisemoreHUDArray - jIconNames contains " + jArray.count(jIconNames) + " entries")
  54. if jArray.count(jItemIDs) > 0
  55. int[] itemIDs = new int[128]
  56. string[] iconNames = new string[128]
  57. jArray.writeToIntegerPArray(jItemIDs, itemIDs)
  58. jArray.writeToStringPArray(jIconNames, iconNames)
  59. debug.trace("iEquip_WidgetCore initialisemoreHUDArray - itemIDs contains " + itemIDs.Length + " entries")
  60. debug.trace("iEquip_WidgetCore initialisemoreHUDArray - iconNames contains " + iconNames.Length + " entries")
  61. AhzMoreHudIE.AddIconItems(itemIDs, iconNames)
  62. endIf
  63. PO.initialisemoreHUDArray()
  64. endFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement