Class SaveFileScreenBase
Base class for UI Screen that allows user to choose a save file.
Inheritance
Implements
Inherited Members
Namespace: Fwt.HexTerrains.UI
Assembly: fwt.hexterrains.dll
Syntax
public abstract class SaveFileScreenBase : UIScreen<SaveFilesDataSource>, IViewDataReceiver<SaveFilesDataSource>
Properties
DefaultFileName
The default file name to use when saving a new file.
Declaration
public abstract string DefaultFileName { get; }
Property Value
| Type | Description |
|---|---|
| string |
FileExtension
The file extension for the save files.
Declaration
public abstract string FileExtension { get; }
Property Value
| Type | Description |
|---|---|
| string |
FilesDirectory
The directory where save files are stored.
Declaration
public abstract string FilesDirectory { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Cancel()
Cancels saving the file and hides the screen.
Declaration
public virtual void Cancel()
CreateSaveFileData(string, string, string)
Creates a new SaveFileData object from the given parameters.
Declaration
public virtual SaveFileData CreateSaveFileData(string name, string fileName, string description)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | name of entry to display on UI |
| string | fileName | File Name |
| string | description | Additional data about file to display 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 |
OnDataChanged()
Called when the data in the SaveFileData changes, updates the ViewData so UI reflects the changes.
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 save files, so UI reflects the changes.
Declaration
protected virtual void RefreshDataSource()
Save()
Called from UI to save the selected file. Calls Save(fileName) with the selected file name.
Declaration
public virtual void Save()
Save(string)
Saves the file with the specified name. Implement your saving logic here, e.g. calling your API.
Declaration
public abstract void Save(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName |