Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function initialisemoreHUDArray()
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray called")
- int jItemIDs = jArray.object()
- int jIconNames = jArray.object()
- int Q = 0
- while Q < 5
- int queueLength = JArray.count(targetQ[Q])
- int i = 0
- if Q == 3
- i = 3 ;Skip the potion groups in the consumables queue
- endIf
- while i < queueLength
- ;Clear out any empty indices for good measure
- if !jMap.getStr(jArray.getObj(targetQ[Q], i), "Name")
- jArray.eraseIndex(targetQ[Q], i)
- queueLength -= 1
- endIf
- int itemID = jMap.getInt(jArray.getObj(targetQ[Q], i), "itemID")
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray Q: " + Q + ", i: " + i + ", itemID: " + itemID + ", " + jMap.getStr(jArray.getObj(targetQ[Q], i), "Name"))
- if itemID == 0
- itemID = createItemID(jMap.getStr(jArray.getObj(targetQ[Q], i), "Name"), (jMap.getForm(jArray.getObj(targetQ[Q], i), "Form")).GetFormID())
- jMap.setInt(jArray.getObj(targetQ[Q], i), "itemID", itemID)
- endIf
- if itemID != 0
- int foundAt = -1
- if !(i == 0 && Q == 0)
- foundAt = jArray.findInt(jItemIDs, itemID)
- endIf
- if Q == 1 && foundAt != -1
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray - itemID " + itemID + " already found at index " + foundAt + ", updating icon name to " + moreHUDIcons[3])
- jArray.setStr(jIconNames, foundAt, moreHUDIcons[3])
- else
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray - adding itemID " + itemID + " to jItemIDs")
- jArray.addInt(jItemIDs, itemID)
- if Q < 2
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray - adding " + moreHUDIcons[Q] + " to jIconNames")
- jArray.addStr(jIconNames, moreHUDIcons[Q])
- else
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray - adding " + moreHUDIcons[2] + " to jIconNames")
- jArray.addStr(jIconNames, moreHUDIcons[2])
- endIf
- endIf
- endIf
- i += 1
- endWhile
- Q += 1
- endWhile
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray - jItemIds contains " + jArray.count(jItemIDs) + " entries")
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray - jIconNames contains " + jArray.count(jIconNames) + " entries")
- if jArray.count(jItemIDs) > 0
- int[] itemIDs = new int[128]
- string[] iconNames = new string[128]
- jArray.writeToIntegerPArray(jItemIDs, itemIDs)
- jArray.writeToStringPArray(jIconNames, iconNames)
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray - itemIDs contains " + itemIDs.Length + " entries")
- debug.trace("iEquip_WidgetCore initialisemoreHUDArray - iconNames contains " + iconNames.Length + " entries")
- AhzMoreHudIE.AddIconItems(itemIDs, iconNames)
- endIf
- PO.initialisemoreHUDArray()
- endFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement