Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TrimIntoMultipleLines()

string Terraria.GameContent.UI.Chat.LegacyChatMonitor.TrimIntoMultipleLines ( byte R,
byte G,
byte B,
int maxTextSize,
string oldText )
inlineprivate

Definition at line 114 of file LegacyChatMonitor.cs.

115 {
116 while (oldText.Length > maxTextSize)
117 {
118 int num = maxTextSize;
119 int num2 = num;
120 while (oldText.Substring(num2, 1) != " ")
121 {
122 num2--;
123 if (num2 < 1)
124 {
125 break;
126 }
127 }
128 if (num2 == 0)
129 {
130 while (oldText.Substring(num, 1) != " ")
131 {
132 num++;
133 if (num >= oldText.Length - 1)
134 {
135 break;
136 }
137 }
138 }
139 else
140 {
141 num = num2;
142 }
143 if (num >= oldText.Length - 1)
144 {
145 num = oldText.Length;
146 }
147 string newText = oldText.Substring(0, num);
148 NewTextInternal(newText, R, G, B, force: true);
149 oldText = oldText.Substring(num);
150 if (oldText.Length > 0)
151 {
152 while (oldText.Substring(0, 1) == " ")
153 {
154 oldText = oldText.Substring(1);
155 }
156 }
157 }
158 return oldText;
159 }
void NewTextInternal(string newText, byte R=byte.MaxValue, byte G=byte.MaxValue, byte B=byte.MaxValue, bool force=false)

References Terraria.GameContent.UI.Chat.LegacyChatMonitor.NewTextInternal().

Referenced by Terraria.GameContent.UI.Chat.LegacyChatMonitor.NewTextInternal().