private bool game_menu_steal_wait_on_condition(MenuCallbackArgs args) { args.MenuContext.GameMenu.AllowWaitingAutomatically(); GoalStealTime = CampaignTime.HoursFromNow(KleptomaniaSubModule.settings.HoursWaitingToSteal); //Goal time is 4 hours wait by default return(true); }
public override void StartEvent() { if (Settings.GeneralSettings.DebugMode) { InformationManager.DisplayMessage(new InformationMessage($"Starting {this.RandomEventData.EventType}", RandomEventsSubmodule.textColor)); } List <InquiryElement> inquiryElements = new List <InquiryElement>(); inquiryElements.Add(new InquiryElement("a", "Order the men to gather some food.", null)); inquiryElements.Add(new InquiryElement("b", "There's no time.", null)); MultiSelectionInquiryData msid = new MultiSelectionInquiryData( eventTitle, // Title "While traveling you come across a large meadow with grazing deer surrounded by grape vines. If you have some spare time, perhaps you could collect some food.", // Description inquiryElements, // Options false, // Can close menu without selecting an option. Should always be false. 1, // Force a single option to be selected. Should usually be true "Okay", // The text on the button that continues the event null, // The text to display on the "cancel" button, shouldn't ever need it. (elements) => // How to handle the selected option. Will only ever be a single element unless force single option is off. { if ((string)elements[0].Identifier == "a") { Campaign.Current.TimeControlMode = CampaignTimeControlMode.UnstoppableFastForwardForPartyWaitTime; MobileParty.MainParty.IsActive = false; waitPos = MobileParty.MainParty.Position2D; //hourlyTickEvent = CampaignEvents.CreatePeriodicEvent(1f, 0f); hourlyTickEvent = CampaignEvents.CreatePeriodicEvent(CampaignTime.HoursFromNow(1f), CampaignTime.Zero); hourlyTickEvent.AddHandler(new MBCampaignEvent.CampaignEventDelegate(HourlyTick)); } else if ((string)elements[0].Identifier == "b") { StopEvent(); } else { MessageBox.Show($"Error while selecting option for \"{this.RandomEventData.EventType}\""); } }, null); // What to do on the "cancel" button, shouldn't ever need it. InformationManager.ShowMultiSelectionInquiry(msid, true); }