2024-01-22 15:00:04 +00:00
|
|
|
Scriptname _00E_BlueprintCollectionItem extends ObjectReference Hidden
|
|
|
|
|
|
|
|
Event OnEquipped(Actor akActor)
|
|
|
|
|
|
|
|
If akActor != PlayerREF || ! (GetBaseObject() as MiscObject)
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
|
|
|
|
bInventoryMenu = SKSE.GetVersion() > 0 && UI.IsMenuOpen("InventoryMenu")
|
|
|
|
_00E_FS_BlueprintContainerActorREF.SetPlayerTeammate(True, True)
|
|
|
|
|
|
|
|
Int iButton = _00E_FS_Blueprint_Message_SE.Show()
|
|
|
|
If iButton == 0
|
|
|
|
AddBlueprints()
|
|
|
|
ElseIf iButton == 1
|
|
|
|
StoreSingleCopy()
|
|
|
|
ElseIf iButton == 2
|
|
|
|
TakeBlueprints()
|
|
|
|
EndIf
|
|
|
|
|
|
|
|
EndEvent
|
|
|
|
|
|
|
|
Function AddBlueprints()
|
|
|
|
if bInventoryMenu
|
|
|
|
; The DisablePlayerControls method does not remember last inventory tab to return where we were
|
|
|
|
Input.TapKey(Input.GetMappedKey("Tween Menu"))
|
|
|
|
endif
|
|
|
|
Game.DisablePlayerControls(abMenu = true)
|
|
|
|
Game.EnablePlayerControls(abMenu = true)
|
|
|
|
Utility.Wait(0.05)
|
|
|
|
_00E_FS_BlueprintContainerActorREF.ShowGiftMenu(True, _00E_FS_BlueprintList, True, False)
|
|
|
|
if bInventoryMenu
|
|
|
|
Utility.wait(0.2)
|
|
|
|
Input.TapKey(Input.GetMappedKey("Quick Inventory"))
|
|
|
|
endif
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
function StoreSingleCopy()
|
|
|
|
;/ Too slow
|
|
|
|
int iItemsToStore = PlayerREF.GetItemCount(Blueprint) - _00E_FS_BlueprintContainerActorREF.GetItemCount(Blueprint)
|
|
|
|
bool bStoreSilently = iItemsToStore > 3
|
|
|
|
Int iFormIndex = PlayerREF.GetNumItems()
|
|
|
|
While iFormIndex > 0
|
|
|
|
iFormIndex -= 1
|
|
|
|
Form kForm = PlayerREF.GetNthForm(iFormIndex)
|
|
|
|
If kForm as MiscObject && kForm.HasKeyword(Blueprint) && _00E_FS_BlueprintContainerActorREF.GetItemCount(kForm) == 0
|
|
|
|
PlayerREF.RemoveItem(kForm, 1, bStoreSilently, _00E_FS_BlueprintContainerActorREF)
|
|
|
|
EndIf
|
|
|
|
EndWhile
|
|
|
|
if bStoreSilently
|
|
|
|
_00E_FS_BlueprintItemsStored.Show(iItemsToStore)
|
|
|
|
endif
|
|
|
|
/;
|
2024-02-17 09:46:34 +00:00
|
|
|
int iCount = EnderalFunctions.MoveItemsToCountByKeyword(PlayerREF, _00E_FS_BlueprintContainerActorREF, Blueprint, 1)
|
2024-03-02 12:51:34 +00:00
|
|
|
|
|
|
|
if iCount > 0
|
|
|
|
ITMBookClose.Play(PlayerREF)
|
|
|
|
|
|
|
|
; Moving items is fast, refreshing inventory is not
|
2024-02-17 09:46:34 +00:00
|
|
|
Utility.WaitMenuMode(0.5)
|
2024-03-02 12:51:34 +00:00
|
|
|
Form item = Game.GetForm(0x1FE82) ; non-playable Draugr Skin
|
|
|
|
PlayerREF.RemoveItem(item, 1, true)
|
|
|
|
|
|
|
|
if iCount > 150
|
|
|
|
Utility.WaitMenuMode(0.5)
|
|
|
|
PlayerREF.RemoveItem(item, 1, true) ; doing this twice seems to reliably refresh inventory
|
|
|
|
endif
|
2024-02-17 09:46:34 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
_00E_FS_BlueprintItemsStored.Show(iCount)
|
2024-01-22 15:00:04 +00:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
Function TakeBlueprints()
|
|
|
|
if bInventoryMenu
|
|
|
|
; The DisablePlayerControls method does not remember last inventory tab to return where we were
|
|
|
|
Input.TapKey(Input.GetMappedKey("Tween Menu"))
|
|
|
|
endif
|
|
|
|
Game.DisablePlayerControls(abMenu = true)
|
|
|
|
Game.EnablePlayerControls(abMenu = true)
|
|
|
|
Utility.Wait(0.05)
|
|
|
|
_00E_FS_BlueprintContainerActorREF.ShowGiftMenu(False, _00E_FS_BlueprintList, True, False)
|
|
|
|
if bInventoryMenu
|
|
|
|
Utility.wait(0.2)
|
|
|
|
Input.TapKey(Input.GetMappedKey("Quick Inventory"))
|
|
|
|
endif
|
|
|
|
EndFunction
|
|
|
|
|
|
|
|
bool bInventoryMenu
|
|
|
|
|
|
|
|
Actor Property PlayerRef Auto
|
|
|
|
Actor Property _00E_FS_BlueprintContainerActorREF Auto
|
|
|
|
|
|
|
|
Message Property _00E_FS_Blueprint_Message_SE Auto
|
|
|
|
Message Property _00E_FS_BlueprintItemsStored Auto
|
|
|
|
|
|
|
|
FormList Property _00E_FS_BlueprintList Auto
|
|
|
|
|
|
|
|
Keyword Property Blueprint Auto
|
|
|
|
|
|
|
|
Sound Property ITMBookClose Auto
|