1
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

58 lines
1.8 KiB

Scriptname ETR_CellStorageScript extends ObjectReference
FormList Property ETR_ItemsNew Auto
FormList Property ETR_ItemsFound Auto
FormList Property ETR_ItemsStored Auto
FormList Property ETR_PersistentStorageList Auto
event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
Debug.Notification("OnItemRemoved")
bool bStored = ETR_ItemsStored.HasForm(akBaseItem)
if GetItemCount(akBaseItem) > 0
if ! bStored
ETR_ItemsFound.RemoveAddedForm(akBaseItem)
ETR_ItemsNew.RemoveAddedForm(akBaseItem)
ETR_ItemsStored.AddForm(akBaseItem)
Debug.Notification("Added " + akBaseItem.GetName() + " to ETR_ItemsStored.")
endif
return
endif
if Eddoursul_Functions.GetItemCountInList(ETR_PersistentStorageList, akBaseItem)
Debug.Notification("ETR_PersistentStorageList")
; do nothing
if ! bStored
ETR_ItemsFound.RemoveAddedForm(akBaseItem)
ETR_ItemsNew.RemoveAddedForm(akBaseItem)
ETR_ItemsStored.AddForm(akBaseItem)
Debug.Notification("Added " + akBaseItem.GetName() + " to ETR_ItemsStored.")
endif
else
ETR_ItemsNew.RemoveAddedForm(akBaseItem)
ETR_ItemsStored.RemoveAddedForm(akBaseItem)
ETR_ItemsFound.AddForm(akBaseItem)
Debug.Notification("Added " + akBaseItem.GetName() + " to ETR_ItemsFound.")
endif
endevent
event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
if ETR_ItemsStored.HasForm(akBaseItem)
return
endif
ETR_ItemsFound.RemoveAddedForm(akBaseItem)
ETR_ItemsNew.RemoveAddedForm(akBaseItem)
ETR_ItemsStored.AddForm(akBaseItem)
;UI.Invoke("HUD Menu", "_root.AHZWidgetContainer.AHZWidget.RefreshWidgets")
Debug.Notification("Added " + akBaseItem.GetName() + " to cell storage and ETR_ItemsStored.")
endevent