/// <summary> /// Called when the attached screen is activated and needs a text prompt to be returned. /// </summary> public override void OnFormPostCreate() { // Initialize the game instance and marquee bar. base.OnFormPostCreate(); _marqueeBar = new MarqueeBar(); _swayBarText = _marqueeBar.Step(); // Mark the previous location as Departed as the party is now moving towards the next location. if ((GameCore.Instance.Trail.NextLocationDistance > 0) && (GameCore.Instance.Trail.CurrentLocation.Status == LocationStatus.Arrived)) { GameCore.Instance.Trail.CurrentLocation.Status = LocationStatus.Departed; } }
/// <summary> /// Initializes a new instance of the <see cref="CrossingTick" /> class. /// This constructor will be used by the other one /// </summary> /// <param name="window">The window.</param> public CrossingTick(IWindow window) : base(window) { // Create the string builder for holding all our text about river crossing as it happens. _crossingPrompt = new StringBuilder(); // Animated sway bar. _marqueeBar = new MarqueeBar(); _swayBarText = _marqueeBar.Step(); // Sets the crossing percentage to zero. _riverCrossingOfTotalWidth = 0; _finishedCrossingRiver = false; }
/// <summary> /// Fired after the state has been completely attached to the simulation letting the state know it can browse the user /// data and other properties below it. /// </summary> public override void OnFormPostCreate() { base.OnFormPostCreate(); // Get instance of game simulation for easy reading. var game = GameSimulationApp.Instance; // We don't create it in the constructor, will update with ticks. _drive = new StringBuilder(); // Animated sway bar. _marqueeBar = new MarqueeBar(); _swayBarText = _marqueeBar.Step(); // Vehicle has departed the current location for the next one but you can only depart once. if ((game.Trail.DistanceToNextLocation > 0) && (game.Trail.CurrentLocation.Status == LocationStatus.Arrived)) { game.Trail.CurrentLocation.Status = LocationStatus.Departed; } }
/// <summary> /// Called when the attached screen is activated and needs a text prompt to be returned. /// </summary> public override void OnFormPostCreate() { // Advance the progress bar, step it to next phase. base.OnFormPostCreate(); _marqueeBar = new MarqueeBar(); _swayBarText = _marqueeBar.Step(); // Park the vehicle if it's not already. GameCore.Instance.Vehicle.Status = VehicleStatus.Stopped; // Double check that the player can pay to cross the river, subtract the payment from the inventory. if (GameCore.Instance.Vehicle.Inventory[ItemTypes.Money].TotalValue > UserData.River.FerryCost && UserData.River.FerryCost > 0) { GameCore.Instance.Vehicle.Inventory[ItemTypes.Money].SubtractQuantity((int)UserData.River.FerryCost); UserData.River.FerryCost = 0; } else if ((GameCore.Instance.Vehicle.Inventory[ItemTypes.Clothing].Quantity > UserData.River.HelpCost) && (UserData.River.HelpCost > 0)) { GameCore.Instance.Vehicle.Inventory[ItemTypes.Clothing].SubtractQuantity(UserData.River.HelpCost); UserData.River.HelpCost = 0; } }