You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AM2R-The-Horde-Multitroid/objects/oOptionsMod.object.gmx

660 lines
19 KiB

<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>&lt;undefined&gt;</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>0</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>global.curropt = 0;
var tempnumcounter = 0;
/*
This list dictates the order of selection in the Extras Menu.
Also, the list in User Defined 0 needs to be in order.
*/
num_ip = tempnumcounter++;
num_port = tempnumcounter++;
num_name = tempnumcounter++;
num_sequence = tempnumcounter++;
num_color = tempnumcounter++;
num_showname = tempnumcounter++;
num_connection = tempnumcounter++;
lastitem = tempnumcounter; // This value will be one number higher than the last number in the list above.
ip = oControl.ipaddress;
name = oControl.name;
port = string(oControl.port);
showname = 1;
sequence = 1;
connectiontxt = "Connect";
if(instance_exists(oClient)){
connectiontxt = "Disconnect";
} else {
connectiontxt = "Connect";
}
switch(oControl.reactorsequence){
case "synced":
sequence = 1;
break;
case "disabled":
sequence = 0;
break;
}
switch(oControl.showname){
case "enabled":
showname = 1;
break;
case "disabled":
showname = 0;
break;
}
vTargetY = 18 * lastitem + 30;
editing = 0;
active = 0;
alarm[0] = 5;
i = 0;
repeat (lastitem + 1) {
canedit[i] = 1;
i += 1;
}
targety = y;
view_object[0] = id;
timer = 0;
event_user(0);
with (oSS_Control) active = 1;
with (oSS_Fg) {
active = 1;
}
tip[num_ip] = "Set the IP address of the server";
tip[num_port] = "Set the port of the server";
tip[num_name] = "Set your display name";
tip[num_sequence] = "Toggle whether the reactor sequence is synced";
tip[num_color] = "Pick your preferred player color";
tip[num_showname] = "Enable/disable showing player names";
tip[num_connection] = "Connect/disconnect to the server";
tip[lastitem] = get_text("GlobalOptions", "ExitMain_Tip");
global.tiptext = tip[global.curropt];
alarm[1] = 1;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="1" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>event_user(1);
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="1">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string></string>
</argument>
</arguments>
</action>
</event>
<event eventtype="2" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>active = 1;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="3" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>
if (active) {
if (oControl.kDown &gt; 0 &amp;&amp; (oControl.kDownPushedSteps == 0 || oControl.kDownPushedSteps &gt; 30 &amp;&amp; timer == 0) &amp;&amp; !editing) {
global.curropt += 1;
if (global.curropt &gt; lastitem) global.curropt = 0;
while (canedit[global.curropt] == 0) global.curropt += 1;
if (global.curropt &gt; lastitem) global.curropt = 0;
targety = op[global.curropt].y + lastitem;
if (targety &gt; vTargetY) targety = vTargetY;
sfx_play(sndMenuMove);
global.tiptext = tip[global.curropt];
}
if (oControl.kUp &gt; 0 &amp;&amp; (oControl.kUpPushedSteps == 0 || oControl.kUpPushedSteps &gt; 30 &amp;&amp; timer == 0) &amp;&amp; !editing) {
global.curropt -= 1;
if (global.curropt &lt; 0) global.curropt = lastitem;
while (canedit[global.curropt] == 0)
{
global.curropt -= 1;
if (global.curropt &lt; 0) global.curropt = lastitem;
}
targety = op[global.curropt].y + lastitem;
if (targety &gt; vTargetY) targety = vTargetY;
sfx_play(sndMenuMove);
global.tiptext = tip[global.curropt];
}
if (oControl.kLeft &gt; 0 &amp;&amp; oControl.kLeftPushedSteps == 0 &amp;&amp; oControl.kDown == 0 &amp;&amp; oControl.kUp == 0)
{
if (global.shaders_compiled) {
if (global.curropt == num_color)
{
oControl.preferredcolor--;
if(oControl.preferredcolor &lt; 1){
oControl.preferredcolor = 9;
}
sfx_play(sndMenuMove);
event_user(2);
}
}
} // End Left
if (oControl.kRight &gt; 0 &amp;&amp; oControl.kRightPushedSteps == 0 &amp;&amp; oControl.kDown == 0 &amp;&amp; oControl.kUp == 0)
{
if (global.shaders_compiled) {
if (global.curropt == num_color)
{
oControl.preferredcolor++;
if(oControl.preferredcolor &gt; 9){
oControl.preferredcolor = 1;
}
sfx_play(sndMenuMove);
event_user(2);
}
}
} // End Right
//End Controller
if (oControl.kLeft &gt; 0 &amp;&amp; oControl.kLeftPushedSteps == 0 || oControl.kRight &gt; 0 &amp;&amp; oControl.kRightPushedSteps == 0 &amp;&amp; global.curropt &lt; lastitem &amp;&amp; oControl.kDown == 0 &amp;&amp; oControl.kUp == 0) {
if (global.curropt == num_sequence) sequence = !sequence;
if (global.curropt == num_showname) showname = !showname;
//if (global.shaders_compiled) {
//if (global.curropt == num_MSRfusion) oControl.msr_fusionsuit = !oControl.msr_fusionsuit;
//}
//if (global.curropt == num_exmonsters) oControl.mod_monstersextremecheck = !oControl.mod_monstersextremecheck;
//if (global.curropt == num_IGT) oControl.mod_IGT = !oControl.mod_IGT;
sfx_play(sndMenuMove);
event_user(2);
}
if (oControl.kMenu1 &amp;&amp; oControl.kMenu1PushedSteps == 0) {
if (global.curropt == num_ip) {
editing = !editing;
op[num_ip].editing = editing;
if(editing){
keyboard_string = ip;
}
sfx_play(sndMenuSel);
event_user(2);
}
if (global.curropt == num_port) {
editing = !editing;
op[num_port].editing = editing;
if(editing){
keyboard_string = port;
}
sfx_play(sndMenuSel);
event_user(2);
}
if (global.curropt == num_name) {
editing = !editing;
op[num_name].editing = editing;
if(editing){
keyboard_string = name;
}
sfx_play(sndMenuSel);
event_user(2);
}
if (global.curropt == num_connection){
if(!instance_exists(oClient) &amp;&amp; global.canConnect){
instance_create(x, y, oClient);
connectiontxt = "Disconnect";
op[num_connection].label = connectiontxt;
} else {
with(oClient){
instance_destroy();
}
connectiontxt = "Connect";
op[num_connection].label = connectiontxt;
}
sfx_play(sndMenuSel);
event_user(2);
}
if (global.curropt == lastitem) {
save_gameoptions();
view_object[0] = noone;
view_yview[0] = 0;
instance_create(50, 92, oOptionsMain);
instance_destroy();
sfx_play(sndMenuSel);
}
} // if (oControl.kMenu1 &amp;&amp; oControl.kMenu1PushedSteps == 0)
/*
if (oControl.kMenu2 &amp;&amp; oControl.kMenu1PushedSteps == 0) {
if(instance_exists(oSS_Control)){
if(editing){
editing = !editing;
}
instance_destroy();
}
}
*/
if(editing &amp;&amp; global.curropt == num_ip){
ip = keyboard_string;
op[num_ip].optext = ip;
}
if(editing &amp;&amp; global.curropt == num_port){
port = keyboard_string;
op[num_port].optext = port;
}
if(editing &amp;&amp; global.curropt == num_name){
var keyboardLength = string_length(keyboard_string);
if(keyboardLength &gt; 15){
keyboard_string = string_copy(keyboard_string, 1, 15);
}
name = keyboard_string;
op[num_name].optext = name;
}
} // if (active)
if (targety != y) y += (targety - y) / 10;
timer -= 1;
if (timer &lt; 0) timer = 8;
if(instance_exists(oClient)){
connectiontxt = "Disconnect";
op[num_connection].label = connectiontxt;
} else {
connectiontxt = "Connect";
op[num_connection].label = connectiontxt;
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="12">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>var color = "random";
var _sequence = "synced";
var _showname = "enabled";
op[num_ip].optext = ip;
op[num_port].optext = port;
op[num_name].optext = name;
switch(oControl.preferredcolor){
case 1:
op[num_color].optext = "Green";
break;
case 2:
op[num_color].optext = "Red";
break;
case 3:
op[num_color].optext = "Blue";
break;
case 4:
op[num_color].optext = "Yellow";
break;
case 5:
op[num_color].optext = "Orange";
break;
case 6:
op[num_color].optext = "Purple";
break;
case 7:
op[num_color].optext = "Pink";
break;
case 8:
op[num_color].optext = "White";
break;
case 9:
op[num_color].optext = "Random";
break;
}
switch(sequence){
case 0:
op[num_sequence].optext = "disabled";
oControl.reactorsequence = "disabled";
break;
case 1:
op[num_sequence].optext = "synced";
oControl.reactorsequence = "synced";
break;
}
switch(showname){
case 0:
op[num_showname].optext = "disabled";
oControl.showname = "disabled";
break;
case 1:
op[num_showname].optext = "enabled";
oControl.showname = "enabled";
break;
}
//if (oControl.mod_earlybaby == 1) {
// op[num_baby].optext = get_text("GlobalOptions", "Enabled");
//} else op[num_baby].optext = get_text("GlobalOptions", "Disabled");
//if (global.mod_gamebeaten == 0) {
// op[num_baby].optext = get_text("ExtrasMenu", "Locked");
//}
/*if (oControl.mod_monstersextremecheck == 1) {
op[num_exmonsters].optext = get_text("GlobalOptions", "Enabled");
} else op[num_exmonsters].optext = get_text("GlobalOptions", "Disabled");
if (global.mod_gamebeaten == 0) {
op[num_exmonsters].optext = get_text("ExtrasMenu", "Locked");
}*/
//if (global.shaders_compiled) {
// if (oControl.msr_fusionsuit == 1) {
// op[num_MSRfusion].optext = get_text("ExtrasMenu", "MSR");
// } else op[num_MSRfusion].optext = get_text("ExtrasMenu", "Default");
// if (global.mod_fusion_unlocked == 0) {
// op[num_MSRfusion].optext = get_text("ExtrasMenu", "Locked");
// }
//}
//if (oControl.mod_IGT == 1) {
// op[num_IGT].optext = get_text("GlobalOptions", "Enabled");
//} else op[num_IGT].optext = get_text("GlobalOptions", "Disabled");
//if (global.mod_gamebeaten == 0) {
// op[num_IGT].optext = get_text("ExtrasMenu", "Locked");
//}
switch(oControl.preferredcolor){
case 1:
color = "green";
break;
case 2:
color = "red";
break;
case 3:
color = "blue";
break;
case 4:
color = "yellow";
break;
case 5:
color = "orange";
break;
case 6:
color = "purple";
break;
case 7:
color = "pink";
break;
case 8:
color = "white";
break;
case 9:
color = "random";
break;
}
switch(sequence){
case 0:
_sequence = "disabled";
break;
case 1:
_sequence = "synced";
break;
}
switch(showname){
case 0:
_showname = "disabled";
break;
case 1:
_showname = "enabled";
break;
}
ini_open(working_directory + "\mod_settings.ini");
ini_write_string("ModSettings", "ipaddress", ip);
ini_write_real("ModSettings", "port", real(port));
ini_write_string("ModSettings", "displayname", name);
ini_write_string("ModSettings", "reactorsequence", _sequence);
ini_write_string("ModSettings", "preferredcolor", color);
ini_write_string("ModSettings", "showname", _showname);
ini_close();
oControl.ipaddress = ip;
oControl.name = name;
oControl.port = real(port);
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="11">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>for (var i = 0; i &lt;= lastitem; i++)
{
with (op[i]) instance_destroy();
}
with (op[50]) instance_destroy();
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="10">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>//This list needs to be in order. It won't work correctly otherwise.
sep = 16;
op[50] = instance_create(x, y, oMenuLabel);
op[50].text = "Multitroid settings";
var tempcount = 1;
op[num_ip] = instance_create(x, y + sep * tempcount++, oOptionLRMod);
op[num_ip].label = "IP Address";
op[num_ip].optionid = num_ip;
/*op[num_exmonsters] = instance_create(x, y + sep * tempcount++, oOptionLR);
op[num_exmonsters].label = get_text("ExtrasMenu", "ExtremeMonsters");
op[num_exmonsters].optionid = num_exmonsters;
if (global.mod_gamebeaten == 0) {
op[num_exmonsters].enabled = 0;
canedit[num_exmonsters] = 0;
}*/
op[num_port] = instance_create(x, y + sep * tempcount++, oOptionLRMod);
op[num_port].label = "Port";
op[num_port].optionid = num_port;
op[num_name] = instance_create(x, y + sep * tempcount++, oOptionLRMod);
op[num_name].label = "Display name";
op[num_name].optionid = num_name;
op[num_sequence] = instance_create(x, y + sep * tempcount++, oOptionLR);
op[num_sequence].label = "Reactor sequence";
op[num_sequence].optionid = num_sequence;
op[num_color] = instance_create(x, y + sep * tempcount++, oOptionLR);
op[num_color].label = "Preferred color";
op[num_color].optionid = num_color;
op[num_showname] = instance_create(x, y + sep * tempcount++, oOptionLR);
op[num_showname].label = "Show names";
op[num_showname].optionid = num_showname;
op[num_connection] = instance_create(x, y + sep * tempcount++, oPauseOption);
op[num_connection].optionid = num_connection;
op[num_connection].label = connectiontxt;
op[lastitem] = instance_create(x, y + sep * (lastitem + 1), oPauseOption);
op[lastitem].optionid = lastitem;
op[lastitem].label = get_text("GlobalOptions", "Exit");
event_user(2);
</string>
</argument>
</arguments>
</action>
</event>
</events>
<PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor>
<PhysicsObjectShape>0</PhysicsObjectShape>
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
<PhysicsObjectGroup>0</PhysicsObjectGroup>
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
<PhysicsShapePoints/>
</object>