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); }
private StandardDisplay DoMultiLotionMenu(Creature consumer, IMultiLotionable multiLotionable, UseItemCallback postItemUseCallback) { bool canReturnToMenu = display != null; display.ClearOutput(); listMaker.ClearList(); display.OutputText(multiLotionable.LocationDesc() + " has several possible locations or combinations of locations. Where on " + multiLotionable.LocationDesc() + " would you like to apply the " + targetTexture.AsString() + " body lotion?" + Environment.NewLine + "You can also go back to the main menu by hitting back."); for (byte x = 0; x < multiLotionable.numLotionableMembers; x++) { listMaker.AddButtonToList(multiLotionable.MemberButtonText(x), multiLotionable.CanLotion(x), () => DoLotion(consumer, multiLotionable, x, postItemUseCallback)); } listMaker.CreateButtons(new ButtonData(GlobalStrings.BACK(), true, () => StandardMenu(consumer, postItemUseCallback)), new ButtonData(GlobalStrings.CANCEL(), true, () => LotionCancel(consumer, postItemUseCallback))); return(display); }
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); }
//if (result) //{ // if (target is PlayerBase target) // { // target.refillHunger(sateHungerAmount); // } // item = null; //} //if (isBadEnd) //{ // throw new Tools.InDevelopmentExceptionThatBreaksOnRelease(); // //if we hit a bad end, don't resume whatever we were doing - we treat it as if it was a nightmare and nothing happened, except for the stuff that did happen, because continuity // //is hard to enforce in this shit. Just lampshade it - it was a nightmare, but you still suffer the effects of it as if it happened, but only up until the point you realized it // //was a bad end. so, you'll lose any items you were gonna get afterward, etc, but if your butt was stretched to gaping, it'll still be gaping after resuming from the bad end. // //same with piercings, tfs, etc. No time is lost, however, just resume from camp as soon as possible. // //example of lampshading: "it was just a nightmare... but it felt so real - and your eyebrow has a piercing in it, just like in the dream. strange..." // //GameEngine.DoBadEnd(); //} //else //{ // postItemUseCallback(result, consumeResults, item); //} //} #warning Implement IPatternable bs when you figure out how to do so and/or actually feel like it. private void DoSubMenu(IMultiDyeable multiDyeable) { display.OutputText(multiDyeable.LocationDesc() + " has several possible locations or combinations of locations. Where on " + multiDyeable.LocationDesc() + " would you like to apply the " + color.AsString() + " hair dye?" + Environment.NewLine + "You can also go back to the full menu by hitting back."); display.ClearOutput(); buttonMaker.ClearList(); for (byte x = 0; x < multiDyeable.numDyeableMembers; x++) { string tip; string location = multiDyeable.memberLocationDesc(x, out bool plural); if (!multiDyeable.allowsDye(x)) { tip = location.CapitalizeFirstLetter() + " cannot currently be dyed."; } else if (!multiDyeable.isDifferentColor(color, x)) { tip = location.CapitalizeFirstLetter() + (plural ? " are" : " is") + " already " + color.AsString() + "."; } else { tip = null; } buttonMaker.AddButtonToList(multiDyeable.memberButtonText(x), multiDyeable.allowsDye(x), () => ApplyDye(multiDyeable, x), tip, null); } buttonMaker.CreateButtons(new ButtonData(GlobalStrings.BACK(), true, RunMainMenu), new ButtonData(GlobalStrings.CANCEL(), true, PutBack)); }