Ejemplo n.º 1
0
        private StandardDisplay StandardMenu(Creature consumer, UseItemCallback postItemUseCallback)
        {
            if (validMembers.Count == 1)
            {
                return(DoMultiLotionMenu(consumer, (IMultiLotionable)validMembers[0], postItemUseCallback));
            }

            display.ClearOutput();
            listMaker.ClearList();

            display.OutputText("Where do you want to apply the " + targetTexture.AsString() + " body lotion?");

            foreach (IBodyPart part in consumer.bodyParts)
            {
                if (part is ILotionable lotionable)
                {
                    listMaker.AddButtonToList(part.BodyPartName(), lotionable.CanLotion(), () => DoLotion(consumer, lotionable, postItemUseCallback));
                }
                else if (part is IMultiLotionable multiLotionable)
                {
                    listMaker.AddButtonToList(multiLotionable.ButtonText() + "...", multiLotionable.numLotionableMembers > 0, () => DoMultiLotionMenu(consumer, multiLotionable, postItemUseCallback));
                }
            }
            listMaker.CreateButtons(GlobalStrings.CANCEL(), true, () => LotionCancel(consumer, postItemUseCallback));

            return(display);
        }
Ejemplo n.º 2
0
        private void RunMainMenu()
        {
            display.ClearOutput();

            display.OutputText("Where do you want to apply the " + color.AsString() + " hair dye?");

            foreach (IBodyPart item in listOfDyeableParts)
            {
                if (item is IMultiDyeable multiDyeable)
                {
                    bool   active = Enumerable.Range(0, multiDyeable.numDyeableMembers).Select(x => multiDyeable.isDifferentColor(color, (byte)x)).Any(x => x);
                    string tip    = active ? "Dye part of your " + item.BodyPartName() + ". This will bring up more options." : "Your " + item.BodyPartName() + "cannot be dyed or is already the same color";
                    buttonMaker.AddButtonToList(multiDyeable.buttonText() + "...", active, () => DoSubMenu(multiDyeable));
                }
                else if (item is IDyeable dyeable)
                {
                    string tip;
                    string location = dyeable.locationDesc(out bool plural);

                    if (!dyeable.allowsDye())
                    {
                        tip = location.CapitalizeFirstLetter() + " cannot currently be dyed.";
                    }
                    else if (!dyeable.isDifferentColor(color))
                    {
                        tip = location.CapitalizeFirstLetter() + (plural ? " are" : " is") + " already " + color.AsString() + ".";
                    }
                    else
                    {
                        tip = null;
                    }

                    buttonMaker.AddButtonToList(dyeable.buttonText(), dyeable.allowsDye() && dyeable.isDifferentColor(color), () => ApplyDye(dyeable), tip, null);
                }
            }

            buttonMaker.CreateButtons(GlobalStrings.CANCEL(), true, PutBack);
        }
Ejemplo n.º 3
0
        public static void NewGame()
        {
            //clear all the extraneous data stored in the various engines in the backend.
            GameEngine.StartNewGame();

            GameEngine.UnlockAchievement <Achievements.StartTheGameINeedAnAchievementForDebugging>();

            SetPlayerStatus(PlayerStatus.IDLE);
            HideMenu();
            HideStats();

            if (currentDisplay is null)
            {
                currentDisplay = new StandardDisplay();
            }
            DisplayManager.LoadDisplay(currentDisplay);

            currentDisplay.ClearOutput();
            currentDisplay.OutputText(NewGameHelperText.IntroText());
            currentDisplay.ActivateInputField();
            currentDisplay.ActivateDropDownMenu(SpecialCharacters.SpecialCharacterDropDownList(currentDisplay));
            currentDisplay.AddButton(0, GlobalStrings.OK(), ChooseName);
        }
Ejemplo n.º 4
0
 private void DoButton(byte index, string content, Action callback)
 {
     display.AddButton(index, content, () => { display.ClearOutput(); callback(); });
 }