private void DoExplore() { currentDisplay.ClearOutput(); if (!anyLocationsUnlocked) { Exploration.RunArea(currentDisplay); } else { //append the explore text to the current display. AddReturnButtonToDisplay(); //add the return button. ButtonListMaker listMaker = new ButtonListMaker(currentDisplay); listMaker.AddButtonToList(ExploreString(), true, () => Exploration.RunArea(currentDisplay)); foreach (var item in GameEngine.GetUnlockedLocations()) { listMaker.AddButtonToList(item.Value, true, () => GameEngine.GoToAreaAndRun(item.Key)); } listMaker.CreateButtons(true); //create the list of buttons, with a reserved final button as given. } }
private void PutBack() { buttonMaker = null; display = null; source = null; itemCallback(false, PutBackItemText(), Author(), this); itemCallback = null; }
protected override DisplayBase BuildMenu(Creature target, UseItemCallback postItemUseCallback) { listOfDyeableParts = target.bodyParts.Where(x => x is IDyeable || x is IMultiDyeable); display = new StandardDisplay(); //set the globals. buttonMaker = new ButtonListMaker(display); itemCallback = postItemUseCallback; source = target; RunMainMenu(); return(display); }
private void DoPlaceMenu() { currentDisplay.ClearOutput(); //append the places text to the current display. AddReturnButtonToDisplay(); //add the return button. ButtonListMaker listMaker = new ButtonListMaker(currentDisplay); foreach (var item in GameEngine.GetUnlockedPlaces()) { listMaker.AddButtonToList(item.Value, true, () => GameEngine.GoToAreaAndRun(item.Key)); } listMaker.CreateButtons(true); //create the list of buttons, with a reserved final button as given. }
private void DoLoversMenu() { currentDisplay.ClearOutput(); //display generic lovers text. AddReturnButtonToDisplay(); //add the return button. var maker = new ButtonListMaker(currentDisplay); foreach (var lover in lovers) { maker.AddButtonToList(lover.Name(), true, lover.OnSelect); } maker.CreateButtons(true); }
private void DoSlavesMenu() { currentDisplay.ClearOutput(); //display generic slaves text. AddReturnButtonToDisplay(); //add the return button. var maker = new ButtonListMaker(currentDisplay); foreach (var slave in slaves) { maker.AddButtonToList(slave.Name(), true, slave.OnSelect); } maker.CreateButtons(false); }
protected override DisplayBase BuildMenu(Creature consumer, UseItemCallback postItemUseCallback) { validMembers = consumer.bodyParts.Where(x => x is ILotionable || x is IMultiLotionable).ToList(); display = new StandardDisplay(); listMaker = new ButtonListMaker(display); if (validMembers.Count == 0) { LotionCancel(consumer, postItemUseCallback); return(null); } if (validMembers.Count == 1 && validMembers[0] is ILotionable lotionable) { DoLotion(consumer, lotionable, postItemUseCallback); } return(StandardMenu(consumer, postItemUseCallback)); }
protected override DisplayBase BuildMenu(Creature consumer, UseItemCallback postItemUseCallback) { var display = new StandardDisplay(); display.OutputText("You ponder the needle in your hand knowing it will enlarge the injection site. What part of your body will you use it on? "); var listMaker = new ButtonListMaker(display); foreach (var bodyPart in consumer.bodyParts) { if (bodyPart is IGrowable growable) { listMaker.AddButtonToList(bodyPart.BodyPartName(), growable.CanGroPlus(), () => ApplyGrowPlus(consumer, growable, postItemUseCallback)); } } return(display); }
private void CleanupAndReturn(string result) { if (source.relativeLust > 50) { result += LessLustyText(); source.DecreaseLust(15); } //clear the globals. source = null; buttonMaker = null; display = null; UseItemCallback temp = itemCallback; itemCallback = null; //and resume normal execution. temp(true, result, Author(), null); }
private void CleanupItems() { display = null; listMaker = null; validMembers = null; }