Exemple #1
0
        /// <summary>
        /// Called when the attached screen is activated and needs a text prompt to be returned.
        /// </summary>
        protected override string OnDialogPrompt()
        {
            // Generate a progress bar of the trail progress, then format it into a table.
            var checkMap = new StringBuilder();

            checkMap.AppendLine($"{Environment.NewLine}Trail progress:{Environment.NewLine}");
            checkMap.AppendLine(TextProgress.DrawProgressBar(GameCore.Instance.Trail.LocationIndex + 1, GameCore.Instance.Trail.Locations.Count, 32) + Environment.NewLine);
            checkMap.AppendLine(GameCore.Instance.Trail.Locations.ToStringTable(new[] { "Visited", "Location" }, u => u.Status >= LocationStatus.Arrived, u => u.Name));
            return(checkMap.ToString());
        }
Exemple #2
0
        /// <summary>
        ///     Fired when dialog prompt is attached to active game Windows and would like to have a string returned.
        /// </summary>
        /// <returns>
        ///     The <see cref="string" />.
        /// </returns>
        protected override string OnDialogPrompt()
        {
            // Create visual progress representation of the trail.
            var map = new StringBuilder();

            map.AppendLine($"{Environment.NewLine}Trail progress{Environment.NewLine}");
            map.AppendLine(TextProgress.DrawProgressBar(
                               GameSimulationApp.Instance.Trail.LocationIndex + 1,
                               GameSimulationApp.Instance.Trail.Locations.Count, 32) + Environment.NewLine);

            // Build up a table of location names and if the player has visited them.
            var locationTable = GameSimulationApp.Instance.Trail.Locations.ToStringTable(
                new[] { "Visited", "Location Name" },
                u => u.Status >= LocationStatus.Arrived,
                u => u.Name
                );

            map.AppendLine(locationTable);

            return(map.ToString());
        }