heya folk,
Here's the deal: when I PM someone in game the best way is, I find, to type his name and then tab. for instance, hyTAB can be hyro or ryTAB can be ryjsamin (SP?).
then there's some folk out there who's got hard to type characters like ^ or * or their squad-names (SRM anyone?) in the beginning of their nickname. im not saying it's hard to type it but it's a bit redundant to type SRM_ at the beginning of the name when I need to talk to only one of them and kind of defeats the purpose of the whole auto complete feature. characters like ^ take a lot more time to type than regular letters also.
my suggestion:
these tags are voluntarily moved to the end of the nickname by their users.
what do you think?
autocomplete to ignore ^, *, SRM_ , etc.
It should be feasible to change the code so that if no match for a sequence is found, then check all strings omitting special chars.HSharp wrote:QUOTE (HSharp @ Aug 2 2010, 07:14 AM) I find it quite handy to find certain pilots to send a message to, I only have to type a few letters or sometimes even just a token to send a quick PM so I am happy with the status quo.
IE: if I type in "hsh" and hit tab, and no match is found, then search again without the leading char if the char is not a letter, which would then match ^hsharp.
This would preserve all current behavior, so that if I put in ^, then it would find ^hsharp (presuming ^hsharp is at the front of the list, if there is more than one ASL on.)


Code: Select all
PlayerInfo* BaseClient::FindPlayerByPrefix(const char* szNamePrefix)
{
PlayerInfo* p = NULL;
int lenNamePrefix = strlen(szNamePrefix);
for (PlayerLink* l = m_listPlayers.first(); (l != NULL); l = l->next())
{
PlayerInfo& player = l->data();
if (_strnicmp(player.CharacterName(), szNamePrefix, lenNamePrefix) == 0)
{
p = &player;
break;
}
}
return p;
}There can be 10 people starting with "An", it's as annoying as having a squadgame with SRM, while most of them carry their traditional "SRM_" in front of their real nick.
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
I think I see what you mean pkk. What do you think about this (UNTESTED) bit.
My C++ is pretty rusty, I think those string functions all do what I want. It compiles, so it's gotta be 85% correct.
Code: Select all
// BT - 8/2/2010 - Test for QBE, then token, then substring.
PlayerInfo* BaseClient::FindPlayerByPrefix(const char* szNamePrefix)
{
PlayerInfo* foundPlayer = NULL;
PlayerInfo* tokenMatchingPlayer = NULL;
PlayerInfo* substringMatchingPlayer = NULL;
int lenNamePrefix = strlen(szNamePrefix);
for (PlayerLink* l = m_listPlayers.first(); (l != NULL); l = l->next())
{
PlayerInfo& player = l->data();
// Does the callsign start with with name prefix?
if (_strnicmp(player.CharacterName(), szNamePrefix, lenNamePrefix) == 0)
{
foundPlayer = &player;
break;
}
// If the callsign starts with a token, and is greater than 1 char, does the callsign after
// the token start with the name prefix?
if(tokenMatchingPlayer == NULL && strlen(player.CharacterName()) > 1 && isalpha(player.CharacterName()[0]) == 0)
{
if (_strnicmp(player.CharacterName() + 1, szNamePrefix, lenNamePrefix) == 0)
{
tokenMatchingPlayer = &player;
}
}
// Does the callsign contain the string anywhere?
if(substringMatchingPlayer == NULL)
{
if(strstr(player.CharacterName(), szNamePrefix) != NULL)
substringMatchingPlayer = &player;
}
}
// Prefer the match on the beginning of the string.
if(foundPlayer == NULL)
{
// Else prefer the match on the beginning of the string less the token.
if(tokenMatchingPlayer != NULL)
foundPlayer = tokenMatchingPlayer;
// Else match on the first player with the string anywhere in the character name.
else if(substringMatchingPlayer != NULL)
foundPlayer = substringMatchingPlayer;
}
return foundPlayer;
}My C++ is pretty rusty, I think those string functions all do what I want. It compiles, so it's gotta be 85% correct.


Generally if there is more than one match for the string you've passed then multiple tabs will go through the list in alphabetical order. ( I think right now multiple tabs changes the group you're chatting to)
I didn't look closely at that code, so this may have been suggested already.
Didn't madpeople make a post about altering tab autocompletion several months ago?
I didn't look closely at that code, so this may have been suggested already.
Didn't madpeople make a post about altering tab autocompletion several months ago?
Looks pretty good. We need a ticket for this. If you don't have time to test just create a patch and I will look at it after #48.BackTrak wrote:QUOTE (BackTrak @ Aug 2 2010, 11:18 AM) I think I see what you mean pkk. What do you think about this (UNTESTED) bit.
My C++ is pretty rusty, I think those string functions all do what I want. It compiles, so it's gotta be 85% correct.![]()
Xynth@PK


Hi Edmond,Edmond wrote:QUOTE (Edmond @ Aug 2 2010, 11:30 AM) Generally if there is more than one match for the string you've passed then multiple tabs will go through the list in alphabetical order. ( I think right now multiple tabs changes the group you're chatting to)
I didn't look closely at that code, so this may have been suggested already.
Didn't madpeople make a post about altering tab autocompletion several months ago?
The current function that pkk posted does not support that kind of functionality (tabbing multiple times to get different callsigns).
You may be on to something, I just did a search thru the code for FindPlayerByPrefix, and nothing seems to be calling that function method. Is it not used anymore?
Edit: I r pro-coder...
Last edited by BackTrak on Mon Aug 02, 2010 6:13 pm, edited 1 time in total.






