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 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> /// <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> /// <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, 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> /// <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> /// <summary>
@ -40,7 +40,7 @@ namespace Fungus
[SerializeField] protected bool isStartPoint = false; [SerializeField] protected bool isStartPoint = false;
[Tooltip("How the Save Point Key for this Save Point is defined.")] [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.")] [Tooltip("A string key which uniquely identifies this save point.")]
[SerializeField] protected string customKey = ""; [SerializeField] protected string customKey = "";
@ -75,11 +75,11 @@ namespace Fungus
{ {
get get
{ {
if (keyMode == KeyMode.UseBlockName) if (keyMode == KeyMode.BlockName)
{ {
return ParentBlock.BlockName; return ParentBlock.BlockName;
} }
else if (keyMode == KeyMode.Both) else if (keyMode == KeyMode.BlockNameAndCustom)
{ {
return ParentBlock.BlockName + keySeparator + customKey; return ParentBlock.BlockName + keySeparator + customKey;
} }
@ -129,13 +129,13 @@ namespace Fungus
public override string GetSummary() 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; return "key: " + customKey;
@ -149,13 +149,13 @@ namespace Fungus
public override bool IsPropertyVisible(string propertyName) public override bool IsPropertyVisible(string propertyName)
{ {
if (propertyName == "customKey" && if (propertyName == "customKey" &&
(keyMode != KeyMode.Custom && keyMode != KeyMode.Both)) (keyMode != KeyMode.Custom && keyMode != KeyMode.BlockNameAndCustom))
{ {
return false; return false;
} }
if (propertyName == "keySeparator" && if (propertyName == "keySeparator" &&
keyMode != KeyMode.Both) keyMode != KeyMode.BlockNameAndCustom)
{ {
return false; return false;
} }

Loading…
Cancel
Save