Exemple #1
0
        public void CopyButton(MenuButton _element)
        {
            uiButton = _element.uiButton;
            uiText = _element.uiText;
            label = _element.label;
            hotspotLabel = _element.hotspotLabel;
            hotspotLabelID = _element.hotspotLabelID;
            anchor = _element.anchor;
            textEffects = _element.textEffects;
            buttonClickType = _element.buttonClickType;
            simulateInput = _element.simulateInput;
            simulateValue = _element.simulateValue;
            doFade = _element.doFade;
            switchMenuTitle = _element.switchMenuTitle;
            inventoryBoxTitle = _element.inventoryBoxTitle;
            shiftInventory = _element.shiftInventory;
            loopJournal = _element.loopJournal;
            actionList = _element.actionList;
            inputAxis = _element.inputAxis;
            clickTexture = _element.clickTexture;
            clickAlpha = _element.clickAlpha;
            shiftAmount = _element.shiftAmount;
            onlyShowWhenEffective = _element.onlyShowWhenEffective;
            allowContinuousClick = _element.allowContinuousClick;
            parameterID = _element.parameterID;
            parameterValue = _element.parameterValue;

            base.Copy (_element);
        }
Exemple #2
0
        private void CopyButton(MenuButton _element, bool ignoreUnityUI)
        {
            if (ignoreUnityUI)
            {
                uiButton = null;
                uiText   = null;
            }
            else
            {
                uiButton = _element.uiButton;
                uiText   = _element.uiText;
            }
            uiPointerState = _element.uiPointerState;

            label                 = _element.label;
            hotspotLabel          = _element.hotspotLabel;
            hotspotLabelID        = _element.hotspotLabelID;
            anchor                = _element.anchor;
            textEffects           = _element.textEffects;
            outlineSize           = _element.outlineSize;
            buttonClickType       = _element.buttonClickType;
            simulateInput         = _element.simulateInput;
            simulateValue         = _element.simulateValue;
            doFade                = _element.doFade;
            switchMenuTitle       = _element.switchMenuTitle;
            inventoryBoxTitle     = _element.inventoryBoxTitle;
            shiftInventory        = _element.shiftInventory;
            loopJournal           = _element.loopJournal;
            actionList            = _element.actionList;
            inputAxis             = _element.inputAxis;
            clickTexture          = _element.clickTexture;
            clickAlpha            = _element.clickAlpha;
            shiftAmount           = _element.shiftAmount;
            onlyShowWhenEffective = _element.onlyShowWhenEffective;
            allowContinuousClick  = _element.allowContinuousClick;
            parameterID           = _element.parameterID;
            parameterValue        = _element.parameterValue;
            uiSelectableHideStyle = _element.uiSelectableHideStyle;

            base.Copy(_element);
        }
        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();
        }
Exemple #4
0
        private void ExtractHotspotOverride(MenuButton button, string hotspotLabel, bool onlySeekNew)
        {
            if (hotspotLabel == "")
            {
                button.hotspotLabelID = -1;
                return;
            }

            if (onlySeekNew && button.lineID == -1)
            {
                // Assign a new ID on creation
                SpeechLine newLine = new SpeechLine (GetIDArray(), "", button.title, hotspotLabel, languages.Count - 1, AC_TextType.MenuElement);
                button.hotspotLabelID = newLine.lineID;
                lines.Add (newLine);
            }

            else if (!onlySeekNew && button.hotspotLabelID > -1)
            {
                // Already has an ID, so don't replace
                SpeechLine existingLine = new SpeechLine (button.hotspotLabelID, "", button.title, hotspotLabel, languages.Count - 1, AC_TextType.MenuElement);

                int lineID = SmartAddLine (existingLine);
                if (lineID >= 0) button.hotspotLabelID = lineID;
            }
        }