Zone Update Event Types¶
Zone Update Event¶
- class S4CLZoneUpdateEvent(zone, is_paused, ticks_since_last_update)¶
Bases:
CommonEventAn event that occurs when a Zone has been updated.
Note
This event can occur while the game is paused.
- Example usage:
from sims4communitylib.events.event_handling.common_event_registry import CommonEventRegistry from sims4communitylib.modinfo import ModInfo class ExampleEventListener: # In order to listen to an event, your function must match these criteria: # - The function is static (staticmethod). # - The first and only required argument has the name "event_data". # - The first and only required argument has the Type Hint for the event you are listening for. # - The argument passed to "handle_events" is the name of your Mod. @staticmethod @CommonEventRegistry.handle_events(ModInfo.get_identity().name) def handle_event(event_data: S4CLZoneUpdateEvent): pass
- Parameters:
zone (Zone) – The Zone that was updated.
is_paused (bool) – A value indicating if the game was paused during the dispatching of this event.
ticks_since_last_update (int) – The number of ticks since the last zone update in milliseconds.
- property is_paused¶
Determine if the game was paused during the update.
- Returns:
True, if the game was paused. False, if the game was not paused.
- Return type:
bool
- property ticks_since_last_update¶
The number of ticks in milliseconds since the last zone update.
- Returns:
The number of ticks in milliseconds since the last zone update.
- Return type:
int
- property zone¶
The Zone that was updated.
- Returns:
The Zone that was updated.
- Return type:
Zone