#Getting the format of hint parameters.
1 messages · Page 1 of 1 (latest)
You have a base message string, eg:
Hello this is a test message, press {0} to give yourself {1} ammo
For this, you make an array of hint parameters
[new SSKeybindHintParameter(1), new IntHintParameter(15)]
Index of the array = formatting number
SSKeybind => {0}
IntHint => {1}
If this is what you mean?
Resulting in
Hello this is a test message, press [YourKeybind] to give yourself 15 ammo
no
then I dont know what you mean
I am making a hint management plugin that makes it possible to send multiple hints, but right now it doesn't take into account hint parameters. I was told that some hint parameters have more than 1 value to replace so I need to know the count of values that can be replaced within each hint parameter so I can take into account the parameters once I replace them
oh this is what you were trying to say earlier to me
who said a hint parameter takes more than one? because afaik its one parameter per replacement
Yea
i thought you said that there was a case
but if there is only 1 replacer per hint param then cool
even better
what?
icic
Ok so this is my solution to the issue then
int usableParam = 0;
List<HintParameter> allParameters = new();
foreach (TextHint hint in Hints)
{
string text = hint.Text;
HintParameter[] parameters = hint.Parameters ?? Array.Empty<HintParameter>();
if (parameters.Length > 0)
{
for (int i = 0; i < parameters.Length; i++)
{
text = text.Replace($"{{{i}}}", $"{{{usableParam + i}}}");
}
allParameters.AddRange(parameters);
usableParam += parameters.Length;
}
stringBuilder.Append(text);
stringBuilder.Append("<line-height=0%>\n</line-height>");
}```
Yep seems good
turns out it wouldnt work because usableParam would end up starting at 1 