Pieter Boelen:
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->Does it split the name in firstname and lastname? If the name is set as only first or last name, you might end up being called Captain "" instead of Captain "Lastname".<!--QuoteEnd--></div><!--QuoteEEnd-->
If you changing FIRSTNAME_SPACEBAR_LASTNAME it come to be Firstname and Lastname <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid="
" border="0" alt="smile.gif" />
Doctor - gives you Defence and Leadership more then you have.
Carpenter - Sailing and Repair.
Desk Fighter - Leadership, Fencing and Grappling.
Catalina The Pirate:
character.c
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->string oldCurNode;
void InitInterface_R(string iniName,ref pCharacter)
GameInterface.renamebox.strdata = "";
GameInterface.renamebox.maxlen = 32;
GameInterface.renamebox.maxwidth = 320;
If(Checkattribute(GameInterface, "View_Enc_Officer"))
{
SetNodeUsing("RENAMEBOX",false);
}
//View Enc Officer Mod End
SetNodeUsing("RENAMEBOX",false);
SetNodeUsing("B_CHARNAME",false);
if(bSeaActive && bAbordageStarted && !bCabinStarted && PChar.location != "Tutorial_Deck")
{
SetSelectable("RENAMEBOX",false);
}
else
{
SetSelectable("RENAMEBOX",true);
}
SetEventHandler("NodeOk","ProcessNodeOk",0);
SetEventHandler("NodeCancel","ProcessNodeCancel",0);
SetEventHandler("CharNameChange","ProcessCharNameChange",0);
void ProcessNodeOk()
{
string nodName = GetEventData();
SendMessage(&GameInterface,"ll", MSG_INTERFACE_LOCK_NODE, 0);
if( CheckAttribute(&GameInterface,nodName+".strdata") )
{
string str = GameInterface.(nodName).strdata;
SetCurrentNode("B_CHARNAME");
SetCharName(str);
GameInterface.strings.CharacterName = xi_refCharacter.name+" "+ stringRet(CheckAttribute(xi_refCharacter,"firstname"),xi_refCharacter.firstname + " ","") + xi_refCharacter.lastname;
}
DeleteAttribute(&GameInterface,nodName+".strdata");
SetNodeUsing("RENAMEBOX",false);
}
void ProcessNodeCancel()
{
string nodName = GetEventData();
SendMessage(&GameInterface,"ll", MSG_INTERFACE_LOCK_NODE, 0);
DeleteAttribute(&GameInterface,nodName+".strdata");
SetNodeUsing("renamebox",false);
SetCurrentNode("B_CHARNAME");
}
void ProcessCharNameChange()
{
GameInterface.renamebox.strdata = "";
SetNodeUsing("RENAMEBOX",true);
SendMessage(&GameInterface,"lls", MSG_INTERFACE_LOCK_NODE, 1, "RENAMEBOX");
SetCurrentNode("RENAMEBOX");
}
void SetCharName(string newName)
{
string flname;
ref chref = &xi_refCharacter;
int fndNum = findSubStr(newName," ",0);
string fname = newName;
string lname = "";
string name = "";
int slen;
if(fndNum>0)
{
fname = strcut(newName,0,fndNum-1);
slen = strlen(newName);
flname = strcut(newName,fndNum+1,slen-1);
}
if(!CheckAttribute(chref,"firstname"))
{
chref.name = fname;
chref.lastname = flname;
}
else
{
chref.firstname = name;
chref.lastname = lname;
}
}
void CharInterfaceExit(bool flag)
{
DelEventHandler("NodeOk","ProcessNodeOk");
DelEventHandler("NodeCancel","ProcessNodeCancel");
DelEventHandler("CharNameChange","ProcessCharNameChange");
}
void ProcessFrame()
{
if(oldCurNode!=GetCurrentNode())
{
switch(oldCurNode)
{
case "RENAMEBOX": SendMessage(&GameInterface,"ll", MSG_INTERFACE_LOCK_NODE, 0); break;
}
oldCurNode=GetCurrentNode();
SetNodeUsing("B_CHARNAME",true);
}
}<!--c2--></div><!--ec2-->
character.ini
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->[MAIN]
item = 100,pc,BUTTON,B_CHARNAME
item = 100,EDITBOX,RENAMEBOX
[B_CHARNAME]
bBreakCommand
command = activate,event:CharNameChange
command = click,event:CharNameChange
command = deactivate,select:SKILLCHANGER
command = leftstep,select:SKILLCHANGER
command = rightstep,select:SKILLCHANGER
command = upstep,select:I_SHIP
command = downstep,select:CHANGE_OUTFIT
position = 60,48,260,77
[RENAMEBOX]
command = activate
command = deactivate,select:RFACE
command = click
command = leftstep
command = rightstep
command = upstep
command = downstep
position = 12,48,298,271
chrFont = interface_normal
strFont = interface_normal
chrScale = 1.0
strScale = 1.0
offsLeft = 8
offsTop = 8
chrTexture = interfaces\icons.tga
normTexRect = 0,0.625,0.0625,0.75
selTexRect = 0.0625,0.625,0.125,0.75
argbBoxColor = 255,0,0,0
argbBoundColor = 128,80,80,80
alphabet = alphabet low register
alphabetUP = alphabet up register
hGrateSize = 8
stringLength = 20<!--c2--></div><!--ec2-->