Exemplo n.º 1
0
        private void CopySavesList(MenuSavesList _element, bool ignoreUnityUI)
        {
            if (ignoreUnityUI)
            {
                uiSlots = null;
            }
            else
            {
                uiSlots = _element.uiSlots;
            }

            newSaveText        = _element.newSaveText;
            textEffects        = _element.textEffects;
            outlineSize        = _element.outlineSize;
            anchor             = _element.anchor;
            saveListType       = _element.saveListType;
            maxSlots           = _element.maxSlots;
            actionListOnSave   = _element.actionListOnSave;
            displayType        = _element.displayType;
            blankSlotTexture   = _element.blankSlotTexture;
            fixedOption        = _element.fixedOption;
            optionToShow       = _element.optionToShow;
            hideIfNotValid     = _element.hideIfNotValid;
            importProductName  = _element.importProductName;
            importSaveFilename = _element.importSaveFilename;
            checkImportBool    = _element.checkImportBool;
            checkImportVar     = _element.checkImportVar;
            parameterID        = _element.parameterID;
            showNewSaveOption  = _element.showNewSaveOption;
            autoHandle         = _element.autoHandle;
            uiHideStyle        = _element.uiHideStyle;
            linkUIGraphic      = _element.linkUIGraphic;

            base.Copy(_element);
        }
Exemplo n.º 2
0
        private void CopySavesList(MenuSavesList _element)
        {
            uiSlots = _element.uiSlots;

            newSaveText        = _element.newSaveText;
            textEffects        = _element.textEffects;
            outlineSize        = _element.outlineSize;
            anchor             = _element.anchor;
            saveListType       = _element.saveListType;
            maxSlots           = _element.maxSlots;
            actionListOnSave   = _element.actionListOnSave;
            displayType        = _element.displayType;
            blankSlotTexture   = _element.blankSlotTexture;
            fixedOption        = _element.fixedOption;
            optionToShow       = _element.optionToShow;
            importProductName  = _element.importProductName;
            importSaveFilename = _element.importSaveFilename;
            checkImportBool    = _element.checkImportBool;
            checkImportVar     = _element.checkImportVar;
            parameterID        = _element.parameterID;
            showNewSaveOption  = _element.showNewSaveOption;
            autoHandle         = _element.autoHandle;
            uiHideStyle        = _element.uiHideStyle;

            base.Copy(_element);
        }
Exemplo n.º 3
0
        public override void Declare()
        {
            uiSlots = null;

            newSaveText = "New save";
            isVisible   = true;
            isClickable = true;
            numSlots    = 1;
            maxSaves    = 5;

            SetSize(new Vector2(20f, 5f));
            anchor       = TextAnchor.MiddleCenter;
            saveListType = AC_SaveListType.Save;

            actionListOnSave = null;
            newSaveSlot      = false;
            textEffects      = TextEffects.None;
            displayType      = SaveDisplayType.LabelOnly;
            blankSlotTexture = null;

            fixedOption  = false;
            optionToShow = 1;

            importProductName  = "";
            importSaveFilename = "";
            checkImportBool    = false;
            checkImportVar     = 0;

            base.Declare();
        }
Exemplo n.º 4
0
		public void CopySavesList (MenuSavesList _element)
		{
			newSaveText = _element.newSaveText;
			textEffects = _element.textEffects;
			anchor = _element.anchor;
			saveListType = _element.saveListType;
			maxSaves = _element.maxSaves;
			actionListOnSave = _element.actionListOnSave;
			displayType = _element.displayType;
			blankSlotTexture = _element.blankSlotTexture;
			fixedOption = _element.fixedOption;
			optionToShow = _element.optionToShow;
			
			base.Copy (_element);
		}
Exemplo n.º 5
0
        /**
         * Initialises the element when it is created within MenuManager.
         */
        public override void Declare()
        {
            uiSlots = null;

            newSaveText         = "New save";
            emptySlotText       = string.Empty;
            emptySlotTextLineID = -1;
            isVisible           = true;
            isClickable         = true;
            numSlots            = 1;
            maxSlots            = 5;

            SetSize(new Vector2(20f, 5f));
            anchor       = TextAnchor.MiddleCenter;
            saveListType = AC_SaveListType.Save;

            actionListOnSave = null;
            newSaveSlot      = false;
            textEffects      = TextEffects.None;
            outlineSize      = 2f;
            displayType      = SaveDisplayType.LabelOnly;
            blankSlotTexture = null;

            allowEmptySlots = false;
            fixedOption     = false;
            optionToShow    = 1;
            hideIfNotValid  = false;

            importProductName  = "";
            importSaveFilename = "";
            checkImportBool    = false;
            checkImportVar     = 0;

            showNewSaveOption = true;
            autoHandle        = true;

            parameterID   = -1;
            uiHideStyle   = UIHideStyle.DisableObject;
            linkUIGraphic = LinkUIGraphic.ImageComponent;

            base.Declare();
        }
Exemplo n.º 6
0
        public void CopySavesList(MenuSavesList _element)
        {
            uiSlots = _element.uiSlots;

            newSaveText        = _element.newSaveText;
            textEffects        = _element.textEffects;
            anchor             = _element.anchor;
            saveListType       = _element.saveListType;
            maxSaves           = _element.maxSaves;
            actionListOnSave   = _element.actionListOnSave;
            displayType        = _element.displayType;
            blankSlotTexture   = _element.blankSlotTexture;
            fixedOption        = _element.fixedOption;
            optionToShow       = _element.optionToShow;
            importProductName  = _element.importProductName;
            importSaveFilename = _element.importSaveFilename;
            checkImportBool    = _element.checkImportBool;
            checkImportVar     = _element.checkImportVar;

            base.Copy(_element);
        }
Exemplo n.º 7
0
		public override void Declare ()
		{
			newSaveText = "New save";
			isVisible = true;
			isClickable = true;
			numSlots = 1;
			maxSaves = 5;

			SetSize (new Vector2 (20f, 5f));
			anchor = TextAnchor.MiddleCenter;
			saveListType = AC_SaveListType.Save;

			actionListOnSave = null;
			newSaveSlot = false;
			textEffects = TextEffects.None;
			displayType = SaveDisplayType.LabelOnly;
			blankSlotTexture = null;

			fixedOption = false;
			optionToShow = 1;

			base.Declare ();
		}
        public override void ShowGUI(Menu menu)
        {
            string apiPrefix = "(AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\") as AC.MenuSavesList)";

            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");

            saveListType = (AC_SaveListType)CustomGUILayout.EnumPopup("List type:", saveListType, apiPrefix + ".savesListType", "How this list behaves");
            if (saveListType == AC_SaveListType.Save)
            {
                if (fixedOption || !allowEmptySlots)
                {
                    showNewSaveOption = CustomGUILayout.Toggle("Show 'New save' option?", showNewSaveOption, apiPrefix + ".showNewSaveOption", "If True, a slot that represents a 'new save' space can be displayed if appropriate");
                }

                if ((!fixedOption && allowEmptySlots) || showNewSaveOption)
                {
                    newSaveText = CustomGUILayout.TextField("'New save' text:", newSaveText, apiPrefix + ".newSaveText", "The display text when a slot represents a 'new save' space");
                }
                autoHandle = CustomGUILayout.Toggle("Save when click on?", autoHandle, apiPrefix + ".autoHandle");
                if (autoHandle)
                {
                    ActionListGUI("ActionList after saving:", menu.title, "AfterSaving", apiPrefix, "An ActionList asset that runs after the game is saved");
                }
                else
                {
                    ActionListGUI("ActionList when click:", menu.title, "OnClick", apiPrefix, "An ActionList asset that runs after the user clicks on a save file");
                }
            }
            else if (saveListType == AC_SaveListType.Load)
            {
                autoHandle = CustomGUILayout.Toggle("Load when click on?", autoHandle, apiPrefix + ".autoHandle");
                if (autoHandle)
                {
                    ActionListGUI("ActionList after loading:", menu.title, "AfterLoading", apiPrefix, "An ActionList asset that runs after the game is loaded");
                }
                else
                {
                    ActionListGUI("ActionList when click:", menu.title, "OnClick", apiPrefix, "An ActionList asset that runs after the user clicks on a save file");
                }
            }
            else if (saveListType == AC_SaveListType.Import)
            {
                autoHandle = true;
                                #if UNITY_STANDALONE
                importProductName  = CustomGUILayout.TextField("Import product name:", importProductName, apiPrefix + ".importProductName", "The name of the project to import files from");
                importSaveFilename = CustomGUILayout.TextField("Import save filename:", importSaveFilename, apiPrefix + ".importSaveFilename", "The filename syntax of import files");
                ActionListGUI("ActionList after import:", menu.title, "After_Import", apiPrefix, "An ActionList asset that runs after a save file is imported");
                checkImportBool = CustomGUILayout.Toggle("Require Bool to be true?", checkImportBool, apiPrefix + ".checkImportBool", "If True, then a specific Boolean global variable must = True for an import file to be listed");
                if (checkImportBool)
                {
                    if (KickStarter.variablesManager != null)
                    {
                        ShowVarGUI(KickStarter.variablesManager.vars);
                    }
                    else
                    {
                        EditorGUILayout.HelpBox("A Variables Manager is required.", MessageType.Warning);
                    }
                }
                                #else
                EditorGUILayout.HelpBox("This feature is only available for standalone platforms (PC, Mac, Linux)", MessageType.Warning);
                                #endif
            }

            displayType = (SaveDisplayType)CustomGUILayout.EnumPopup("Display type:", displayType, apiPrefix + ".displayType", "How save files are displayed");

            fixedOption = CustomGUILayout.Toggle("Fixed Save ID only?", fixedOption, apiPrefix + ".fixedOption", "If True, then only one save slot will be shown");
            if (fixedOption)
            {
                numSlots     = 1;
                slotSpacing  = 0f;
                optionToShow = CustomGUILayout.IntField("ID to display:", optionToShow, apiPrefix + ".optionToShow", "The index number of the save slot to show");

                if (saveListType == AC_SaveListType.Load)
                {
                    hideIfNotValid = CustomGUILayout.Toggle("Hide if no save file found?", hideIfNotValid, apiPrefix + ".hideIfNotValid", "If True, then the element will be hidden if the slot ID it represents is not filled with a valid save");
                }
            }
            else
            {
                maxSlots        = CustomGUILayout.IntField("Maximum number of slots:", maxSlots, apiPrefix + ".maxSlots", "The maximum number of slots that can be displayed at once");
                allowEmptySlots = CustomGUILayout.Toggle("Allow empty slots?", allowEmptySlots, apiPrefix + ".allowEmptySlots", "If True, then all slots will be shown even if they are not already assigned a save file.");

                if (source == MenuSource.AdventureCreator)
                {
                    if (allowEmptySlots)
                    {
                        numSlots = maxSlots;
                    }
                    else
                    {
                        numSlots = CustomGUILayout.IntSlider("Test slots:", numSlots, 1, maxSlots, apiPrefix + ".numSlots");
                    }
                    slotSpacing = CustomGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 30f, apiPrefix + ".slotSpacing");
                    orientation = (ElementOrientation)CustomGUILayout.EnumPopup("Slot orientation:", orientation, apiPrefix + ".orientation");
                    if (orientation == ElementOrientation.Grid)
                    {
                        gridWidth = CustomGUILayout.IntSlider("Grid size:", gridWidth, 1, 10, apiPrefix + ".gridWidth");
                    }
                }
            }

            if (source != MenuSource.AdventureCreator)
            {
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
                uiHideStyle = (UIHideStyle)CustomGUILayout.EnumPopup("When invisible:", uiHideStyle, apiPrefix + ".uiHideStyle", "The method by which this element (or slots within it) are hidden from view when made invisible");
                EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel);

                if (fixedOption)
                {
                    uiSlots = ResizeUISlots(uiSlots, 1);
                }
                else
                {
                    uiSlots = ResizeUISlots(uiSlots, maxSlots);
                }

                for (int i = 0; i < uiSlots.Length; i++)
                {
                    uiSlots[i].LinkedUiGUI(i, source);
                }

                linkUIGraphic = (LinkUIGraphic)CustomGUILayout.EnumPopup("Link graphics to:", linkUIGraphic, "", "What Image component the element's graphics should be linked to");
            }

            EditorGUILayout.EndVertical();

            base.ShowGUI(menu);
        }
Exemplo n.º 9
0
		public override void ShowGUI ()
		{
			EditorGUILayout.BeginVertical ("Button");

			fixedOption = EditorGUILayout.Toggle ("Fixed option number?", fixedOption);
			if (fixedOption)
			{
				numSlots = 1;
				slotSpacing = 0f;
				optionToShow = EditorGUILayout.IntField ("Option to display:", optionToShow);
			}
			else
			{
				numSlots = EditorGUILayout.IntSlider ("Test slots:", numSlots, 1, 10);
				maxSaves = EditorGUILayout.IntField ("Max saves:", maxSaves);
				slotSpacing = EditorGUILayout.Slider ("Slot spacing:", slotSpacing, 0f, 20f);
				orientation = (ElementOrientation) EditorGUILayout.EnumPopup ("Slot orientation:", orientation);
				if (orientation == ElementOrientation.Grid)
				{
					gridWidth = EditorGUILayout.IntSlider ("Grid size:", gridWidth, 1, 10);
				}
			}

			anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor);
			textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects);
			displayType = (SaveDisplayType) EditorGUILayout.EnumPopup ("Display:", displayType);
			if (displayType != SaveDisplayType.LabelOnly)
			{
				EditorGUILayout.BeginHorizontal ();
					EditorGUILayout.LabelField ("Empty slot texture:", GUILayout.Width (145f));
					blankSlotTexture = (Texture2D) EditorGUILayout.ObjectField (blankSlotTexture, typeof (Texture2D), false, GUILayout.Width (70f), GUILayout.Height (30f));
				EditorGUILayout.EndHorizontal ();
			}
			saveListType = (AC_SaveListType) EditorGUILayout.EnumPopup ("Click action:", saveListType);
			if (saveListType == AC_SaveListType.Save)
			{
				newSaveText = EditorGUILayout.TextField ("'New save' text:", newSaveText);
				actionListOnSave = (ActionListAsset) EditorGUILayout.ObjectField ("ActionList after saving:", actionListOnSave, typeof (ActionListAsset), false);
			}
				
			EditorGUILayout.EndVertical ();
			
			base.ShowGUI ();
		}
Exemplo n.º 10
0
        public override void ShowGUI(Menu menu)
        {
            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");

            fixedOption = EditorGUILayout.Toggle("Fixed option number?", fixedOption);
            if (fixedOption)
            {
                numSlots     = 1;
                slotSpacing  = 0f;
                optionToShow = EditorGUILayout.IntField("Option to display:", optionToShow);
            }
            else
            {
                maxSlots = EditorGUILayout.IntField("Max no. of slots:", maxSlots);

                if (source == MenuSource.AdventureCreator)
                {
                    numSlots    = EditorGUILayout.IntSlider("Test slots:", numSlots, 1, maxSlots);
                    slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f);
                    orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation);
                    if (orientation == ElementOrientation.Grid)
                    {
                        gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10);
                    }
                }
            }

            if (source == MenuSource.AdventureCreator)
            {
                anchor      = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor);
                textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects);
                if (textEffects != TextEffects.None)
                {
                    outlineSize = EditorGUILayout.Slider("Effect size:", outlineSize, 1f, 5f);
                }
            }

            displayType = (SaveDisplayType)EditorGUILayout.EnumPopup("Display:", displayType);
            if (displayType != SaveDisplayType.LabelOnly)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Empty slot texture:", GUILayout.Width(145f));
                blankSlotTexture = (Texture2D)EditorGUILayout.ObjectField(blankSlotTexture, typeof(Texture2D), false, GUILayout.Width(70f), GUILayout.Height(30f));
                EditorGUILayout.EndHorizontal();
            }
            saveListType = (AC_SaveListType)EditorGUILayout.EnumPopup("List type:", saveListType);
            if (saveListType == AC_SaveListType.Save)
            {
                showNewSaveOption = EditorGUILayout.Toggle("Show 'New save' option?", showNewSaveOption);
                if (showNewSaveOption)
                {
                    newSaveText = EditorGUILayout.TextField("'New save' text:", newSaveText);
                }
                autoHandle = EditorGUILayout.Toggle("Save when click on?", autoHandle);
                if (autoHandle)
                {
                    ActionListGUI("ActionList after saving:", menu.title, "After_Saving");
                }
                else
                {
                    ActionListGUI("ActionList when click:", menu.title, "When_Click");
                }
            }
            else if (saveListType == AC_SaveListType.Load)
            {
                autoHandle = EditorGUILayout.Toggle("Load when click on?", autoHandle);
                if (autoHandle)
                {
                    ActionListGUI("ActionList after loading:", menu.title, "After_Loading");
                }
                else
                {
                    ActionListGUI("ActionList when click:", menu.title, "When_Click");
                }
            }
            else if (saveListType == AC_SaveListType.Import)
            {
                autoHandle = true;
                                #if UNITY_STANDALONE
                importProductName  = EditorGUILayout.TextField("Import project name:", importProductName);
                importSaveFilename = EditorGUILayout.TextField("Import save filename:", importSaveFilename);
                ActionListGUI("ActionList after import:", menu.title, "After_Import");
                checkImportBool = EditorGUILayout.Toggle("Require Bool to be true?", checkImportBool);
                if (checkImportBool)
                {
                    checkImportVar = EditorGUILayout.IntField("Global Variable ID:", checkImportVar);
                }
                                #else
                EditorGUILayout.HelpBox("This feature is only available for standalone platforms (PC, Mac, Linux)", MessageType.Warning);
                                #endif
            }

            if (source != MenuSource.AdventureCreator)
            {
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
                uiHideStyle = (UIHideStyle)EditorGUILayout.EnumPopup("When invisible:", uiHideStyle);
                EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel);

                if (fixedOption)
                {
                    uiSlots = ResizeUISlots(uiSlots, 1);
                }
                else
                {
                    uiSlots = ResizeUISlots(uiSlots, maxSlots);
                }

                for (int i = 0; i < uiSlots.Length; i++)
                {
                    uiSlots[i].LinkedUiGUI(i, source);
                }
            }

            EditorGUILayout.EndVertical();

            base.ShowGUI(menu);
        }
Exemplo n.º 11
0
        public override void ShowGUI(Menu menu)
        {
            string apiPrefix = "AC.PlayerMenus.GetElementWithName (\"" + menu.title + "\", \"" + title + "\")";

            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");

            saveListType = (AC_SaveListType)CustomGUILayout.EnumPopup("List type:", saveListType, apiPrefix + ".savesListType");
            if (saveListType == AC_SaveListType.Save)
            {
                showNewSaveOption = CustomGUILayout.Toggle("Show 'New save' option?", showNewSaveOption, apiPrefix + ".showNewSaveOption");
                if (showNewSaveOption)
                {
                    newSaveText = CustomGUILayout.TextField("'New save' text:", newSaveText, apiPrefix + ".newSaveText");
                }
                autoHandle = CustomGUILayout.Toggle("Save when click on?", autoHandle, apiPrefix + ".autoHandle");
                if (autoHandle)
                {
                    ActionListGUI("ActionList after saving:", menu.title, "After_Saving");
                }
                else
                {
                    ActionListGUI("ActionList when click:", menu.title, "When_Click");
                }
            }
            else if (saveListType == AC_SaveListType.Load)
            {
                autoHandle = CustomGUILayout.Toggle("Load when click on?", autoHandle, apiPrefix + ".autoHandle");
                if (autoHandle)
                {
                    ActionListGUI("ActionList after loading:", menu.title, "After_Loading");
                }
                else
                {
                    ActionListGUI("ActionList when click:", menu.title, "When_Click");
                }
            }
            else if (saveListType == AC_SaveListType.Import)
            {
                autoHandle = true;
                                #if UNITY_STANDALONE
                importProductName  = CustomGUILayout.TextField("Import product name:", importProductName, apiPrefix + ".importProductName");
                importSaveFilename = CustomGUILayout.TextField("Import save filename:", importSaveFilename, apiPrefix + ".importSaveFilename");
                ActionListGUI("ActionList after import:", menu.title, "After_Import");
                checkImportBool = CustomGUILayout.Toggle("Require Bool to be true?", checkImportBool, apiPrefix + ".checkImportBool");
                if (checkImportBool)
                {
                    if (KickStarter.variablesManager != null)
                    {
                        ShowVarGUI(KickStarter.variablesManager.vars);
                    }
                    else
                    {
                        EditorGUILayout.HelpBox("A Variables Manager is required.", MessageType.Warning);
                    }
                    //checkImportVar = CustomGUILayout.IntField ("Global Variable ID:", checkImportVar, apiPrefix + "checkImportVar");
                }
                                #else
                EditorGUILayout.HelpBox("This feature is only available for standalone platforms (PC, Mac, Linux)", MessageType.Warning);
                                #endif
            }

            displayType = (SaveDisplayType)CustomGUILayout.EnumPopup("Display type:", displayType, apiPrefix + ".displayType");

            fixedOption = CustomGUILayout.Toggle("Fixed Save ID only?", fixedOption, apiPrefix + ".fixedOption");
            if (fixedOption)
            {
                numSlots     = 1;
                slotSpacing  = 0f;
                optionToShow = CustomGUILayout.IntField("ID to display:", optionToShow, apiPrefix + ".optionToShow");
            }
            else
            {
                maxSlots = CustomGUILayout.IntField("Maximum number of slots:", maxSlots, apiPrefix + ".maxSlots");

                if (source == MenuSource.AdventureCreator)
                {
                    numSlots    = CustomGUILayout.IntSlider("Test slots:", numSlots, 1, maxSlots, apiPrefix + ".numSlots");
                    slotSpacing = CustomGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f, apiPrefix + ".slotSpacing");
                    orientation = (ElementOrientation)CustomGUILayout.EnumPopup("Slot orientation:", orientation, apiPrefix + ".orientation");
                    if (orientation == ElementOrientation.Grid)
                    {
                        gridWidth = CustomGUILayout.IntSlider("Grid size:", gridWidth, 1, 10, apiPrefix + ".gridWidth");
                    }
                }
            }

            if (source != MenuSource.AdventureCreator)
            {
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
                uiHideStyle = (UIHideStyle)CustomGUILayout.EnumPopup("When invisible:", uiHideStyle, apiPrefix + ".uiHideStyle");
                EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel);

                if (fixedOption)
                {
                    uiSlots = ResizeUISlots(uiSlots, 1);
                }
                else
                {
                    uiSlots = ResizeUISlots(uiSlots, maxSlots);
                }

                for (int i = 0; i < uiSlots.Length; i++)
                {
                    uiSlots[i].LinkedUiGUI(i, source);
                }

                linkUIGraphic = (LinkUIGraphic)EditorGUILayout.EnumPopup("Link graphics to:", linkUIGraphic);
            }

            EditorGUILayout.EndVertical();

            base.ShowGUI(menu);
        }
Exemplo n.º 12
0
        public void CopySavesList(MenuSavesList _element)
        {
            uiSlots = _element.uiSlots;

            newSaveText = _element.newSaveText;
            textEffects = _element.textEffects;
            anchor = _element.anchor;
            saveListType = _element.saveListType;
            maxSlots = _element.maxSlots;
            actionListOnSave = _element.actionListOnSave;
            displayType = _element.displayType;
            blankSlotTexture = _element.blankSlotTexture;
            fixedOption = _element.fixedOption;
            optionToShow = _element.optionToShow;
            importProductName = _element.importProductName;
            importSaveFilename = _element.importSaveFilename;
            checkImportBool = _element.checkImportBool;
            checkImportVar = _element.checkImportVar;
            parameterID = _element.parameterID;
            showNewSaveOption = _element.showNewSaveOption;
            autoHandle = _element.autoHandle;

            base.Copy (_element);
        }
Exemplo n.º 13
0
        public override void ShowGUI(MenuSource source)
        {
            EditorGUILayout.BeginVertical ("Button");

            fixedOption = EditorGUILayout.Toggle ("Fixed option number?", fixedOption);
            if (fixedOption)
            {
                numSlots = 1;
                slotSpacing = 0f;
                optionToShow = EditorGUILayout.IntField ("Option to display:", optionToShow);
            }
            else
            {
                maxSlots = EditorGUILayout.IntField ("Max no. of slots:", maxSlots);

                if (source == MenuSource.AdventureCreator)
                {
                    numSlots = EditorGUILayout.IntSlider ("Test slots:", numSlots, 1, maxSlots);
                    slotSpacing = EditorGUILayout.Slider ("Slot spacing:", slotSpacing, 0f, 20f);
                    orientation = (ElementOrientation) EditorGUILayout.EnumPopup ("Slot orientation:", orientation);
                    if (orientation == ElementOrientation.Grid)
                    {
                        gridWidth = EditorGUILayout.IntSlider ("Grid size:", gridWidth, 1, 10);
                    }
                }
            }

            if (source == MenuSource.AdventureCreator)
            {
                anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor);
                textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects);
            }

            displayType = (SaveDisplayType) EditorGUILayout.EnumPopup ("Display:", displayType);
            if (displayType != SaveDisplayType.LabelOnly)
            {
                EditorGUILayout.BeginHorizontal ();
                    EditorGUILayout.LabelField ("Empty slot texture:", GUILayout.Width (145f));
                    blankSlotTexture = (Texture2D) EditorGUILayout.ObjectField (blankSlotTexture, typeof (Texture2D), false, GUILayout.Width (70f), GUILayout.Height (30f));
                EditorGUILayout.EndHorizontal ();
            }
            saveListType = (AC_SaveListType) EditorGUILayout.EnumPopup ("List type:", saveListType);
            if (saveListType == AC_SaveListType.Save)
            {
                showNewSaveOption = EditorGUILayout.Toggle ("Show 'New save' option?", showNewSaveOption);
                if (showNewSaveOption)
                {
                    newSaveText = EditorGUILayout.TextField ("'New save' text:", newSaveText);
                }
                autoHandle = EditorGUILayout.Toggle ("Save when click on?", autoHandle);
                if (autoHandle)
                {
                    ActionListGUI ("ActionList after saving:");
                }
                else
                {
                    ActionListGUI ("ActionList when click:");
                }
            }
            else if (saveListType == AC_SaveListType.Load)
            {
                autoHandle = EditorGUILayout.Toggle ("Load when click on?", autoHandle);
                if (autoHandle)
                {
                    ActionListGUI ("ActionList after loading:");
                }
                else
                {
                    ActionListGUI ("ActionList when click:");
                }
            }
            else if (saveListType == AC_SaveListType.Import)
            {
                autoHandle = true;
                #if UNITY_STANDALONE
                importProductName = EditorGUILayout.TextField ("Import product name:", importProductName);
                importSaveFilename = EditorGUILayout.TextField ("Import save filename:", importSaveFilename);
                ActionListGUI ("ActionList after import:");
                checkImportBool = EditorGUILayout.Toggle ("Require Bool to be true?", checkImportBool);
                if (checkImportBool)
                {
                    checkImportVar = EditorGUILayout.IntField ("Global Variable ID:", checkImportVar);
                }
                #else
                EditorGUILayout.HelpBox ("This feature is only available for standalone platforms (PC, Mac, Linux)", MessageType.Warning);
                #endif
            }

            if (source != MenuSource.AdventureCreator)
            {
                EditorGUILayout.EndVertical ();
                EditorGUILayout.BeginVertical ("Button");

                if (fixedOption)
                {
                    uiSlots = ResizeUISlots (uiSlots, 1);
                }
                else
                {
                    uiSlots = ResizeUISlots (uiSlots, maxSlots);
                }

                for (int i=0; i<uiSlots.Length; i++)
                {
                    uiSlots[i].LinkedUiGUI (i, source);
                }
            }

            EditorGUILayout.EndVertical ();

            base.ShowGUI (source);
        }
Exemplo n.º 14
0
        public override void Declare()
        {
            uiSlots = null;

            newSaveText = "New save";
            isVisible = true;
            isClickable = true;
            numSlots = 1;
            maxSlots = 5;

            SetSize (new Vector2 (20f, 5f));
            anchor = TextAnchor.MiddleCenter;
            saveListType = AC_SaveListType.Save;

            actionListOnSave = null;
            newSaveSlot = false;
            textEffects = TextEffects.None;
            displayType = SaveDisplayType.LabelOnly;
            blankSlotTexture = null;

            fixedOption = false;
            optionToShow = 1;

            importProductName = "";
            importSaveFilename = "";
            checkImportBool = false;
            checkImportVar = 0;

            showNewSaveOption = true;
            autoHandle = true;

            parameterID = -1;

            base.Declare ();
        }
Exemplo n.º 15
0
        public override void ShowGUI(MenuSource source)
        {
            EditorGUILayout.BeginVertical("Button");

            fixedOption = EditorGUILayout.Toggle("Fixed option number?", fixedOption);
            if (fixedOption)
            {
                numSlots     = 1;
                slotSpacing  = 0f;
                optionToShow = EditorGUILayout.IntField("Option to display:", optionToShow);
            }
            else
            {
                maxSaves = EditorGUILayout.IntField("Max saves:", maxSaves);

                if (source == MenuSource.AdventureCreator)
                {
                    numSlots    = EditorGUILayout.IntSlider("Test slots:", numSlots, 1, 10);
                    slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f);
                    orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation);
                    if (orientation == ElementOrientation.Grid)
                    {
                        gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10);
                    }
                }
            }

            if (source == MenuSource.AdventureCreator)
            {
                anchor      = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor);
                textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects);
            }

            displayType = (SaveDisplayType)EditorGUILayout.EnumPopup("Display:", displayType);
            if (displayType != SaveDisplayType.LabelOnly)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Empty slot texture:", GUILayout.Width(145f));
                blankSlotTexture = (Texture2D)EditorGUILayout.ObjectField(blankSlotTexture, typeof(Texture2D), false, GUILayout.Width(70f), GUILayout.Height(30f));
                EditorGUILayout.EndHorizontal();
            }
            saveListType = (AC_SaveListType)EditorGUILayout.EnumPopup("Click action:", saveListType);
            if (saveListType == AC_SaveListType.Save)
            {
                newSaveText      = EditorGUILayout.TextField("'New save' text:", newSaveText);
                actionListOnSave = ActionListAssetMenu.AssetGUI("ActionList after saving:", actionListOnSave);
            }
            else if (saveListType == AC_SaveListType.Load)
            {
                actionListOnSave = ActionListAssetMenu.AssetGUI("ActionList after loading:", actionListOnSave);
            }
            else if (saveListType == AC_SaveListType.Import)
            {
                                #if UNITY_STANDALONE
                importProductName  = EditorGUILayout.TextField("Import product name:", importProductName);
                importSaveFilename = EditorGUILayout.TextField("Import save filename:", importSaveFilename);
                actionListOnSave   = ActionListAssetMenu.AssetGUI("ActionList after import:", actionListOnSave);
                checkImportBool    = EditorGUILayout.Toggle("Require Bool to be true?", checkImportBool);
                if (checkImportBool)
                {
                    checkImportVar = EditorGUILayout.IntField("Global Variable ID:", checkImportVar);
                }
                                #else
                EditorGUILayout.HelpBox("This feature is only available for standalone platforms (PC, Mac, Linux)", MessageType.Warning);
                                #endif
            }

            if (source != MenuSource.AdventureCreator)
            {
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");

                if (fixedOption)
                {
                    uiSlots = ResizeUISlots(uiSlots, 1);
                }
                else
                {
                    uiSlots = ResizeUISlots(uiSlots, maxSaves);
                }

                for (int i = 0; i < uiSlots.Length; i++)
                {
                    uiSlots[i].LinkedUiGUI(i, source);
                }
            }

            EditorGUILayout.EndVertical();

            base.ShowGUI(source);
        }