Remade the Blueprint Collection item to MISC, added automatically with the first found blueprint, added an option to store single unique copies automatically
parent
cd59fb96ae
commit
1beee1c6e1
11 changed files with 180 additions and 12 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,85 @@ |
|||||||
|
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 |
||||||
|
/; |
||||||
|
ITMBookClose.Play(PlayerREF) |
||||||
|
_00E_FS_BlueprintItemsStored.Show(EnderalFunctions.MoveItemsToCountByKeyword(PlayerREF, _00E_FS_BlueprintContainerActorREF, Blueprint, 1)) |
||||||
|
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 |
@ -0,0 +1,19 @@ |
|||||||
|
Scriptname _00E_BlueprintControlAlias extends ReferenceAlias Hidden |
||||||
|
|
||||||
|
auto state Waiting |
||||||
|
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) |
||||||
|
if ! (akBaseItem as MiscObject) || ! akBaseItem.HasKeyword(Blueprint) |
||||||
|
return |
||||||
|
endif |
||||||
|
GotoState("DoNothing") |
||||||
|
_00E_BlueprintCollectionItemRef.Activate(GetReference()) |
||||||
|
Clear() |
||||||
|
EndEvent |
||||||
|
endstate |
||||||
|
|
||||||
|
state DoNothing |
||||||
|
endstate |
||||||
|
|
||||||
|
Keyword Property Blueprint Auto |
||||||
|
|
||||||
|
ObjectReference Property _00E_BlueprintCollectionItemRef Auto |
Loading…
Reference in new issue