Browse Source

Renamed Both mode to BlockNameAndCustom in SavePoint command

master
Christopher 8 years ago
parent
commit
87774219f3
  1. 22
      Assets/Fungus/Scripts/Commands/SavePoint.cs

22
Assets/Fungus/Scripts/Commands/SavePoint.cs

@ -18,11 +18,11 @@ namespace Fungus
public enum KeyMode
{
/// <summary> Use the parent Block's name as the Save Point Key. N.B. If you change the Block name later it will break the save file!</summary>
UseBlockName,
BlockName,
/// <summary> Use a custom string for the key. This allows you to use multiple Save Points in the same block and save files will still work if the Block is renamed later. </summary>
Custom,
/// <summary> Use both the parent Block's name as well as a custom string for the Save Point key. This allows you to use your custom key every block, provided your Block names are unique./// </summary>
Both
BlockNameAndCustom
}
/// <summary>
@ -40,7 +40,7 @@ namespace Fungus
[SerializeField] protected bool isStartPoint = false;
[Tooltip("How the Save Point Key for this Save Point is defined.")]
[SerializeField] protected KeyMode keyMode = KeyMode.UseBlockName;
[SerializeField] protected KeyMode keyMode = KeyMode.BlockName;
[Tooltip("A string key which uniquely identifies this save point.")]
[SerializeField] protected string customKey = "";
@ -75,11 +75,11 @@ namespace Fungus
{
get
{
if (keyMode == KeyMode.UseBlockName)
if (keyMode == KeyMode.BlockName)
{
return ParentBlock.BlockName;
}
else if (keyMode == KeyMode.Both)
else if (keyMode == KeyMode.BlockNameAndCustom)
{
return ParentBlock.BlockName + keySeparator + customKey;
}
@ -129,13 +129,13 @@ namespace Fungus
public override string GetSummary()
{
if (keyMode == KeyMode.UseBlockName)
if (keyMode == KeyMode.BlockName)
{
return "key: <Block Name>";
return "key: " + ParentBlock.BlockName;
}
else if (keyMode == KeyMode.Both)
else if (keyMode == KeyMode.BlockNameAndCustom)
{
return "key: <Block Name>" + keySeparator + customKey;
return "key: " + ParentBlock.BlockName + keySeparator + customKey;
}
return "key: " + customKey;
@ -149,13 +149,13 @@ namespace Fungus
public override bool IsPropertyVisible(string propertyName)
{
if (propertyName == "customKey" &&
(keyMode != KeyMode.Custom && keyMode != KeyMode.Both))
(keyMode != KeyMode.Custom && keyMode != KeyMode.BlockNameAndCustom))
{
return false;
}
if (propertyName == "keySeparator" &&
keyMode != KeyMode.Both)
keyMode != KeyMode.BlockNameAndCustom)
{
return false;
}

Loading…
Cancel
Save