Class LoadFileScreenBase
Base class for UI Screens that allows user to choose a file to load a saved terrain from.
Inheritance
Implements
Inherited Members
Namespace: Fwt.HexTerrains.UI
Assembly: fwt.hexterrains.dll
Syntax
public abstract class LoadFileScreenBase : UIScreen<SaveFilesDataSource>, IViewDataReceiver<SaveFilesDataSource>
Properties
DefaultFileName
The default file name to be used when no file is selected.
Declaration
public abstract string DefaultFileName { get; }
Property Value
| Type | Description |
|---|---|
| string |
FileExtension
The file extension for the files to be shown in a screen.
Declaration
public abstract string FileExtension { get; }
Property Value
| Type | Description |
|---|---|
| string |
FilesDirectory
The directory where the files are stored.
Declaration
public abstract string FilesDirectory { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Cancel()
Cancels the loading process and hides the screen.
Declaration
public virtual void Cancel()
CreateSaveFileData(string, string, string)
Creates a new SaveFileData object with the specified parameters. This object is used in binding to a UI.
Declaration
public SaveFileData CreateSaveFileData(string name, string fileName, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Entry name (to show on UI) |
| string | fileName | file name (without path) |
| string | description | additional data about file to show on UI |
Returns
| Type | Description |
|---|---|
| SaveFileData |
Delete()
Deletes the selected file.
Declaration
public virtual void Delete()
GetSelectedFileFullName()
Gets the full name of the selected file.
Declaration
public virtual string GetSelectedFileFullName()
Returns
| Type | Description |
|---|---|
| string | full file path |
Load()
Loads the selected file.
Declaration
public virtual void Load()
Load(string)
Loads the file with the specified path.
Declaration
public abstract void Load(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName |
OnDataChanged()
Called when the data in the SaveFileData object changes. Increases the ViewData.Version, so UI will be updated.
Declaration
protected virtual void OnDataChanged()
OnEnable()
Called when the screen is enabled.
Declaration
protected override void OnEnable()
Overrides
RefreshDataSource()
Refreshes the data source with the list of available save files.
Declaration
protected virtual void RefreshDataSource()