Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

UE3:UIDataStore (UT3)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT3 Object >> UIRoot >> UIDataProvider >> UIDataStore
Package: 
Engine
Direct subclasses:
UIDataStore_GameState, UTUIDataStore_StringList, UIDataStore_Registry, UIDataStore_GameResource, UIDataStore_Fonts, SceneDataStore, UIDataStore_Color, UIDataStore_Gamma, UIDataStore_Images, UIDataStore_Remote, UIDataStore_Settings, UIDataStore_StringAliasMap, UIDataStore_Strings, UISkin, UTUIDataStore_Content, UTUIDataStore_CustomChar, UTUIDataStore_2DStringList
This class in other games:
UDK

Base for classes which provide data to the UI subsystem. A data store is how the UI references data in the game. Data stores allow the UI to reference game data in a safe manner, since they encapsulate lifetime management. A data store can be either persistent, in which case it is attached directly to the UIInteraction object and is available to all widgets, or it can be temporary, in which case it is attached to the current scene and is only accessible to the widgets contained by that scene.

Persistent data stores might track information such as UI data for all gametypes or characters. Temporary data stores might track stuff like the name that was entered into some UI value widget. Data stores can provide static information, such as the names of all gametypes, or dynamic information, such as the name of the current gametype.

Copyright 1998-2007 Epic Games, Inc. All Rights Reserved

Properties[edit]

RefreshSubscriberNotifies[edit]

Type: array<delegate<OnDataStoreValueUpdated> >

the list of delegates to call when data exposed by this data store has been updated

Tag[edit]

Type: name

The name used to access this datastore

Delegates[edit]

OnDataStoreValueUpdated[edit]

delegate OnDataStoreValueUpdated (UIDataStore SourceDataStore, bool bValuesInvalidated, name PropertyTag, UIDataProvider SourceProvider, int ArrayIndex)

This delegate is called whenever the values exposed by this data store have been updated. Provides data stores with a way to notify subscribers when they should refresh their values from this data store.

Parameters:

  • SourceDataStore - the data store that generated the refresh notification
  • bValuesInvalidated - TRUE if the data values were completely invalidated; suggest a full refresh rather than an update (i.e. in lists)
  • PropertyTag - the tag associated with the data field that was updated.
  • SourceProvider - for data stores which contain nested providers, the provider that contains the data which changed.
  • ArrayIndex - for collection fields, indicates which element was changed. value of INDEX_NONE indicates not an array or that the entire array was updated.

Functions[edit]

Native functions[edit]

OnCommit[edit]

native function OnCommit ()

Notifies the data store that all values bound to this data store in the current scene have been saved. Provides data stores which perform buffered or batched data transactions with a way to determine when the UI system has finished writing data to the data store.

Note: for now, this lives in UIDataStore, but it might make sense to move it up to UIDataProvider later on.

Events[edit]

RefreshSubscribers[edit]

event RefreshSubscribers (optional name PropertyTag, optional bool bInvalidateValues, optional UIDataProvider SourceProvider, optional int ArrayIndex)

Loops through the subscriber notify list and calls the delegate letting the subscriber know to refresh their value.

Parameters:

  • PropertyTag - the tag associated with the data field that was updated.
  • SourceProvider - for data stores which contain nested providers, the provider that contains the data which changed.
  • ArrayIndex - for collection fields, indicates which element was changed. value of INDEX_NONE indicates not an array or that the entire array was updated.

Registered[edit]

event Registered (LocalPlayer PlayerOwner)

Called when this data store is added to the data store manager's list of active data stores.

Parameters:

  • PlayerOwner - the player that will be associated with this DataStore. Only relevant if this data store is associated with a particular player; NULL if this is a global data store.

SubscriberAttached[edit]

event SubscriberAttached (UIDataStoreSubscriber Subscriber)

Notification that a subscriber is using a value from this data store. Adds the subscriber's RefreshSubscriberValue method to this data store's list of refresh notifies so that the subscriber can refresh its value when the data store's value changes.

Parameters:

  • Subscriber - the subscriber that attached to the data store.

SubscriberDetached[edit]

event SubscriberDetached (UIDataStoreSubscriber Subscriber)

Notification that a subscriber is no longer using any values from this data store. Removes the subscriber's RefreshSubscriberValue method from this data store's list of refresh notifies so that the subscriber no longer refreshes its value when the data store's value changes.

Parameters:

  • Subscriber - the subscriber that detached from the data store.

Unregistered[edit]

event Unregistered (LocalPlayer PlayerOwner)

Called when this data store is removed from the data store manager's list of active data stores.

Parameters:

  • PlayerOwner - the player that will be associated with this DataStore. Only relevant if this data store is associated with a particular player; NULL if this is a global data store.

Other instance functions[edit]

GetDataStoreClient[edit]

final function DataStoreClient GetDataStoreClient ()

Returns a reference to the global data store client, if it exists.

Returns:

the global data store client for the game.

NotifyGameSessionEnded[edit]

function bool NotifyGameSessionEnded ()

Called when the current map is being unloaded. Cleans up any references which would prevent garbage collection.

Returns:

TRUE indicates that this data store should be automatically unregistered when this game session ends.