Skip to content

Commit

Permalink
Merge pull request #19 from dubit/dev_override_special_characters_on_…
Browse files Browse the repository at this point in the history
…buttons

Added the ability to override the characters used for folders & back
  • Loading branch information
kkjamie authored Feb 22, 2019
2 parents fe1b7ed + b68eacf commit 6cd7eb4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Scripts/DebugMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ namespace DUCK.DebugMenu
/// </summary>
public class DebugMenu : MonoBehaviour
{
public static string BackCharacter = "←";
public static string FolderArrowCharacter = "▶";

private static DebugMenu instance;
public static DebugMenu Instance
{
Expand Down Expand Up @@ -289,7 +292,7 @@ private void SetupPage(DebugMenuItemNode node)
if (node.Parent != null)
{
var backButton = Instantiate(actionButtonTemplate, actionButtonTemplate.transform.parent, false);
backButton.GetComponentInChildren<Text>().text = "← Back";
backButton.GetComponentInChildren<Text>().text = $"{BackCharacter} Back";
backButton.onClick.AddListener(() => { SetupPage(node.Parent); });
backButton.gameObject.SetActive(true);

Expand All @@ -313,7 +316,7 @@ private void SetupPage(DebugMenuItemNode node)
}

var label = actionButton.GetComponentInChildren<Text>();
label.text = button.Name + (button.IsFolder ? " ▶" : "");
label.text = button.Name + (button.IsFolder ? $" {FolderArrowCharacter}" : "");
actionButton.gameObject.SetActive(true);

firstChild = (firstChild != null) ? firstChild : actionButton.gameObject;
Expand Down

0 comments on commit 6cd7eb4

Please sign in to comment.