Sfortune Posted May 6, 2016 Share Posted May 6, 2016 I'm not sure if anyone here can help but I figured I would give it a go. I've been messing around with Lidgren/SFML/Gwen and have run into an issue with my multiline textbox used for chat. Whenever the message is sent there is no modification until it reaches the server. Than once it is there we get the players name added to it and a nice colon to separate the username from the message. Then it gets sent to all clients currently connected. Once is reaches a client I take what's in the old textbox and add the new message to the old and separate them with "\n" or Environment.NewLine (\r\n). I'm not sure whats going on but I get a little [] box instead of them added together with the new message on the next line. Ive included the packet that handles the data below and well as a screenshot. Any help would be much appreciated. Thanks all! string msg = incMSG.ReadString(); string cMsg = svrGUI.outputChat.Text; svrGUI.outputChat.SetText(cMsg + '\n' + msg); Link to comment Share on other sites More sharing options...
Recoil Posted May 6, 2016 Share Posted May 6, 2016 The [] is only because of the font you are using. I had to switch fonts with Revamped because of this same issue. You will have to either change the font or make a new line with the remaining text. Link to comment Share on other sites More sharing options...
Sfortune Posted May 6, 2016 Author Share Posted May 6, 2016 I have tried a few different fonts. I've done quite a bit of debugging on both client and server. I'm going to try a few other fonts tho and see what happens. Link to comment Share on other sites More sharing options...
Recoil Posted May 6, 2016 Share Posted May 6, 2016 Try either ShareTechMono-Regular or Lucida Console (lucon). One of those did it for me I believe. Link to comment Share on other sites More sharing options...
Sfortune Posted May 6, 2016 Author Share Posted May 6, 2016 I've tried about 6 fonts now, 3 different sizes for each as well but nothing. I've noticed that multiline textboxes don't really work that well in Gwen in the first place. Hopefully I can figure something out. Thanks for the help! Link to comment Share on other sites More sharing options...
Recoil Posted May 6, 2016 Share Posted May 6, 2016 I could never get Gwen to work, so all my text was actually being drawn to the screen at the coordinates. Changing the font worked for what I was doing, but as far as Gwen goes it could be doing something different in the code that still inserts a [] when there is a line return char. I believe Damian was able to bypass that issue and just create a new string to draw for each line of text. It works too, so there may be a solution you could look into. All of the word wrap stuff for that is on Revamped and Orion+ though. Link to comment Share on other sites More sharing options...
jcsnider Posted May 6, 2016 Share Posted May 6, 2016 In Intersect I used a list box with some word wrapping tricks to know when to switch lines. -- That's an option. Link to comment Share on other sites More sharing options...
Sfortune Posted May 6, 2016 Author Share Posted May 6, 2016 In Intersect I used a list box with some word wrapping tricks to know when to switch lines. -- That's an option. Thanks for the help guys! This works perfect! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now