Exemplo n.º 1
0
        public Llatext.Instructions.Instruction Introduction()
        {
            InevitableGUI.Output("You wake up the next morning. You grab some of your previous inventory items and take them with you");
            InevitableGUI.Output("Your next mission is to obtain some breakfast from the Supermarket: cerial and milk.");


            //Bit dirty - but this means it doesn't come from a savegame
            if (InventoryHandling.InventoryCount() != 0)
            {
                //clear the inventory
                InventoryHandling.RemoveAll();

                InventoryHandling.AddItem(new InventoryItem("money", "Enough cash to buy yourself some cerial and milk"));
                InventoryHandling.AddItem(new InventoryItem("hammerdriver", "Your faithful multi-tool companion"));

                return(new Instruction(InstructionType.SAVE, "1")); //save day 1
            }
            else
            {
                //comes from a savegame
                InventoryHandling.AddItem(new InventoryItem("money", "Enough cash to buy yourself some cerial and milk"));
                InventoryHandling.AddItem(new InventoryItem("hammerdriver", "Your faithful multi-tool companion"));

                return(new Instruction());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads a game from a saved file
        /// </summary>
        /// <param name="name">The name of the file to load</param>
        private static Instruction LoadSavedGame(string name)
        {
            //Is the file really there
            try
            {
                FileStream stream = new FileStream(name + ".isg", FileMode.Open);

                BinaryReader reader = new BinaryReader(stream);

                //first one is the day, second is the gotdfc and third is the time

                int day = reader.ReadInt32();
                InventoryHandling.Goodfc = reader.ReadInt32();

                //Change the start time

                TimeSpan span = new TimeSpan(0, 0, reader.ReadInt32());

                startTime = DateTime.Now - span;
                InventoryHandling.RemoveAll(); //clear the inventory

                return(new Instruction(InstructionType.LOAD, "day" + day));
            }
            catch
            {
                //File not there
                InevitableGUI.Output("The save game does not exist :( Sorry.");
                return(new Instruction(InstructionType.UNKNOWN, ""));
            }
            //We have to read 3 values
        }
Exemplo n.º 3
0
        public Llatext.Instructions.Instruction Use(string parameter)
        {
            if (parameter.Equals("ATM"))
            {
                if (InventoryHandling.HasItem("paycheck"))
                {
                    InevitableGUI.Output("You insert the paycheck into the ATM. You get some cash in return. Hooray");

                    InventoryHandling.RemoveItem("banknote");
                    InventoryHandling.RemoveItem("paycheck");
                    InventoryHandling.AddItem(new InventoryItem("cash", "Money Money Money"));

                    return(new Instruction());
                }
                else
                {
                    InevitableGUI.Output("You don't have your paycheck");
                    return(new Instruction());
                }
            }
            else
            {
                InevitableGUI.Output("You can't use that");
                return(new Instruction());
            }
        }
Exemplo n.º 4
0
        public Llatext.Instructions.Instruction Use(string[] items)
        {
            if (items.Contains("ATM"))
            {
                if (items.Contains("HAMMERDRIVER") && InventoryHandling.HasItem("hammerdriver"))
                {
                    InevitableGUI.Output("You raise your hammerdriver, but then think better of it");
                }
                else if (items.Contains("PAYCHECK") && InventoryHandling.HasItem("paycheck"))
                {
                    InevitableGUI.Output("You insert the paycheck into the ATM. You get some cash in return. Hooray");
                    InventoryHandling.RemoveItem("banknote");
                    InventoryHandling.RemoveItem("paycheck");
                    InventoryHandling.AddItem(new InventoryItem("cash", "Money Money Money"));
                }
                else
                {
                    InevitableGUI.Output("That won't work");
                }
            }
            else if (items.Contains("RECEPTIONIST"))
            {
                if (items.Contains("BANKNOTE") && InventoryHandling.HasItem("banknote"))
                {
                    InevitableGUI.Output("He sneers at you 'That's not nearly enough'");
                }
                else if (items.Contains("CASH") && InventoryHandling.HasItem("cash"))
                {
                    if (hasKey)
                    {
                        InevitableGUI.Output("You've already paid him");
                    }
                    else
                    {
                        InevitableGUI.Output("He takes some of your money, handing you the rest and opens a room for you.");
                        InevitableGUI.Output("You can go North now");
                        hasKey = true;
                    }
                }
                else if (items.Contains("HAMMERDRIVER") && InventoryHandling.HasItem("hammerdriver"))
                {
                    InevitableGUI.Output("You raise the hammerdriver threatiningly. The receptionist fears for his life and pulls out a shotgun from his desk");
                    InevitableGUI.Output("You are shot. You die");
                    return(new Instruction(InstructionType.DEATH, "Had too much lead in his diet. Survived till day 0.6"));
                }
                else
                {
                    InevitableGUI.Output("That won't work");
                }
            }
            else
            {
                InevitableGUI.Output("That won't work");
            }

            return(new Instruction());
        }
Exemplo n.º 5
0
        public Llatext.Instructions.Instruction Use(string[] items)
        {
            if (items.Contains("pspray"))
            {
                if (!InventoryHandling.HasItem("pspray"))
                {
                    InevitableGUI.Output("You don't have that in your inventory");
                    return(new Instruction());
                }
            }

            throw new NotImplementedException();
        }
Exemplo n.º 6
0
        public Llatext.Instructions.Instruction Use(string parameter)
        {
            if (parameter.Contains("ATM"))
            {
                InevitableGUI.Output("The ATM isn't working, its powered off");
                return(new Instruction());
            }
            else if (parameter.Contains("FLAP"))
            {
                InevitableGUI.Output("You push your hand through the flap and grab around. You pick up a mysterious tube and put it in your pocket");
                InevitableGUI.Output("You examine the tube and discover it to be a tube of PSpray - a commerical Pepper Spray solution");

                InventoryHandling.AddItem(new InventoryItem("pspray", "A bottle of pepper spray"));
            }
            return(new Instruction());
        }
Exemplo n.º 7
0
 public Llatext.Instructions.Instruction Use(string[] items)
 {
     if (items.Contains("BEGGAR") && beggerThere)
     {
         if (items.Contains("BANKNOTE"))
         {
             if (InventoryHandling.HasItem("banknote"))
             {
                 InevitableGUI.Output("You hand the beggar the cash. He smiles at you and hands you a Get Out Of Death Free card. He then disappears in a puff of smoke");
                 InventoryHandling.AddGODFC();
                 InventoryHandling.RemoveItem("banknote");
                 beggerThere = false;
             }
             else
             {
                 InevitableGUI.Output("You don't have that item");
             }
         }
         else if (items.Contains("HAMMERDRIVER"))
         {
             if (InventoryHandling.HasItem("hammerdriver"))
             {
                 InevitableGUI.Output("You whack the beggar with your hammer driver. He runs away screaming");
                 InevitableGUI.Output("You chase him but eventually give up.");
                 beggerThere = false;
             }
             else
             {
                 InevitableGUI.Output("You don't have that item");
             }
         }
         else
         {
             InevitableGUI.Output("You don't have that item");
         }
     }
     else
     {
         InevitableGUI.Output("You can't use those two together");
     }
     return(new Instruction());
 }
Exemplo n.º 8
0
        public Llatext.Instructions.Instruction Use(string[] items)
        {
            if (items.Contains("HAMMERDRIVER"))
            {
                if (!InventoryHandling.HasItem("hammerdriver"))
                {
                    InevitableGUI.Output("You don't have that item");
                    return(new Instruction());
                }

                if (items.Contains("THUNDERBEAK") || items.Contains("CHICKEN"))
                {
                    InevitableGUI.Output("The poor chicken! Leave her alone");
                    return(new Instruction());
                }
            }

            InevitableGUI.Output("You can't use those two together");
            return(new Instruction());
        }
Exemplo n.º 9
0
        public Llatext.Instructions.Instruction Take(string parameter)
        {
            if (parameter.EqualsCaseless("register"))
            {
                InevitableGUI.Output("That's illegal! As a law-abiding citizen you shouldn't harbour such thoughts");
            }
            else if (parameter.EqualsCaseless("cashier"))
            {
                InevitableGUI.Output("You're not touching him. He's ginger!");
            }
            else if (parameter.EqualsCaseless("sweets") || parameter.EqualsCaseless("jar"))
            {
                InevitableGUI.Output("You wait till the guy isn't looking and then nick a few. You add sweets to your inventory");
                InventoryHandling.AddItem(new InventoryItem("sweets", "Some mint flavoured sweets"));
            }
            else
            {
                InevitableGUI.Output("You can't take that");
            }

            return(new Instruction());
        }
Exemplo n.º 10
0
        public Llatext.Instructions.Instruction Use(string[] items)
        {
            if (items.Contains("HAMMERDRIVER") && InventoryHandling.HasItem("hammerdriver"))
            {
                if (items.Contains("ATM"))
                {
                    InevitableGUI.Output("You smash the ATM with the hammerdriver. The ATM's security system kicks in and delivers a high voltage shock through the hammer");
                    return(new Instruction(InstructionType.DEATH, "ATM Security Victim. Survived till day 1"));
                }
                else if (items.Contains("DESK"))
                {
                    InevitableGUI.Output("The proprietor won't be too happy with you smashing his desk");
                    return(new Instruction());
                }

                return(new Instruction());
            }
            else
            {
                InevitableGUI.Output("That won't work");
                return(new Instruction());
            }
        }
Exemplo n.º 11
0
        /**
         * Shows the GUI.
         */
        public void ShowGUI()
        {
            settingsManager = AdvGame.GetReferences().settingsManager;

            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showSettings = CustomGUILayout.ToggleHeader(showSettings, "Global cursor settings");
            if (showSettings)
            {
                cursorRendering = (CursorRendering)CustomGUILayout.EnumPopup("Cursor rendering:", cursorRendering, "AC.KickStarter.cursorManager.cursorRendering");
                if (cursorRendering == CursorRendering.Software)
                {
                    lockSystemCursor = CustomGUILayout.ToggleLeft("Lock system cursor when locking AC cursor?", lockSystemCursor, "AC.KickStarter.cursorManager.lockSystemCursor");
                }
                forceCursorInEditor = CustomGUILayout.ToggleLeft("Always show system cursor in Editor?", forceCursorInEditor, "AC.KickStarter.cursorManager.forceCursorInEditor");
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showMainCursor = CustomGUILayout.ToggleHeader(showMainCursor, "Main cursor settings");
            if (showMainCursor)
            {
                cursorDisplay = (CursorDisplay)CustomGUILayout.EnumPopup("Display cursor:", cursorDisplay, "AC.KickStarter.cursorManager.cursorDisplay");
                if (cursorDisplay != CursorDisplay.Never)
                {
                    allowMainCursor = CustomGUILayout.Toggle("Replace mouse cursor?", allowMainCursor, "AC.KickStarter.cursorManager.allowMainCursor");
                    if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController))
                    {
                        IconBaseGUI("", pointerIcon, "AC.KickStarter.cursorManager.pointerIcon");
                    }
                }
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showWalkCursor = CustomGUILayout.ToggleHeader(showWalkCursor, "Walk cursor");
            if (showWalkCursor)
            {
                if (allowMainCursor)
                {
                    allowWalkCursor = CustomGUILayout.Toggle("Provide walk cursor?", allowWalkCursor, "AC.KickStarter.cursorManager.allowWalkCursor");
                    if (allowWalkCursor)
                    {
                        if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
                        {
                            EditorGUILayout.LabelField("Input button:", "Icon_Walk");
                        }
                        IconBaseGUI("", walkIcon, "AC.KickStarter.cursorManager.walkIcon");
                        onlyWalkWhenOverNavMesh = CustomGUILayout.ToggleLeft("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh, "AC.KickStarter.cursorManager.onlyWalkWhenOverNavMesh");
                    }
                }
                addWalkPrefix = CustomGUILayout.Toggle("Prefix cursor labels?", addWalkPrefix, "AC.KickStarter.cursorManager.addWalkPrefix");
                if (addWalkPrefix)
                {
                    walkPrefix.label = CustomGUILayout.TextField("Walk prefix:", walkPrefix.label, "AC.KickStarter.cursorManager.walkPrefix");
                }
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showHotspotCursor = CustomGUILayout.ToggleHeader(showHotspotCursor, "Hotspot cursor");
            if (showHotspotCursor)
            {
                addHotspotPrefix = CustomGUILayout.Toggle("Prefix cursor labels?", addHotspotPrefix, "AC.KickStarter.cursorManager.addHotspotPrefix");
                IconBaseGUI("", mouseOverIcon, "AC.KickStarter.cursorManager.mouseOverIcon");
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showInventoryCursor = CustomGUILayout.ToggleHeader(showInventoryCursor, "Inventory cursor");
            if (showInventoryCursor)
            {
                inventoryHandling = (InventoryHandling)CustomGUILayout.EnumPopup("When inventory selected:", inventoryHandling, "AC.KickStarter.cursorManager.inventoryHandling");
                if (inventoryHandling != InventoryHandling.ChangeCursor)
                {
                    onlyShowInventoryLabelOverHotspots = CustomGUILayout.ToggleLeft("Only show label when over Hotspots and Inventory?", onlyShowInventoryLabelOverHotspots, "AC.KickStarter.cursorManager.onlyShowInventoryLabelOverHotspots");
                }
                if (inventoryHandling != InventoryHandling.ChangeHotspotLabel)
                {
                    inventoryCursorSize = CustomGUILayout.FloatField("Inventory cursor size:", inventoryCursorSize, "AC.KickStarter.cursorManager.inventoryCursorSize");
                }
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Use syntax:", GUILayout.Width(100f));
                hotspotPrefix1.label = CustomGUILayout.TextField(hotspotPrefix1.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix1");
                EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                hotspotPrefix2.label = CustomGUILayout.TextField(hotspotPrefix2.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix2");
                EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                EditorGUILayout.EndHorizontal();
                if (AdvGame.GetReferences().settingsManager&& AdvGame.GetReferences().settingsManager.CanGiveItems())
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Give syntax:", GUILayout.Width(100f));
                    hotspotPrefix3.label = CustomGUILayout.TextField(hotspotPrefix3.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix3");
                    EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                    hotspotPrefix4.label = CustomGUILayout.TextField(hotspotPrefix4.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix4");
                    EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                    EditorGUILayout.EndHorizontal();
                }
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showInteractionIcons = CustomGUILayout.ToggleHeader(showInteractionIcons, "Interaction icons");
            if (showInteractionIcons)
            {
                if (settingsManager == null || settingsManager.interactionMethod != AC_InteractionMethod.ChooseHotspotThenInteraction)
                {
                    allowInteractionCursor = CustomGUILayout.ToggleLeft("Change cursor based on Interaction?", allowInteractionCursor, "AC.KickStarter.cursorManager.allowInteractionCursor");
                    if (allowInteractionCursor && (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive))
                    {
                        allowInteractionCursorForInventory = CustomGUILayout.ToggleLeft("Change when over Inventory items too?", allowInteractionCursorForInventory, "AC.KickStarter.cursorManager.allowInteractionCursorForInventory");
                    }
                    if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
                    {
                        cycleCursors            = CustomGUILayout.ToggleLeft("Cycle Interactions with right-click?", cycleCursors, "AC.KickStarter.cursorManager.cycleCursors");
                        onlyAnimateOverHotspots = CustomGUILayout.ToggleLeft("Only animate icons when over Hotspots?", onlyAnimateOverHotspots, "AC.KickStarter.cursorManager.onlyAnimateOverHotspots");
                    }
                }

                IconsGUI();

                EditorGUILayout.Space();

                if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
                {
                    LookIconGUI();
                }
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showCutsceneCursor = CustomGUILayout.ToggleHeader(showCutsceneCursor, "Cutscene cursor");
            if (showCutsceneCursor)
            {
                IconBaseGUI("", waitIcon, "AC.KickStarter.cursorManager.waitIcon");
            }
            EditorGUILayout.EndVertical();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(this);
            }
        }
Exemplo n.º 12
0
        /**
         * Shows the GUI.
         */
        public void ShowGUI()
        {
            settingsManager = AdvGame.GetReferences().settingsManager;

            cursorRendering = (CursorRendering)EditorGUILayout.EnumPopup("Cursor rendering:", cursorRendering);
            EditorGUILayout.Space();

            EditorGUILayout.BeginVertical("Button");
            EditorGUILayout.LabelField("Main cursor", EditorStyles.boldLabel);
            cursorDisplay = (CursorDisplay)EditorGUILayout.EnumPopup("Display cursor:", cursorDisplay);
            if (cursorDisplay != CursorDisplay.Never)
            {
                allowMainCursor = EditorGUILayout.Toggle("Replace mouse cursor?", allowMainCursor);
                if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController))
                {
                    IconBaseGUI("Main cursor:", pointerIcon);
                }
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();

            EditorGUILayout.BeginVertical("Button");
            EditorGUILayout.LabelField("Walk settings", EditorStyles.boldLabel);
            if (allowMainCursor)
            {
                allowWalkCursor = EditorGUILayout.Toggle("Provide walk cursor?", allowWalkCursor);
                if (allowWalkCursor)
                {
                    if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
                    {
                        EditorGUILayout.LabelField("Input button:", "Icon_Walk");
                    }
                    IconBaseGUI("Walk cursor:", walkIcon);
                    onlyWalkWhenOverNavMesh = EditorGUILayout.ToggleLeft("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh);
                }
            }
            addWalkPrefix = EditorGUILayout.Toggle("Prefix cursor labels?", addWalkPrefix);
            if (addWalkPrefix)
            {
                walkPrefix.label = EditorGUILayout.TextField("Walk prefix:", walkPrefix.label);
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();

            EditorGUILayout.BeginVertical("Button");
            EditorGUILayout.LabelField("Hotspot settings", EditorStyles.boldLabel);
            addHotspotPrefix = EditorGUILayout.Toggle("Prefix cursor labels?", addHotspotPrefix);
            IconBaseGUI("Mouse-over cursor:", mouseOverIcon);
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();

            EditorGUILayout.BeginVertical("Button");
            EditorGUILayout.LabelField("Inventory cursor", EditorStyles.boldLabel);
            inventoryHandling = (InventoryHandling)EditorGUILayout.EnumPopup("When inventory selected:", inventoryHandling);
            if (inventoryHandling != InventoryHandling.ChangeCursor)
            {
                onlyShowInventoryLabelOverHotspots = EditorGUILayout.ToggleLeft("Only show label when over Hotspots and Inventory?", onlyShowInventoryLabelOverHotspots);
            }
            if (inventoryHandling != InventoryHandling.ChangeHotspotLabel)
            {
                inventoryCursorSize = EditorGUILayout.FloatField("Inventory cursor size:", inventoryCursorSize);
            }
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Use syntax:", GUILayout.Width(100f));
            hotspotPrefix1.label = EditorGUILayout.TextField(hotspotPrefix1.label, GUILayout.MaxWidth(80f));
            EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
            hotspotPrefix2.label = EditorGUILayout.TextField(hotspotPrefix2.label, GUILayout.MaxWidth(80f));
            EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
            EditorGUILayout.EndHorizontal();
            if (AdvGame.GetReferences().settingsManager&& AdvGame.GetReferences().settingsManager.CanGiveItems())
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Give syntax:", GUILayout.Width(100f));
                hotspotPrefix3.label = EditorGUILayout.TextField(hotspotPrefix3.label, GUILayout.MaxWidth(80f));
                EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                hotspotPrefix4.label = EditorGUILayout.TextField(hotspotPrefix4.label, GUILayout.MaxWidth(80f));
                EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();

            EditorGUILayout.BeginVertical("Button");
            EditorGUILayout.LabelField("Interaction icons", EditorStyles.boldLabel);

            if (settingsManager == null || settingsManager.interactionMethod != AC_InteractionMethod.ChooseHotspotThenInteraction)
            {
                allowInteractionCursor = EditorGUILayout.ToggleLeft("Change cursor based on Interaction?", allowInteractionCursor);
                if (allowInteractionCursor && (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive))
                {
                    allowInteractionCursorForInventory = EditorGUILayout.ToggleLeft("Change when over Inventory items too?", allowInteractionCursorForInventory);
                }
                if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
                {
                    cycleCursors = EditorGUILayout.ToggleLeft("Cycle Interactions with right-click?", cycleCursors);
                }
            }

            IconsGUI();

            EditorGUILayout.Space();

            if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
            {
                LookIconGUI();
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();

            EditorGUILayout.BeginVertical("Button");
            IconBaseGUI("Wait cursor", waitIcon);
            EditorGUILayout.EndVertical();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(this);
            }
        }
Exemplo n.º 13
0
        public static void ProcessTerm(string term)
        {
            Instruction returnInstruction = new Instruction(InstructionType.UNKNOWN, "");

            term = term.ToUpper();

            if (term.Contains("QUIT") || (term.Contains("EXIT")))
            {
                InevitableGUI.Output("Bye");
                System.Environment.Exit(0);
            }

            if (hasWon)
            {
                List <string> replies = new List <string>();

                replies.Add("You won already");
                replies.Add("You've already won.. what else do you want?");
                replies.Add("We've got a winner here");
                replies.Add("Yeah you won. You can stop now");
                replies.Add("A winnar is you!");
                replies.Add("Why are you still playing? You're a winner. Do something else");

                InevitableGUI.Output(PickReplyFromList(replies));
                return;
            }

            if (!(term.Contains("START")) && (!hasStarted))
            {
                InevitableGUI.Output("\"Start Easy\" or \"Start Hard\" to start");
                return;
            }
            #region 0 parameters

            if (term.Contains("ABOUT"))
            {
                InevitableGUI.Output("Inevitable, and the LLatext Engine was written by Llama");
                InevitableGUI.Output("Dedicated to the Missus - who hates these sorts of games");
                InevitableGUI.Output("Feel free to redistribute, break, rewrite and not sell");
                InevitableGUI.Output("Please credit accordingly if you do");

                return;
            }

            if (term.Contains("LOOK"))
            {
                returnInstruction = currentRoom.Look();
            }
            else if (term.Contains("INVENTORY"))
            {
                string inventoryOutput = InventoryHandling.ListInventory();

                //split its linebreaks

                var inventorySplit = inventoryOutput.Split('\n');

                InevitableGUI.Output("Your inventory contains : " + inventorySplit[0]);

                for (int i = 1; i < inventorySplit.Count(); i++)
                {
                    InevitableGUI.Output(inventorySplit[i]);
                }
            }
            else if (term.Contains("HELP"))
            {
                InevitableGUI.Output("Help:");
                InevitableGUI.Output("Start - Starts the Game");
                InevitableGUI.Output("Quit - Quits the game");
                InevitableGUI.Output("Look - Looks around the room");
                InevitableGUI.Output("Inventory - Shows your inventory");
                InevitableGUI.Output("Help - Helps you.");
                InevitableGUI.Output("Remove X - Removes X");
                InevitableGUI.Output("Examine X - Examines a particular X in the room or your inventory");
                InevitableGUI.Output("Take X - Adds X to your inventory");
                InevitableGUI.Output("Open X - Opens X");
                InevitableGUI.Output("Go X - Go to a cardinal direction North/South/East/West");
                InevitableGUI.Output("Use X - Uses an item belonging in the room or in the inventory");
                InevitableGUI.Output("Use X with Y - Uses two items together");
                InevitableGUI.Output("About - Displays some about information");
                InevitableGUI.Output("Load X - Loads a savegame with filename x.isg");
                InevitableGUI.Output("End Help");
            }

            #endregion

            #region 1 parameters
            else
            if (term.Contains("EXAMINE"))
            {
                //we want the next word after it

                string nextWord = GetNextWord("EXAMINE", term);

                if (nextWord == null)
                {
                    InevitableGUI.Output("Error in Command - Examine what?");
                }
                else
                {
                    //check if its in the inventory
                    string invDesc = Inventory.InventoryHandling.DescribeItem(nextWord);

                    if (invDesc != "")
                    {
                        InevitableGUI.Output(invDesc);
                    }
                    else
                    {
                        //Check if its in the room
                        returnInstruction = currentRoom.Examine(nextWord);
                    }
                }
            }
            else if (term.Contains("START"))
            {
                string nextWord;

                if ((nextWord = GetNextWord("START", term)) == null || !((nextWord.Contains("EASY") || (nextWord.Contains("HARD")))))
                {
                    InevitableGUI.Output("Start Easy or Hard?");
                }
                else
                {
                    if (nextWord.Contains("EASY"))
                    {
                        InventoryHandling.AddGODFC();
                    }
                    else if (nextWord.Contains("HARD"))
                    {
                        //no GODFC
                    }
                    else
                    {
                    }


                    if (!hasStarted)
                    {
                        hasStarted = true;
                        InevitableGUI.Output("This is a game about death.");
                        InevitableGUI.Output("Regardless of what you do, it is Inevitable");
                        InevitableGUI.Output("How long can you survive?");
                        InevitableGUI.Output("---Starting Game---");

                        InevitableGUI.Output("You open your eyes and see only darkness. You are wearing a blindfold");
                        startTime = DateTime.Now;
                    }
                    else
                    {
                        InevitableGUI.Output("((The Game has started already. Focus!))");
                    }
                }
            }
            else if (term.Contains("TAKE"))
            {
                //we want the next word after it

                if (GetNextWord("TAKE", term) == null)
                {
                    InevitableGUI.Output("Error in command. Take what?");
                }
                else
                {
                    returnInstruction = currentRoom.Take(GetNextWord("TAKE", term));
                }
            }
            else if (term.Contains("OPEN"))
            {
                if (GetNextWord("OPEN", term) == null)
                {
                    InevitableGUI.Output("Error in command. Open what?");
                }
                else
                {
                    returnInstruction = currentRoom.Open(GetNextWord("OPEN", term));
                }
            }
            else if (term.Contains("GO"))
            {
                if (GetNextWord("GO", term) == null)
                {
                    InevitableGUI.Output("Error in command. Go where?");
                }
                else
                {
                    returnInstruction = currentRoom.Go(GetNextWord("GO", term));
                }
            }
            else if (term.Contains("USE") && !term.Contains("WITH"))
            {
                if (GetNextWord("USE", term) == null)
                {
                    InevitableGUI.Output("Error in command. Use what?");
                }
                else
                {
                    returnInstruction = currentRoom.Use(GetNextWord("USE", term));
                }
            }
            else if (term.Contains("LOAD") && !(term.Contains("CHEATLOAD")))
            {
                if (GetNextWord("LOAD", term) == null)
                {
                    InevitableGUI.Output("Error in command. Which file do you want to load?");
                }
                else
                {
                    returnInstruction = LoadSavedGame(GetNextWord("LOAD", term));
                }
            }

            #region cheats
            else if (term.Contains("CHEATLOAD"))         //loads the map
            {
                returnInstruction = new Instruction(InstructionType.LOAD, GetNextWord("CHEATLOAD", term.ToLower()));
            }
            else if (term.Contains("CHEATADD"))         //adds something to the inventory
            {
                Inventory.InventoryHandling.AddItem(new InventoryItem(GetNextWord("CHEATADD", term)));
            }
            else if (term.Contains("IDONTWANTTODIE"))         //adds a GOODFC
            {
                InventoryHandling.AddGODFC();
            }


            #endregion

            #endregion

            #region 2

            else if (term.Contains("USE") && term.Contains("WITH"))
            {
                if (GetNextWord("USE", term) == null)
                {
                    InevitableGUI.Output("Error in command. Use what?");
                }
                else
                {
                    if (GetNextWord("WITH", term) == null)
                    {
                        InevitableGUI.Output("Error in command. What do you want to use it with?");
                    }
                    else
                    {
                        string[] items = new string[] { GetNextWord("USE", term), GetNextWord("WITH", term) };

                        returnInstruction = currentRoom.Use(items);
                    }
                }
            }


            #endregion

            else
            {
                List <string> bogusReplies = new List <string>();
                bogusReplies.Add("Unknown Command");
                bogusReplies.Add("Pardon?");
                bogusReplies.Add("Come again?");
                bogusReplies.Add("I don't know how to do that");
                bogusReplies.Add("Command not understood");
                bogusReplies.Add("Uh what?");
                bogusReplies.Add("No idea what you want");
                bogusReplies.Add("What do you want?");

                InevitableGUI.Output(PickReplyFromList(bogusReplies));
            }

            #region Instruction Handling

            if (returnInstruction == null)
            {
                return;
            }

            if (returnInstruction.inst == InstructionType.LOAD)
            {
                try
                {
                    currentRoom       = rooms[returnInstruction.detail];
                    returnInstruction = currentRoom.Introduction(); //change return instruction
                }
                catch (Exception ex)
                {
                    InevitableGUI.Output("Something went wrong when loading the next room : " + ex.Message);
                }
            }
            if (returnInstruction.inst == InstructionType.WIN)
            {
                InevitableGUI.Output("------END OF ADVENTURE------");
                TimeSpan span = DateTime.Now - startTime;

                InevitableGUI.Output("It has taken you : " + span.TotalSeconds + " to finish this adventure!");

                hasWon = true;
            }
            if (returnInstruction.inst == InstructionType.DEATH)
            {
                try
                {
                    //Can he be saved?
                    if (InventoryHandling.ConsumeGOODFC())
                    {
                        InevitableGUI.Output("One of your Get Out Of Death Free cards disappears in a powerful light. You don't feel so dead anymore. Weird.");
                    }
                    else
                    {
                        //take it to the other place
                        currentRoom = rooms["otherside"];
                        currentRoom.Introduction();

                        //Rather dirty - but assign the cause of death
                        IEndRoom endRoom = (IEndRoom)currentRoom;
                        endRoom.SetCauseOfDeath(returnInstruction.detail);
                    }
                }
                catch (Exception ex)
                {
                    InevitableGUI.Output("Something went wrong when loading your death :( Sorry. Exception was : " + ex.Message + " Please tell me");
                }
            }
            if (returnInstruction.inst == InstructionType.SAVE)
            {
                //save the game
                InevitableGUI.Output("Your game has been saved. To be able to continue, use LOAD " + Save(Convert.ToInt32(returnInstruction.detail)));
            }

            #endregion
        }
Exemplo n.º 14
0
    public void ShowGUI()
    {
        EditorGUILayout.LabelField("Runtime resources", EditorStyles.boldLabel);
        player = (Player)EditorGUILayout.ObjectField("Player:", player, typeof(Player), false);

        EditorGUILayout.Space();

        EditorGUILayout.LabelField("Control settings", EditorStyles.boldLabel);

        controlStyle = (ControlStyle)EditorGUILayout.EnumPopup("Control style:", controlStyle);
        inputType    = (InputType)EditorGUILayout.EnumPopup("Input type:", inputType);

        if (inputType == InputType.TouchScreen)
        {
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Touch-screen settings", EditorStyles.boldLabel);

            dragWalkThreshold = EditorGUILayout.FloatField("Walk threshold:", dragWalkThreshold);
            dragRunThreshold  = EditorGUILayout.FloatField("Run threshold:", dragRunThreshold);

            if (controlStyle == ControlStyle.FirstPerson)
            {
                freeAimTouchSpeed = EditorGUILayout.FloatField("Freelook speed:", freeAimTouchSpeed);
            }

            if (controlStyle != ControlStyle.PointAndClick)
            {
                drawDragLine  = EditorGUILayout.BeginToggleGroup("Draw drag line?", drawDragLine);
                dragLineWidth = EditorGUILayout.FloatField("Drag line width:", dragLineWidth);
                dragLineColor = EditorGUILayout.ColorField("Drag line colour:", dragLineColor);
                EditorGUILayout.EndToggleGroup();
            }
        }

        EditorGUILayout.Space();

        EditorGUILayout.LabelField("Interface settings", EditorStyles.boldLabel);

        alwaysOnInventory = EditorGUILayout.Toggle("Always show inventory?", alwaysOnInventory);

        EditorGUILayout.Space();

        EditorGUILayout.LabelField("Raycast settings", EditorStyles.boldLabel);

        navMeshRaycastLength = EditorGUILayout.FloatField("NavMesh ray length:", navMeshRaycastLength);
        hotspotRaycastLength = EditorGUILayout.FloatField("Hotspot ray length:", hotspotRaycastLength);

        EditorGUILayout.Space();

        EditorGUILayout.LabelField("Speech settings", EditorStyles.boldLabel);

        textScrollSpeed     = EditorGUILayout.FloatField("Text scroll speed:", textScrollSpeed);
        screenTimeFactor    = EditorGUILayout.FloatField("Display factor:", screenTimeFactor);
        allowSpeechSkipping = EditorGUILayout.Toggle("Allow speech skipping?", allowSpeechSkipping);
        forceSubtitles      = EditorGUILayout.Toggle("Force subtitles if no audio?", forceSubtitles);
        searchAudioFiles    = EditorGUILayout.Toggle("Auto-play audio files?", searchAudioFiles);
        translateAudio      = EditorGUILayout.Toggle("Audio translations?", translateAudio);

        EditorGUILayout.Space();

        EditorGUILayout.LabelField("Cursor settings", EditorStyles.boldLabel);

        EditorGUILayout.BeginVertical("Button");
        allowMainCursor = EditorGUILayout.Toggle("Replace mouse cursor?", allowMainCursor);
        if (allowMainCursor || inputType == InputType.Controller)
        {
            pointerTexture   = (Texture2D)EditorGUILayout.ObjectField("Main cursor texture:", pointerTexture, typeof(Texture2D), false);
            normalCursorSize = EditorGUILayout.FloatField("Main cursor size:", normalCursorSize);
        }
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical("Button");
        inventoryHandling = (InventoryHandling)EditorGUILayout.EnumPopup("When inventory selected:", inventoryHandling);
        if (inventoryHandling == InventoryHandling.ChangeCursor || inventoryHandling == InventoryHandling.ChangeCursorAndHotspotLabel)
        {
            inventoryCursorSize = EditorGUILayout.FloatField("Inventory cursor size:", inventoryCursorSize);
        }
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical("Button");
        allowInteractionCursor = EditorGUILayout.Toggle("Change for interactions?", allowInteractionCursor);
        if (allowInteractionCursor)
        {
            iconCursorSize = EditorGUILayout.FloatField("Interaction cursor size:", iconCursorSize);
            useTexture     = (Texture2D)EditorGUILayout.ObjectField("Use icon texture:", useTexture, typeof(Texture2D), false);
            lookTexture    = (Texture2D)EditorGUILayout.ObjectField("Look icon texture:", lookTexture, typeof(Texture2D), false);
            talkTexture    = (Texture2D)EditorGUILayout.ObjectField("Talk icon texture:", talkTexture, typeof(Texture2D), false);
        }
        EditorGUILayout.EndVertical();

        EditorGUILayout.Space();

        if (GUILayout.Button("Clear options cache"))
        {
            PlayerPrefs.DeleteKey("Options");
            Debug.Log("PlayerPrefs cleared");
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(this);
        }
    }
        /**
         * Shows the GUI.
         */
        public void ShowGUI()
        {
            settingsManager = AdvGame.GetReferences().settingsManager;

            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showSettings = CustomGUILayout.ToggleHeader(showSettings, "Global cursor settings");
            if (showSettings)
            {
                cursorRendering = (CursorRendering)CustomGUILayout.EnumPopup("Cursor rendering:", cursorRendering, "AC.KickStarter.cursorManager.cursorRendering", "The rendering method of all cursors");
                if (cursorRendering == CursorRendering.Software)
                {
                    lockSystemCursor = CustomGUILayout.ToggleLeft("Lock system cursor when locking AC cursor?", lockSystemCursor, "AC.KickStarter.cursorManager.lockSystemCursor", "If True, the system cursor will be locked when the AC cursor is");
                }
                forceCursorInEditor = CustomGUILayout.ToggleLeft("Always show system cursor in Editor?", forceCursorInEditor, "AC.KickStarter.cursorManager.forceCursorInEditor");

                if (cursorRendering == CursorRendering.Software)
                {
                    keepCursorWithinScreen = CustomGUILayout.ToggleLeft("Always keep cursor within screen boundary?", keepCursorWithinScreen, "AC.KickStarter.cursorManager.keepCursorWithinScreen", "If True, then the cursor will always be kept within the boundary of the game window");
                }
                else
                {
                    keepCursorWithinScreen = CustomGUILayout.ToggleLeft("Always keep perceived cursor within screen boundary?", keepCursorWithinScreen, "AC.KickStarter.cursorManager.keepCursorWithinScreen", "If True, then the cursor will always be kept within the boundary of the game window");
                }

                                #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
                confineSystemCursor = CustomGUILayout.ToggleLeft("Confine system cursor to game window?", confineSystemCursor, "AC.KickStarter.cursorManager.confineSystemCursor", "If True, then the system cursor will be confined to the game window");
                                #endif
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showMainCursor = CustomGUILayout.ToggleHeader(showMainCursor, "Main cursor settings");
            if (showMainCursor)
            {
                cursorDisplay = (CursorDisplay)CustomGUILayout.EnumPopup("Display cursor:", cursorDisplay, "AC.KickStarter.cursorManager.cursorDisplay", "The rule that defines when the main cursor is shown");
                if (cursorDisplay != CursorDisplay.Never)
                {
                    allowMainCursor = CustomGUILayout.Toggle("Replace mouse cursor?", allowMainCursor, "AC.KickStarter.cursorManager.allowMainCursor", "If True, then the system's default hardware cursor will replaced with a custom one");
                    if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController))
                    {
                        IconBaseGUI("", pointerIcon, "AC.KickStarter.cursorManager.pointerIcon", "The game's default cursor", false);
                    }
                }
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showWalkCursor = CustomGUILayout.ToggleHeader(showWalkCursor, "Walk cursor");
            if (showWalkCursor)
            {
                if (allowMainCursor)
                {
                    allowWalkCursor = CustomGUILayout.Toggle("Provide walk cursor?", allowWalkCursor, "AC.KickStarter.cursorManager.allowWalkCursor", "If True, then a separate cursor will display when in 'walk mode'");
                    if (allowWalkCursor)
                    {
                        if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot && allowIconInput)
                        {
                            EditorGUILayout.LabelField("Input button:", "Icon_Walk");
                        }
                        IconBaseGUI("", walkIcon, "AC.KickStarter.cursorManager.walkIcon", "The cursor when in 'walk mode'");
                        onlyWalkWhenOverNavMesh = CustomGUILayout.ToggleLeft("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh, "AC.KickStarter.cursorManager.onlyWalkWhenOverNavMesh", "If True, then the walk cursor will only show when the cursor is hovering over a NavMesh");
                    }
                }
                addWalkPrefix = CustomGUILayout.Toggle("Prefix cursor labels?", addWalkPrefix, "AC.KickStarter.cursorManager.addWalkPrefix", "If True, then a prefix can be added to the Hotspot label when in 'walk mode'");
                if (addWalkPrefix)
                {
                    walkPrefix.label = CustomGUILayout.TextField("Walk prefix:", walkPrefix.label, "AC.KickStarter.cursorManager.walkPrefix");
                }
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showHotspotCursor = CustomGUILayout.ToggleHeader(showHotspotCursor, "Hotspot cursor");
            if (showHotspotCursor)
            {
                addHotspotPrefix = CustomGUILayout.Toggle("Prefix cursor labels?", addHotspotPrefix, "AC.KickStarter.cursorManager.addHotspotPrefix", "If True, then the Cursor's interaction verb will prefix the Hotspot label when hovering over Hotspots");
                IconBaseGUI("", mouseOverIcon, "AC.KickStarter.cursorManager.mouseOverIcon");
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showInventoryCursor = CustomGUILayout.ToggleHeader(showInventoryCursor, "Inventory cursor");
            if (showInventoryCursor)
            {
                inventoryHandling = (InventoryHandling)CustomGUILayout.EnumPopup("When inventory selected:", inventoryHandling, "AC.KickStarter.cursorManager.inventoryHandling", "What happens to the cursor when an inventory item is selected");
                if (inventoryHandling != InventoryHandling.ChangeCursor)
                {
                    onlyShowInventoryLabelOverHotspots = CustomGUILayout.ToggleLeft("Only show label when over Hotspots and Inventory?", onlyShowInventoryLabelOverHotspots, "AC.KickStarter.cursorManager.onlyShowInventoryLabelOverHotspots", "If True, then Hotspot labels will not show when an inventory item is selected unless the cursor is over another inventory item or a Hotspot");
                }
                if (inventoryHandling != InventoryHandling.ChangeHotspotLabel)
                {
                    inventoryCursorSize = CustomGUILayout.FloatField("Inventory cursor size:", inventoryCursorSize, "AC.KickStarter.cursorManager.inventoryCursorSize", "The size of selected inventory item graphics when used as a cursor");
                }
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Use syntax:", GUILayout.Width(100f));
                hotspotPrefix1.label = CustomGUILayout.TextField(hotspotPrefix1.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix1");
                EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                hotspotPrefix2.label = CustomGUILayout.TextField(hotspotPrefix2.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix2");
                EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                EditorGUILayout.EndHorizontal();
                if (AdvGame.GetReferences().settingsManager&& AdvGame.GetReferences().settingsManager.CanGiveItems())
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("Give syntax:", GUILayout.Width(100f));
                    hotspotPrefix3.label = CustomGUILayout.TextField(hotspotPrefix3.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix3");
                    EditorGUILayout.LabelField("(item)", GUILayout.MaxWidth(40f));
                    hotspotPrefix4.label = CustomGUILayout.TextField(hotspotPrefix4.label, GUILayout.MaxWidth(80f), "AC.KickStarter.cursorManager.hotspotPrefix4");
                    EditorGUILayout.LabelField("(hotspot)", GUILayout.MaxWidth(55f));
                    EditorGUILayout.EndHorizontal();
                }
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showInteractionIcons = CustomGUILayout.ToggleHeader(showInteractionIcons, "Interaction icons");
            if (showInteractionIcons)
            {
                if (settingsManager == null || settingsManager.interactionMethod != AC_InteractionMethod.ChooseHotspotThenInteraction)
                {
                    allowInteractionCursor = CustomGUILayout.ToggleLeft("Change cursor based on Interaction?", allowInteractionCursor, "AC.KickStarter.cursorManager.allowInteractionCursor", "If True, then the cursor will be controlled by the current Interaction when hovering over a Hotspot");
                    if (allowInteractionCursor && (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive))
                    {
                        allowInteractionCursorForInventory = CustomGUILayout.ToggleLeft("Change when over Inventory items too?", allowInteractionCursorForInventory, "AC.KickStarter.cursorManager.allowInteractionCursorForInventory", "If True, then the cursor will be controlled by the current Interaction when hovering over an inventory item (see InvItem)");
                    }
                    if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
                    {
                        cycleCursors            = CustomGUILayout.ToggleLeft("Cycle Interactions with right-click?", cycleCursors, "AC.KickStarter.cursorManager.cycleCursors", "If True, then cursor modes can by clicked by right-clicking");
                        allowIconInput          = CustomGUILayout.ToggleLeft("Set Interaction with specific inputs?", allowIconInput, "AC.KickStarter.cursorManager.allowIconInput", "then the player can switch the active icon by invoking a specific input");
                        onlyAnimateOverHotspots = CustomGUILayout.ToggleLeft("Only animate icons when over Hotspots?", onlyAnimateOverHotspots, "AC.KickStarter.cursorManager.onlyAnimateOverHotspots", "If True, then animated cursors will only animate if the cursor is over a Hotspot");
                    }
                }

                IconsGUI();

                EditorGUILayout.Space();

                if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
                {
                    LookIconGUI();
                }
            }
            EditorGUILayout.EndVertical();

            EditorGUILayout.Space();
            EditorGUILayout.BeginVertical(CustomStyles.thinBox);
            showCutsceneCursor = CustomGUILayout.ToggleHeader(showCutsceneCursor, "Cutscene cursor");
            if (showCutsceneCursor)
            {
                IconBaseGUI("", waitIcon, "AC.KickStarter.cursorManager.waitIcon", "The cursor while the game is running a gameplay-blocking cutscene");
            }
            EditorGUILayout.EndVertical();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(this);
            }
        }
Exemplo n.º 16
0
		public void ShowGUI ()
		{
			settingsManager = AdvGame.GetReferences().settingsManager;

			cursorRendering = (CursorRendering) EditorGUILayout.EnumPopup ("Cursor rendering:", cursorRendering);
			EditorGUILayout.Space ();
			
			EditorGUILayout.BeginVertical ("Button");
				EditorGUILayout.LabelField ("Main cursor", EditorStyles.boldLabel);
				cursorDisplay = (CursorDisplay) EditorGUILayout.EnumPopup ("Display cursor:", cursorDisplay);
				allowMainCursor = EditorGUILayout.Toggle ("Replace mouse cursor?", allowMainCursor);
				if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController))
				{
					IconBaseGUI ("Main cursor:", pointerIcon);
					IconBaseGUI ("Walk cursor (optional):", walkIcon);
					onlyWalkWhenOverNavMesh = EditorGUILayout.ToggleLeft ("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh);
				}
			EditorGUILayout.EndVertical ();
			
			EditorGUILayout.Space ();

			EditorGUILayout.BeginVertical ("Button");
				EditorGUILayout.LabelField ("Hotspot settings", EditorStyles.boldLabel);
				addHotspotPrefix = EditorGUILayout.Toggle ("Prefix cursor labels?", addHotspotPrefix);
				IconBaseGUI ("Mouse-over cursor:", mouseOverIcon);
			EditorGUILayout.EndVertical ();

			EditorGUILayout.Space ();
			
			EditorGUILayout.BeginVertical ("Button");
				EditorGUILayout.LabelField ("Inventory cursor", EditorStyles.boldLabel);
				if ((settingsManager && settingsManager.interactionMethod != AC_InteractionMethod.ChooseHotspotThenInteraction) ||
			    (settingsManager && settingsManager.SelectInteractionMethod () == SelectInteractions.CyclingCursorAndClickingHotspot))
				{
					inventoryHandling = (InventoryHandling) EditorGUILayout.EnumPopup ("When inventory selected:", inventoryHandling);
					if (inventoryHandling == InventoryHandling.ChangeCursor || inventoryHandling == InventoryHandling.ChangeCursorAndHotspotLabel)
					{
						inventoryCursorSize = EditorGUILayout.FloatField ("Inventory cursor size:", inventoryCursorSize);
					}
				}
				EditorGUILayout.BeginHorizontal ();
					EditorGUILayout.LabelField ("Syntax:", GUILayout.Width (60f));
					hotspotPrefix1.label = EditorGUILayout.TextField (hotspotPrefix1.label, GUILayout.MaxWidth (80f));
					EditorGUILayout.LabelField ("(item)", GUILayout.MaxWidth (40f));

					hotspotPrefix2.label = EditorGUILayout.TextField (hotspotPrefix2.label, GUILayout.MaxWidth (80f));
					EditorGUILayout.LabelField ("(hotspot)", GUILayout.MaxWidth (55f));
				EditorGUILayout.EndHorizontal ();
			EditorGUILayout.EndVertical ();
			
			EditorGUILayout.Space ();
			
			EditorGUILayout.BeginVertical ("Button");
				EditorGUILayout.LabelField ("Interaction icons", EditorStyles.boldLabel);
				
				if (settingsManager == null || settingsManager.interactionMethod != AC_InteractionMethod.ChooseHotspotThenInteraction)
				{
					allowInteractionCursor = EditorGUILayout.BeginToggleGroup ("Change cursor when over Hotspots?", allowInteractionCursor);
						if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
						{
							cycleCursors = EditorGUILayout.Toggle ("Cycle with right click?", cycleCursors);
						}
						if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
						{
							allowInteractionCursorForInventory = EditorGUILayout.Toggle ("Change for inventory too?", allowInteractionCursorForInventory);
						}
					EditorGUILayout.EndToggleGroup ();
				}
				
				IconsGUI ();
			
				EditorGUILayout.Space ();
			
				if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
				{
					LookIconGUI ();
				}
			EditorGUILayout.EndVertical ();

			EditorGUILayout.Space ();

			EditorGUILayout.BeginVertical ("Button");
				IconBaseGUI ("Wait cursor", waitIcon);
			EditorGUILayout.EndVertical ();

			if (GUI.changed)
			{
				EditorUtility.SetDirty (this);
			}
		}
Exemplo n.º 17
0
        /**
         * Shows the GUI.
         */
        public void ShowGUI()
        {
            settingsManager = AdvGame.GetReferences().settingsManager;

            cursorRendering = (CursorRendering) EditorGUILayout.EnumPopup ("Cursor rendering:", cursorRendering);
            EditorGUILayout.Space ();

            EditorGUILayout.BeginVertical ("Button");
            EditorGUILayout.LabelField ("Main cursor", EditorStyles.boldLabel);
            cursorDisplay = (CursorDisplay) EditorGUILayout.EnumPopup ("Display cursor:", cursorDisplay);
            if (cursorDisplay != CursorDisplay.Never)
            {
                allowMainCursor = EditorGUILayout.Toggle ("Replace mouse cursor?", allowMainCursor);
                if (allowMainCursor || (settingsManager && settingsManager.inputMethod == InputMethod.KeyboardOrController))
                {
                    IconBaseGUI ("Main cursor:", pointerIcon);
                }
            }
            EditorGUILayout.EndVertical ();

            EditorGUILayout.Space ();

            EditorGUILayout.BeginVertical ("Button");
            EditorGUILayout.LabelField ("Walk settings", EditorStyles.boldLabel);
            if (allowMainCursor)
            {
                allowWalkCursor = EditorGUILayout.Toggle ("Provide walk cursor?", allowWalkCursor);
                if (allowWalkCursor)
                {
                    if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
                    {
                        EditorGUILayout.LabelField ("Input button:", "Icon_Walk");
                    }
                    IconBaseGUI ("Walk cursor:", walkIcon);
                    onlyWalkWhenOverNavMesh = EditorGUILayout.ToggleLeft ("Only show 'Walk' Cursor when over NavMesh?", onlyWalkWhenOverNavMesh);
                }
            }
            addWalkPrefix = EditorGUILayout.Toggle ("Prefix cursor labels?", addWalkPrefix);
            if (addWalkPrefix)
            {
                walkPrefix.label = EditorGUILayout.TextField ("Walk prefix:", walkPrefix.label);
            }
            EditorGUILayout.EndVertical ();

            EditorGUILayout.Space ();

            EditorGUILayout.BeginVertical ("Button");
                EditorGUILayout.LabelField ("Hotspot settings", EditorStyles.boldLabel);
                addHotspotPrefix = EditorGUILayout.Toggle ("Prefix cursor labels?", addHotspotPrefix);
                IconBaseGUI ("Mouse-over cursor:", mouseOverIcon);
            EditorGUILayout.EndVertical ();

            EditorGUILayout.Space ();

            EditorGUILayout.BeginVertical ("Button");
                EditorGUILayout.LabelField ("Inventory cursor", EditorStyles.boldLabel);
                inventoryHandling = (InventoryHandling) EditorGUILayout.EnumPopup ("When inventory selected:", inventoryHandling);
                if (inventoryHandling != InventoryHandling.ChangeCursor)
                {
                    onlyShowInventoryLabelOverHotspots = EditorGUILayout.ToggleLeft ("Only show label when over Hotspots and Inventory?", onlyShowInventoryLabelOverHotspots);
                }
                if (inventoryHandling != InventoryHandling.ChangeHotspotLabel)
                {
                    inventoryCursorSize = EditorGUILayout.FloatField ("Inventory cursor size:", inventoryCursorSize);
                }
                EditorGUILayout.BeginHorizontal ();
                    EditorGUILayout.LabelField ("Use syntax:", GUILayout.Width (100f));
                    hotspotPrefix1.label = EditorGUILayout.TextField (hotspotPrefix1.label, GUILayout.MaxWidth (80f));
                    EditorGUILayout.LabelField ("(item)", GUILayout.MaxWidth (40f));
                    hotspotPrefix2.label = EditorGUILayout.TextField (hotspotPrefix2.label, GUILayout.MaxWidth (80f));
                    EditorGUILayout.LabelField ("(hotspot)", GUILayout.MaxWidth (55f));
                EditorGUILayout.EndHorizontal ();
                if (AdvGame.GetReferences ().settingsManager && AdvGame.GetReferences ().settingsManager.CanGiveItems ())
                {
                    EditorGUILayout.BeginHorizontal ();
                        EditorGUILayout.LabelField ("Give syntax:", GUILayout.Width (100f));
                        hotspotPrefix3.label = EditorGUILayout.TextField (hotspotPrefix3.label, GUILayout.MaxWidth (80f));
                        EditorGUILayout.LabelField ("(item)", GUILayout.MaxWidth (40f));
                        hotspotPrefix4.label = EditorGUILayout.TextField (hotspotPrefix4.label, GUILayout.MaxWidth (80f));
                        EditorGUILayout.LabelField ("(hotspot)", GUILayout.MaxWidth (55f));
                    EditorGUILayout.EndHorizontal ();
                }
            EditorGUILayout.EndVertical ();

            EditorGUILayout.Space ();

            EditorGUILayout.BeginVertical ("Button");
                EditorGUILayout.LabelField ("Interaction icons", EditorStyles.boldLabel);

                if (settingsManager == null || settingsManager.interactionMethod != AC_InteractionMethod.ChooseHotspotThenInteraction)
                {
                    allowInteractionCursor = EditorGUILayout.ToggleLeft ("Change cursor based on Interaction?", allowInteractionCursor);
                    if (allowInteractionCursor && (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive))
                    {
                        allowInteractionCursorForInventory = EditorGUILayout.ToggleLeft ("Change when over Inventory items too?", allowInteractionCursorForInventory);
                    }
                    if (settingsManager && settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
                    {
                        cycleCursors = EditorGUILayout.ToggleLeft ("Cycle Interactions with right-click?", cycleCursors);
                    }
                }

                IconsGUI ();

                EditorGUILayout.Space ();

                if (settingsManager == null || settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
                {
                    LookIconGUI ();
                }
            EditorGUILayout.EndVertical ();

            EditorGUILayout.Space ();

            EditorGUILayout.BeginVertical ("Button");
                IconBaseGUI ("Wait cursor", waitIcon);
            EditorGUILayout.EndVertical ();

            if (GUI.changed)
            {
                EditorUtility.SetDirty (this);
            }
        }