|
|
|
@ -4,10 +4,6 @@ FormList Property ETR_ItemsNew Auto |
|
|
|
|
FormList Property ETR_ItemsFound Auto |
|
|
|
|
FormList Property ETR_ItemsStored Auto |
|
|
|
|
|
|
|
|
|
Keyword Property LocTypePlayerHouse Auto |
|
|
|
|
|
|
|
|
|
bool bAtHome = false |
|
|
|
|
ObjectReference bookShelf = None |
|
|
|
|
int iFollowerIndex = 0 |
|
|
|
|
int iArtifactCount = 0 |
|
|
|
|
|
|
|
|
@ -59,34 +55,11 @@ Event OnPlayerLoadGame() |
|
|
|
|
RescanFoundArtifacts() |
|
|
|
|
RescanNewArtifacts() |
|
|
|
|
|
|
|
|
|
Location currentLocation = (GetReference() as ObjectReference).GetCurrentLocation() |
|
|
|
|
bAtHome = currentLocation && currentLocation.HasKeyword(LocTypePlayerHouse) |
|
|
|
|
|
|
|
|
|
if bAtHome |
|
|
|
|
RegisterForModEvent("AT_HomeInventoryUpdate", "OnHomeInventoryUpdate") |
|
|
|
|
RegisterForMenu("ContainerMenu") |
|
|
|
|
GotoState("AtHome") |
|
|
|
|
else |
|
|
|
|
UnregisterForModEvent("AT_HomeInventoryUpdate") |
|
|
|
|
UnregisterForMenu("ContainerMenu") |
|
|
|
|
GotoState("") |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
EndEvent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Event OnLocationChange(Location akOldLoc, Location akNewLoc) |
|
|
|
|
|
|
|
|
|
bAtHome = akNewLoc && akNewLoc.HasKeyword(LocTypePlayerHouse) |
|
|
|
|
|
|
|
|
|
if bAtHome |
|
|
|
|
RegisterForModEvent("AT_HomeInventoryUpdate", "OnHomeInventoryUpdate") |
|
|
|
|
GotoState("AtHome") |
|
|
|
|
elseif akOldLoc && akOldLoc.HasKeyword(LocTypePlayerHouse) |
|
|
|
|
UnregisterForModEvent("AT_HomeInventoryUpdate") |
|
|
|
|
GotoState("") |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
int iCurrentFollowers = 0; |
|
|
|
|
Actor[] aFollowers = GetPlayerFollowers() |
|
|
|
|
int i = aFollowers.length |
|
|
|
@ -111,53 +84,6 @@ Event OnUpdate() |
|
|
|
|
EndEvent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
event OnHomeInventoryUpdate(string eventName, string strArg, float numArg, Form sender) |
|
|
|
|
if bAtHome |
|
|
|
|
SyncCellStorage() |
|
|
|
|
endif |
|
|
|
|
endevent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
state AtHome |
|
|
|
|
|
|
|
|
|
event OnBeginState() |
|
|
|
|
RegisterForMenu("ContainerMenu") |
|
|
|
|
endevent |
|
|
|
|
|
|
|
|
|
event OnEndState() |
|
|
|
|
UnregisterForMenu("ContainerMenu") |
|
|
|
|
endevent |
|
|
|
|
|
|
|
|
|
event OnMenuOpen(String MenuName) |
|
|
|
|
if ! bAtHome |
|
|
|
|
GotoState("") |
|
|
|
|
return |
|
|
|
|
endif |
|
|
|
|
ObjectReference currentContainer = GetCurrentContainer() |
|
|
|
|
if currentContainer as PlayerBookShelfContainerScript |
|
|
|
|
bookShelf = currentContainer |
|
|
|
|
endif |
|
|
|
|
endevent |
|
|
|
|
|
|
|
|
|
event OnMenuClose(String MenuName) |
|
|
|
|
|
|
|
|
|
if bookShelf |
|
|
|
|
ObjectReference ref = bookShelf |
|
|
|
|
bookShelf = None |
|
|
|
|
Utility.wait(1.0) |
|
|
|
|
int iLimit = 10 |
|
|
|
|
while iLimit > 0 && (ref as PlayerBookShelfContainerScript).GetState() == "PlacingBooks" |
|
|
|
|
iLimit -= 1 |
|
|
|
|
Utility.wait(0.5) |
|
|
|
|
endwhile |
|
|
|
|
SyncCellStorage() |
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
endevent |
|
|
|
|
|
|
|
|
|
endstate |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; NATIVE FUNCTIONS |
|
|
|
|
|
|
|
|
|
bool function Load() native global |
|
|
|
|