Ejemplo n.º 1
0
        public string GetFullLabel(Hotspot _hotspot, InvInstance invInstance, int _language)
        {
            if (_hotspot == null)
            {
                return(string.Empty);
            }

            if (_hotspot.lookButton == this)
            {
                string prefix      = KickStarter.cursorManager.GetLabelFromID(KickStarter.cursorManager.lookCursor_ID, _language);
                string hotspotName = _hotspot.GetName(_language);
                if (_hotspot.canBeLowerCase && !string.IsNullOrEmpty(prefix))
                {
                    hotspotName = hotspotName.ToLower();
                }

                return(AdvGame.CombineLanguageString(prefix, hotspotName, _language));
            }
            else if (_hotspot.useButtons.Contains(this))
            {
                string prefix      = KickStarter.cursorManager.GetLabelFromID(iconID, _language);
                string hotspotName = _hotspot.GetName(_language);
                if (_hotspot.canBeLowerCase && !string.IsNullOrEmpty(prefix))
                {
                    hotspotName = hotspotName.ToLower();
                }

                return(AdvGame.CombineLanguageString(prefix, hotspotName, _language));
            }
            else if (_hotspot.invButtons.Contains(this) && InvInstance.IsValid(invInstance))
            {
                string prefix      = invInstance.GetHotspotPrefixLabel(_language);
                string hotspotName = _hotspot.GetName(_language);
                if (_hotspot.canBeLowerCase && !string.IsNullOrEmpty(prefix))
                {
                    hotspotName = hotspotName.ToLower();
                }

                return(AdvGame.CombineLanguageString(prefix, hotspotName, _language));
            }

            return(string.Empty);
        }
Ejemplo n.º 2
0
        /**
         * <summary>Gets the prefix for the Hotspot label (the label without the interactive Hotspot or inventory item)</summary>
         * <param name = "_hotspot">The Hotspot to get the prefix label for. This will be ignored if _invItem is not null</param>
         * <param name = "_invItem">The Inventory Item to get the prefix label for. This will override _hotspot if not null</param>
         * <param name = "languageNumber">The index number of the language to return. If 0, the default language will be used</param>
         * <param name = "cursorID">The ID number of the cursor to rely on, if appropriate.  If <0, the active cursor will be used</param>
         * <returns>The prefix for the Hotspot label</summary>
         */
        public string GetLabelPrefix(int languageNumber = 0, int cursorID = -1)
        {
            int interactionIndex = KickStarter.playerInteraction.InteractionIndex;

            bool isOverride = (cursorID >= 0);

            if (!isOverride)
            {
                cursorID = KickStarter.playerCursor.GetSelectedCursorID();
            }

            string label = string.Empty;

            if (InvInstance.IsValid(KickStarter.runtimeInventory.SelectedInstance) && KickStarter.cursorManager.inventoryHandling != InventoryHandling.ChangeCursor)
            {
                label = KickStarter.runtimeInventory.SelectedInstance.GetHotspotPrefixLabel(languageNumber, true);
            }
            else
            {
                if (KickStarter.cursorManager.addHotspotPrefix)
                {
                    switch (KickStarter.settingsManager.interactionMethod)
                    {
                    case AC_InteractionMethod.ChooseInteractionThenHotspot:
                    case AC_InteractionMethod.CustomScript:
                        label = KickStarter.cursorManager.GetLabelFromID(cursorID, languageNumber);
                        break;

                    case AC_InteractionMethod.ChooseHotspotThenInteraction:
                        if (KickStarter.settingsManager.selectInteractions == SelectInteractions.CyclingCursorAndClickingHotspot ||
                            KickStarter.settingsManager.selectInteractions == SelectInteractions.ClickingMenu)
                        {
                            label = KickStarter.cursorManager.GetLabelFromID(cursorID, languageNumber);
                        }
                        else if (KickStarter.settingsManager.selectInteractions == SelectInteractions.CyclingMenuAndClickingHotspot)
                        {
                            if (interactionIndex >= 0 && KickStarter.playerMenus.IsInteractionMenuOn())
                            {
                                if (interactions.Count > interactionIndex)
                                {
                                    label = KickStarter.cursorManager.GetLabelFromID(interactions[interactionIndex].icon.id, languageNumber);
                                }
                                else
                                {
                                    // Inventory item
                                    int itemIndex = interactionIndex - interactions.Count;
                                    if (interactions.Count > itemIndex)
                                    {
                                        InvInstance invInstance = KickStarter.runtimeInventory.GetInstance(combineID[itemIndex]);
                                        if (InvInstance.IsValid(invInstance))
                                        {
                                            label = invInstance.GetHotspotPrefixLabel(languageNumber);
                                        }
                                    }
                                }
                            }
                        }
                        break;

                    default:
                        break;
                    }
                }
            }

            return(label);
        }