Example #1
0
        private void CopyToggle(MenuToggle _element, bool ignoreUnityUI)
        {
            if (ignoreUnityUI)
            {
                uiToggle = null;
            }
            else
            {
                uiToggle = _element.uiToggle;
            }

            uiText                = null;
            label                 = _element.label;
            isOn                  = _element.isOn;
            textEffects           = _element.textEffects;
            outlineSize           = _element.outlineSize;
            anchor                = _element.anchor;
            toggleType            = _element.toggleType;
            varID                 = _element.varID;
            appendState           = _element.appendState;
            onTexture             = _element.onTexture;
            offTexture            = _element.offTexture;
            actionListOnClick     = _element.actionListOnClick;
            uiSelectableHideStyle = _element.uiSelectableHideStyle;
            onText                = _element.onText;
            offText               = _element.offText;
            onTextLineID          = _element.onTextLineID;
            offTextLineID         = _element.offTextLineID;
            isClickable           = _element.isClickable;

            base.Copy(_element);
        }
Example #2
0
		public override MenuElement DuplicateSelf (bool fromEditor, bool ignoreUnityUI)
		{
			MenuToggle newElement = CreateInstance <MenuToggle>();
			newElement.Declare ();
			newElement.CopyToggle (this, ignoreUnityUI);
			return newElement;
		}
Example #3
0
        /**
         * <summary>Creates and returns a new MenuToggle that has the same values as itself.</summary>
         * <param name = "fromEditor">If True, the duplication was done within the Menu Manager and not as part of the gameplay initialisation.</param>
         * <returns>A new MenuToggle with the same values as itself</returns>
         */
        public override MenuElement DuplicateSelf(bool fromEditor)
        {
            MenuToggle newElement = CreateInstance <MenuToggle>();

            newElement.Declare();
            newElement.CopyToggle(this);
            return(newElement);
        }
Example #4
0
		public void CopyToggle (MenuToggle _element)
		{
			label = _element.label;
			isOn = _element.isOn;
			textEffects = _element.textEffects;
			anchor = _element.anchor;
			toggleType = _element.toggleType;
			varID = _element.varID;
			appendState = _element.appendState;
			onTexture = _element.onTexture;
			offTexture = _element.offTexture;
			
			base.Copy (_element);
		}
Example #5
0
        public void CopyToggle(MenuToggle _element)
        {
            uiToggle    = _element.uiToggle;
            uiText      = null;
            label       = _element.label;
            isOn        = _element.isOn;
            textEffects = _element.textEffects;
            anchor      = _element.anchor;
            toggleType  = _element.toggleType;
            varID       = _element.varID;
            appendState = _element.appendState;
            onTexture   = _element.onTexture;
            offTexture  = _element.offTexture;

            base.Copy(_element);
        }
Example #6
0
        public void CopyToggle(MenuToggle _element)
        {
            uiToggle = _element.uiToggle;
            uiText = null;
            label = _element.label;
            isOn = _element.isOn;
            textEffects = _element.textEffects;
            anchor = _element.anchor;
            toggleType = _element.toggleType;
            varID = _element.varID;
            appendState = _element.appendState;
            onTexture = _element.onTexture;
            offTexture = _element.offTexture;
            actionListOnClick = _element.actionListOnClick;

            base.Copy (_element);
        }
Example #7
0
        private void CopyToggle(MenuToggle _element)
        {
            uiToggle          = _element.uiToggle;
            uiText            = null;
            label             = _element.label;
            isOn              = _element.isOn;
            textEffects       = _element.textEffects;
            outlineSize       = _element.outlineSize;
            anchor            = _element.anchor;
            toggleType        = _element.toggleType;
            varID             = _element.varID;
            appendState       = _element.appendState;
            onTexture         = _element.onTexture;
            offTexture        = _element.offTexture;
            actionListOnClick = _element.actionListOnClick;

            base.Copy(_element);
        }
Example #8
0
        private void SearchForInstances(bool justLocal, ActionType actionType)
        {
            if (searchedAssets != null)
            {
                searchedAssets.Clear();
            }

            if (justLocal)
            {
                SearchSceneForType("", actionType);
                return;
            }

            string[] sceneFiles = AdvGame.GetSceneFiles();

            // First look for lines that already have an assigned lineID
            foreach (string sceneFile in sceneFiles)
            {
                SearchSceneForType(sceneFile, actionType);
            }

            // Settings
            if (KickStarter.settingsManager)
            {
                SearchAssetForType(KickStarter.settingsManager.actionListOnStart, actionType);
                if (KickStarter.settingsManager.activeInputs != null)
                {
                    foreach (ActiveInput activeInput in KickStarter.settingsManager.activeInputs)
                    {
                        SearchAssetForType(activeInput.actionListAsset, actionType);
                    }
                }
            }

            // Inventory
            if (KickStarter.inventoryManager)
            {
                SearchAssetForType(KickStarter.inventoryManager.unhandledCombine, actionType);
                SearchAssetForType(KickStarter.inventoryManager.unhandledHotspot, actionType);
                SearchAssetForType(KickStarter.inventoryManager.unhandledGive, actionType);

                // Item-specific events
                if (KickStarter.inventoryManager.items.Count > 0)
                {
                    foreach (InvItem item in (KickStarter.inventoryManager.items))
                    {
                        SearchAssetForType(item.useActionList, actionType);
                        SearchAssetForType(item.lookActionList, actionType);
                        SearchAssetForType(item.unhandledActionList, actionType);
                        SearchAssetForType(item.unhandledCombineActionList, actionType);

                        foreach (ActionListAsset actionList in item.combineActionList)
                        {
                            SearchAssetForType(actionList, actionType);
                        }

                        foreach (InvInteraction interaction in item.interactions)
                        {
                            if (interaction.actionList != null)
                            {
                                SearchAssetForType(interaction.actionList, actionType);
                            }
                        }
                    }
                }

                foreach (Recipe recipe in KickStarter.inventoryManager.recipes)
                {
                    SearchAssetForType(recipe.invActionList, actionType);
                    SearchAssetForType(recipe.actionListOnCreate, actionType);
                }
            }

            // Cursor
            if (KickStarter.cursorManager)
            {
                // Prefixes
                foreach (ActionListAsset actionListAsset in KickStarter.cursorManager.unhandledCursorInteractions)
                {
                    SearchAssetForType(actionListAsset, actionType);
                }
            }

            // Menus
            if (KickStarter.menuManager)
            {
                // Gather elements
                if (KickStarter.menuManager.menus.Count > 0)
                {
                    foreach (AC.Menu menu in KickStarter.menuManager.menus)
                    {
                        SearchAssetForType(menu.actionListOnTurnOff, actionType);
                        SearchAssetForType(menu.actionListOnTurnOn, actionType);

                        foreach (MenuElement element in menu.elements)
                        {
                            if (element is MenuButton)
                            {
                                MenuButton button = (MenuButton)element;
                                if (button.buttonClickType == AC_ButtonClickType.RunActionList)
                                {
                                    SearchAssetForType(button.actionList, actionType);
                                }
                            }
                            else if (element is MenuSavesList)
                            {
                                MenuSavesList button = (MenuSavesList)element;
                                SearchAssetForType(button.actionListOnSave, actionType);
                            }
                            else if (element is MenuCycle)
                            {
                                MenuCycle cycle = (MenuCycle)element;
                                SearchAssetForType(cycle.actionListOnClick, actionType);
                            }
                            else if (element is MenuJournal)
                            {
                                MenuJournal journal = (MenuJournal)element;
                                SearchAssetForType(journal.actionListOnAddPage, actionType);
                            }
                            else if (element is MenuSlider)
                            {
                                MenuSlider slider = (MenuSlider)element;
                                SearchAssetForType(slider.actionListOnChange, actionType);
                            }
                            else if (element is MenuToggle)
                            {
                                MenuToggle toggle = (MenuToggle)element;
                                SearchAssetForType(toggle.actionListOnClick, actionType);
                            }
                            else if (element is MenuProfilesList)
                            {
                                MenuProfilesList profilesList = (MenuProfilesList)element;
                                SearchAssetForType(profilesList.actionListOnClick, actionType);
                            }
                        }
                    }
                }
            }

            searchedAssets.Clear();
        }