Exemple #1
0
        private void StringToButtonStates(Hotspot hotspot, string stateString)
        {
            if (string.IsNullOrEmpty(stateString))
            {
                return;
            }

            string[] typesArray = stateString.Split(SaveSystem.pipe[0]);

            if (KickStarter.settingsManager == null || KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
            {
                // Look interactions
                if (hotspot.provideLookInteraction && hotspot.lookButton != null)
                {
                    hotspot.SetButtonState(hotspot.lookButton, !SetButtonDisabledValue(typesArray [0]));
                }
            }

            if (hotspot.provideUseInteraction && hotspot.useButtons.Count > 0)
            {
                string[] usesArray = typesArray[1].Split(","[0]);

                for (int i = 0; i < usesArray.Length; i++)
                {
                    if (hotspot.useButtons.Count < i + 1)
                    {
                        break;
                    }

                    hotspot.SetButtonState(hotspot.useButtons[i], !SetButtonDisabledValue(usesArray [i]));
                }
            }

            // Inventory interactions
            if (hotspot.provideInvInteraction && typesArray.Length > 2 && hotspot.invButtons.Count > 0)
            {
                string[] invArray = typesArray[2].Split(","[0]);

                for (int i = 0; i < invArray.Length; i++)
                {
                    if (hotspot.invButtons.Count < i + 1)
                    {
                        break;
                    }

                    hotspot.SetButtonState(hotspot.invButtons[i], !SetButtonDisabledValue(invArray [i]));
                }
            }
        }
Exemple #2
0
        protected void ChangeButton(AC.Button button)
        {
            if (button == null)
            {
                return;
            }

            switch (changeType)
            {
            case ChangeType.Enable:
                runtimeHotspot.SetButtonState(button, true);
                break;

            case ChangeType.Disable:
                runtimeHotspot.SetButtonState(button, false);
                break;
            }
        }