Add basic stats menu support

This commit is contained in:
SilicaAndPina 2020-12-22 15:01:34 +13:00
parent 1ed964aacf
commit abb90f5865
9 changed files with 315 additions and 11 deletions

View file

@ -13,6 +13,35 @@ namespace HISP.Game
public static string RakeNothing;
public static string ShovelNothing;
// Stats Page
public static string StatsBarFormat;
public static string StatsAreaFormat;
public static string StatsMoneyFormat;
public static string StatsFreeTimeFormat;
public static string StatsDescriptionFormat;
public static string StatsExpFormat;
public static string StatsQuestpointsFormat;
public static string StatsHungerFormat;
public static string StatsThirstFormat;
public static string StatsTiredFormat;
public static string StatsGenderFormat;
public static string StatsJewelFormat;
public static string StatsCompetitionGearFormat;
public static string CompetitionGearHeadFormat;
public static string CompetitionGearBodyFormat;
public static string CompetitionGearLegsFormat;
public static string CompetitionGearFeetFormat;
public static string StatsPrivateNotes;
public static string StatsQuests;
public static string StatsMinigameRanking;
public static string StatsAwards;
public static string StatsMisc;
public static string NoJewerlyEquipped;
public static string NoCompetitionGear;
// Announcements
public static string NewUserMessage;
public static string WelcomeFormat;
@ -156,6 +185,62 @@ namespace HISP.Game
// Click
public static string NothingInterestingHere;
public static string FormatStatsBar(string username)
{
return StatsBarFormat.Replace("%USERNAME%", username);
}
public static string FormatStatsArea(string area)
{
return StatsAreaFormat.Replace("%AREA%", area);
}
public static string FormatMoneyStat(int money)
{
return StatsMoneyFormat.Replace("%MONEY%", money.ToString("N0"));
}
public static string FormatFreeTime(int freeMinutes)
{
return StatsFreeTimeFormat.Replace("%FREEMINUTES%", freeMinutes.ToString("N0"));
}
public static string FormatPlayerDescriptionForStatsMenu(string description)
{
return StatsDescriptionFormat.Replace("%PLAYERDESC%", description);
}
public static string FormatExperience(int expPoints)
{
return StatsExpFormat.Replace("%EXPPOINTS%", expPoints.ToString("N0"));
}
public static string FormatQuestPoints(int questPoints)
{
return StatsQuestpointsFormat.Replace("%QUESTPOINTS%", questPoints.ToString("N0"));
}
public static string FormatHungryStat(string status)
{
return StatsHungerFormat.Replace("%HUNGER%", status);
}
public static string FormatThirstStat(string status)
{
return StatsThirstFormat.Replace("%THIRST%", status);
}
public static string FormatTiredStat(string status)
{
return StatsTiredFormat.Replace("%TIRED%", status);
}
public static string FormatGenderStat(string gender)
{
return StatsGenderFormat.Replace("%GENDER%", gender);
}
public static string FormatJewelryStat(string jewelformat)
{
return StatsJewelFormat.Replace("%JEWELFORMAT%", jewelformat);
}
public static string FormatCompetitionGearStat(string competitonGearFormat)
{
return StatsCompetitionGearFormat.Replace("%GEARFORMAT%", competitonGearFormat);
}
public static string FormatYouEarnedAnItemMessage(string itemName)
{
return YouEarnedAnItemFormat.Replace("%ITEM%", itemName);

View file

@ -8,6 +8,13 @@ namespace HISP.Game
// Meta
private static string buildLocationString(int x, int y)
{
string areaString = buildAreaString(x, y);
if (areaString != "")
areaString = Messages.LocationFormat.Replace("%META%", areaString);
return areaString;
}
private static string buildAreaString(int x, int y)
{
string locationString = "";
@ -17,8 +24,6 @@ namespace HISP.Game
locationString += Messages.TownFormat.Replace("%TOWN%", World.GetTown(x, y).Name);
if (World.InIsle(x, y))
locationString += Messages.IsleFormat.Replace("%ISLE%", World.GetIsle(x, y).Name);
if (locationString != "")
locationString = Messages.LocationFormat.Replace("%META%", locationString);
return locationString;
}
@ -212,6 +217,43 @@ namespace HISP.Game
}
return message;
}
public static string BuildWornJewelery(User user)
{
return Messages.NoJewerlyEquipped;
}
public static string BuildWornCompaionEquip(User user)
{
return Messages.NoCompetitionGear;
}
public static string BuildStatsMenu(User user)
{
string message = Messages.FormatStatsBar(user.Username);
string areaString = buildAreaString(user.X, user.Y);
if (areaString != "")
message += Messages.FormatStatsArea(areaString);
message += Messages.FormatMoneyStat(user.Money);
if(!user.Subscribed)
message += Messages.FormatFreeTime(user.FreeMinutes);
message += Messages.FormatPlayerDescriptionForStatsMenu(user.ProfilePage);
message += Messages.FormatExperience(user.Experience);
message += Messages.FormatHungryStat("Not implemented yet :3");
message += Messages.FormatThirstStat("Not implemented yet :3");
message += Messages.FormatTiredStat("Not implemented yet :3");
message += Messages.FormatGenderStat(user.Gender);
message += Messages.FormatJewelryStat(BuildWornJewelery(user));
message += Messages.FormatCompetitionGearStat(BuildWornCompaionEquip(user));
message += Messages.StatsPrivateNotes;
message += Messages.StatsQuests;
message += Messages.StatsMinigameRanking;
message += Messages.StatsAwards;
message += Messages.StatsMisc;
message += Messages.BackToMap;
message += Messages.MetaTerminator;
return message;
}
public static string BuildSpecialTileInfo(User user, World.SpecialTile specialTile)
{
string message = "";