`o-k`, to add two new groups to the options screen:
first we need to add two new buttons.
open resourceiniinterfacesoption_screen.ini and find:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->item = TEXTBUTTON,B_SAILING1ST
item = TEXTBUTTON,B_PRIMARY_LAND
item = TEXTBUTTON,B_SAILING3RD
item = TEXTBUTTON,B_FIGHTMODE<!--c2--></div><!--ec2-->
replace with:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->item = TEXTBUTTON,B_SAILING1ST
item = TEXTBUTTON,B_PRIMARY_LAND
item = TEXTBUTTON,B_SAILING3RD
item = TEXTBUTTON,B_FIGHTMODE
item = TEXTBUTTON,B_GENERALCONTROLS
item = TEXTBUTTON,B_WORLDMAPCONTROLS<!--c2--></div><!--ec2-->
then we need to give the details of our new buttons, so find:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->[B_SAILING1ST]
bNotUse = 1
command = deactivate
command = upstep,select:B_FIGHTMODE
command = downstep,select:B_PRIMARY_LAND
command = click
command = activate
position = 128,206,512,238
string = Sailing 1St Person
[B_PRIMARY_LAND]
bNotUse = 1
command = deactivate
command = upstep,select:B_SAILING1ST
command = downstep,select:B_SAILING3RD
command = click
command = activate
position = 128,262,512,294
string = Primary Land
[B_SAILING3RD]
bNotUse = 1
command = deactivate
command = upstep,select:B_PRIMARY_LAND
command = downstep,select:B_FIGHTMODE
command = click
command = activate
position = 128,318,512,350
string = Sailing 3rd Person
[B_FIGHTMODE]
bNotUse = 1
command = deactivate
command = upstep,select:B_SAILING3RD
command = downstep,select:B_SAILING1ST
command = click
command = activate
position = 128,374,512,406
string = Fight Mode<!--c2--></div><!--ec2-->
replace with:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->[B_GENERALCONTROLS]
bNotUse = 1
command = deactivate
command = upstep,select:B_WORLDMAPCONTROLS
command = downstep,select:B_PRIMARY_LAND
command = click
command = activate
position = 128,200,512,230
string = KAMGeneralControls
[B_PRIMARY_LAND]
bNotUse = 1
command = deactivate
command = upstep,select:B_GENERALCONTROLS
command = downstep,select:B_FIGHTMODE
command = click
command = activate
position = 128,240,512,270
string = Primary Land
[B_FIGHTMODE]
bNotUse = 1
command = deactivate
command = upstep,select:B_PRIMARY_LAND
command = downstep,select:B_SAILING3RD
command = click
command = activate
position = 128,280,512,310
string = Fight Mode
[B_SAILING3RD]
bNotUse = 1
command = deactivate
command = upstep,select:B_FIGHTMODE
command = downstep,select:B_SAILING1ST
command = click
command = activate
position = 128,320,512,350
string = Sailing 3rd Person
[B_SAILING1ST]
bNotUse = 1
command = deactivate
command = upstep,select:B_SAILING3RD
command = downstep,select:B_WORLDMAPCONTROLS
command = click
command = activate
position = 128,360,512,390
string = Sailing 1St Person
[B_WORLDMAPCONTROLS]
bNotUse = 1
command = deactivate
command = upstep,select:B_SAILING1ST
command = downstep,select:B_GENERALCONTROLS
command = click
command = activate
position = 128,400,512,430
string = KAMWorldmapControls<!--c2--></div><!--ec2-->
notice i changed the order and positions of the buttons, i thought they were in a funny order the original way heh. these buttons won't show up at first because they have bNotUse set to 1.
to make them show up at the appropriate time, open programoption_screen.c and find:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> case OPAGE_CONTROLS_2:
SetNodeUsing("SUBTITLE",true);
SetNodeUsing("STRINGS_CONTROLS",true);
SetNodeUsing("B_SAILING1ST",true);
SetNodeUsing("B_PRIMARY_LAND",true);
SetNodeUsing("B_SAILING3RD",true);
SetNodeUsing("B_FIGHTMODE",true);
SetCurrentNode("B_SAILING1ST");
break;<!--c2--></div><!--ec2-->
replace with:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> case OPAGE_CONTROLS_2:
SetNodeUsing("SUBTITLE",true);
SetNodeUsing("STRINGS_CONTROLS",true);
SetNodeUsing("B_SAILING1ST",true);
SetNodeUsing("B_PRIMARY_LAND",true);
SetNodeUsing("B_SAILING3RD",true);
SetNodeUsing("B_FIGHTMODE",true);
SetNodeUsing("B_GENERALCONTROLS",true); // added after build 11 by KAM
SetNodeUsing("B_WORLDMAPCONTROLS",true); // added after build 11 by KAM
SetCurrentNode("B_GENERALCONTROLS"); // changed after build 11 by KAM
break;<!--c2--></div><!--ec2-->
in which i have added the two new buttons, and set the 'starting' button to general. we also have to tell them to hide at the appropriate time, so in the same file, find:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> case OPAGE_CONTROLS_2:
SetNodeUsing("SUBTITLE",false);
SetNodeUsing("STRINGS_CONTROLS",false);
SetNodeUsing("B_SAILING1ST",false);
SetNodeUsing("B_PRIMARY_LAND",false);
SetNodeUsing("B_SAILING3RD",false);
SetNodeUsing("B_FIGHTMODE",false);
break;<!--c2--></div><!--ec2-->
and replace with:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> case OPAGE_CONTROLS_2:
SetNodeUsing("SUBTITLE",false);
SetNodeUsing("STRINGS_CONTROLS",false);
SetNodeUsing("B_SAILING1ST",false);
SetNodeUsing("B_PRIMARY_LAND",false);
SetNodeUsing("B_SAILING3RD",false);
SetNodeUsing("B_FIGHTMODE",false);
SetNodeUsing("B_GENERALCONTROLS",false); // added after build 11 by KAM
SetNodeUsing("B_WORLDMAPCONTROLS",false); // added after build 11 by KAM
break;<!--c2--></div><!--ec2-->
in which i have also added the two new buttons.
finally, in resourceinitextsenglishcommon.ini, add the following at the bottom of the file, to set the text on the new buttons:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->; KAM - new control groups on options screen
string = KAMGeneralControls,"General"
string = KAMWorldmpControls,"World Map"<!--c2--></div><!--ec2-->
you can now test the interface `in-game`. the buttons don't do anything yet, though. to give them a function, find in option_screen.c:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> case "B_SAILING1ST":
if(comName=="deactivate")
{
if( g_bDisableControlChange ) {
ShowOptionsPage(OPAGE_MAIN);
SetCurrentNode("MB_CONTROLS");
} else {
ShowOptionsPage(OPAGE_CONTROLS_1);
SetCurrentNode("CONTROLS_B_CHANGE");
}
}
if(comName=="activate" || comName=="click")
{
ShowOptionsPage(OPAGE_CONTROLS_3);
SetShowGroup("Sailing1Pers");
}
break;<!--c2--></div><!--ec2-->
replace with:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> case "B_SAILING1ST":
if(comName=="deactivate")
{
if( g_bDisableControlChange ) {
ShowOptionsPage(OPAGE_MAIN);
SetCurrentNode("MB_CONTROLS");
} else {
ShowOptionsPage(OPAGE_CONTROLS_1);
SetCurrentNode("CONTROLS_B_CHANGE");
}
}
if(comName=="activate" || comName=="click")
{
ShowOptionsPage(OPAGE_CONTROLS_3);
SetShowGroup("Sailing1Pers");
}
break;
// added by KAM after build 11 -->
case "B_GENERALCONTROLS":
if(comName=="deactivate")
{
if( g_bDisableControlChange ) {
ShowOptionsPage(OPAGE_MAIN);
SetCurrentNode("MB_CONTROLS");
} else {
ShowOptionsPage(OPAGE_CONTROLS_1);
SetCurrentNode("CONTROLS_B_CHANGE");
}
}
if(comName=="activate" || comName=="click")
{
ShowOptionsPage(OPAGE_CONTROLS_3);
SetShowGroup("General");
}
break;
case "B_WORLDMAPCONTROLS":
if(comName=="deactivate")
{
if( g_bDisableControlChange ) {
ShowOptionsPage(OPAGE_MAIN);
SetCurrentNode("MB_CONTROLS");
} else {
ShowOptionsPage(OPAGE_CONTROLS_1);
SetCurrentNode("CONTROLS_B_CHANGE");
}
}
if(comName=="activate" || comName=="click")
{
ShowOptionsPage(OPAGE_CONTROLS_3);
SetShowGroup("WorldMap");
}
break;
// <-- added by KAM after build 11<!--c2--></div><!--ec2-->
as you can see, all i've done is copy the chunk of code out, changing only the button names and the argument of 'setshowgroup.'
finally, we need to add our new groups to this `hard-coded` list of titles. find:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> switch(groupName)
{
case "Sailing1Pers":
GameInterface.strings.GroupName = XI_ConvertString("Sailing 1St Person");
break;<!--c2--></div><!--ec2-->
and replace with:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> switch(groupName)
{
case "Sailing1Pers":
GameInterface.strings.GroupName = XI_ConvertString("Sailing 1St Person");
break;
// added by KAM after build 11 -->
case "General":
GameInterface.strings.GroupName = XI_ConvertString("KAMGeneralControls");
break;
case "WorldMap":
GameInterface.strings.GroupName = XI_ConvertString("KAMWorldmapControls");
break;
// <-- added by KAM after build 11<!--c2--></div><!--ec2-->
(that <b>XI_ConvertString</b> function is the one that looks up strings in common.ini.)
now, we're in luck, because it looks as though <b>SetShowGroup</b> will do the work from then on. it should automatically populate the controls list with only the controls of the group "General" or "WorldMap". it looks like you have to put the names of the controls in resourceinitextsenglishcontrolsnames.txt.
would you like to test it, nathan, since you know how to make the controls?
hope this works <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />