API:NamingConflictRequestNewName
From RoR Wiki
UI Lua API · Pregame functions
Version: WAR 1.4.8
Sends a new name for the selected character to the server, for characters that must be renamed because of a naming conflict.
NamingConflictRequestNewName(newName)
Arguments
- newName
wstring– The new character name. It must be a wide string:L"Name"works,"Name"does not.
Returns
Nothing.
Details
- The call only works in the pregame state. At any other time it does nothing.
- An empty name is ignored.
- Otherwise the client stores the name on the character select screen and sends a name request for the currently selected character slot to the server.
- The answer arrives later. The stock rename window registers for
SystemData.Events.CHARACTER_PREGAME_NAMING_CONFLICT_RESPONSEto get it, and is opened onCHARACTER_PREGAME_NAMING_CONFLICT_POP_UP_WINDOW. - Passing an ordinary Lua string or a number raises an Invalid Parameters error.
Errors
None besides the generic Invalid Parameters message when the argument is not a wide string.
Example
From interfacecore/source/renamewindow.lua:
local newName = TextEditBoxGetText( windowName.."TextInput" )
if( newName ~= L"" )
then
LabelSetText( windowName.."MessageText", GetPregameString( StringTables.Pregame.LABEL_RENAME_VALIDATING_NEW_NAME) )
EA_Window_Rename.LockInput()
NamingConflictRequestNewName( newName )
else
LabelSetText( windowName.."MessageText", GetPregameString( StringTables.Pregame.LABEL_RENAME_VALIDATING_ERROR ) )
end
