Hey everyone!
I've been pulling my hair out on this one, and I figured I'd reach out and see if someone had an idea of what I might be doing wrong, or why this isn't working.
I've created a Shard Welcome Gump that displays when player's log in. I am loading in an HTML file before I display it. Currently, only part of the full text from the HTML file is being displayed on the GUMP. Like 752 characters out of 1231 total. I don't see a size limit for HTML on a GUMP. I've been trying to make sure all of the text from the HTML is loaded before displaying the GUMP.
I appreciate any insight someone might have. Here is a screenshot of the missing text (the lines exist, but no text), and my LoginStats.cs that I modified to load the information before displaying the GUMP.
LoginStats.cs
Thanks again for anyone who can help!
I've been pulling my hair out on this one, and I figured I'd reach out and see if someone had an idea of what I might be doing wrong, or why this isn't working.
I've created a Shard Welcome Gump that displays when player's log in. I am loading in an HTML file before I display it. Currently, only part of the full text from the HTML file is being displayed on the GUMP. Like 752 characters out of 1231 total. I don't see a size limit for HTML on a GUMP. I've been trying to make sure all of the text from the HTML is loaded before displaying the GUMP.
I appreciate any insight someone might have. Here is a screenshot of the missing text (the lines exist, but no text), and my LoginStats.cs that I modified to load the information before displaying the GUMP.
LoginStats.cs
C#:
using System;
using Server.Network;
using Server.Gumps;
using System.IO;
using System.Text;
namespace Server.Misc
{
public class LoginStats
{
static string path = @"C:\Users\MyName\Documents\UO - R\RunUO-2.6\Scripts\ShardWelcomeGump\shardupdates.html";
static string loadText = "";
public static string ReadText()
{
using (StreamReader reader = new StreamReader(path))
{
string line = "";
StringBuilder stringBuilder = new StringBuilder();
while ((line = reader.ReadLine()) != null)
{
stringBuilder.Append(line);
}
return stringBuilder.ToString();
reader.Close();
}
}
public static void Initialize()
{
// Register our event handler
EventSink.Login += new LoginEventHandler( EventSink_Login );
loadText = ReadText();
}
private static void EventSink_Login( LoginEventArgs args )
{
int userCount = NetState.Instances.Count;
int itemCount = World.Items.Count;
int mobileCount = World.Mobiles.Count;
Mobile m = args.Mobile;
m.SendMessage( "Welcome, {0}! There {1} currently {2} user{3} online, with {4} item{5} and {6} mobile{7} in the world.",
args.Mobile.Name,
userCount == 1 ? "is" : "are",
userCount, userCount == 1 ? "" : "s",
itemCount, itemCount == 1 ? "" : "s",
mobileCount, mobileCount == 1 ? "" : "s" );
m.SendGump(new ShardWelcomeGump(loadText));
}
}
}
Thanks again for anyone who can help!