Files
AM2R-Community-Updates/objects/oOptionsControl.object.gmx
2020-12-22 20:54:55 -06:00

493 lines
17 KiB
XML

<!--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;
lastitem = 10;
active = 0;
alarm[0] = 5;
i = 0;
repeat (11) {
canedit[i] = 1;
i += 1;
}
targety = 0;
view_object[0] = id;
timer = 0;
event_user(0);
with (oSS_Control) active = 1;
with (oSS_Fg) active = 1;
tip[0] = get_text("OptionsControl", "AimingStyle_Tip");
tip[1] = get_text("OptionsControl", "MissileStyle_Tip");
tip[2] = get_text("OptionsControl", "ClassicMorphball_Tip");
tip[3] = get_text("OptionsControl", "SpiderballActivation_Tip");
tip[4] = get_text("OptionsControl", "AutoClimb_Tip");
tip[5] = get_text("OptionsControl", "AutoMorph_Tip");
if(os_type != os_android)
tip[6] = get_text("OptionsControl", "KeyboardSettings_Tip");
else
tip[6] = get_text("Android", "Haptics_Tip");
tip[7] = get_text("Android", "CompatibilityMode_Tip");
tip[8] = get_text("OptionsControl", "JoypadSettings_Tip");
tip[9] = get_text("Android", "TouchScale_Tip");
tip[10] = get_text("GlobalOptions", "ExitMain_Tip");
if (os_type == os_android) {
canedit[9] = 1;
} else {
canedit[9] = 0;
op[9].enabled = 0;
}
global.tiptext = tip[global.curropt];
alarm[1] = 1;
inputdel = 0;
</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>if (global.joydetected == 1 || ((os_type == os_android || os_type == os_linux) &amp;&amp; gamepad_is_connected(global.gamepadIndex))) {
op[8].enabled = 1;
canedit[8] = 1;
op[8].label = get_text("OptionsControl", "JoypadSettings");
}
if (global.joydetected == 0 &amp;&amp; !gamepad_is_connected(global.gamepadIndex)) {
op[8].enabled = 0;
canedit[8] = 0;
op[8].label = get_text("OptionsControl", "NoJoypad");
}
if(os_type == os_android) alarm[1] = 1; // DROIDCODE
else alarm[1] = 120;
</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; !inputdel) {
global.curropt += 1;
if (global.curropt &gt; lastitem) global.curropt = 0;
while (canedit[global.curropt] == 0) global.curropt += 1;
targety = op[global.curropt].y + 8 + 8;
if (targety &gt; 192) targety = 192;
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; !inputdel) {
global.curropt -= 1;
if (global.curropt &lt; 0) global.curropt = lastitem;
while (canedit[global.curropt] == 0) global.curropt -= 1;
targety = op[global.curropt].y + 8 + 8;
if (targety &gt; 192) targety = 192;
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.curropt == 3) {
global.opspdstyle -= 1;
if (global.opspdstyle &lt; 0) global.opspdstyle = 2;
}
else if (global.curropt == 9) { // TOUCH SCALE
if (floor(oControl.touch_scale) &lt; 8) {
oControl.touch_scale ++;
sfx_play(sndMenuMove); // no clue why this one is needed here but not on left but I'm done asking questions
event_user(2);
inputdel = 30;
}
}
}
if ((oControl.kRight &gt; 0) &amp;&amp; (oControl.kRightPushedSteps == 0) &amp;&amp; (oControl.kDown == 0) &amp;&amp; (oControl.kUp == 0)) {
if (global.curropt == 3) {
global.opspdstyle += 1;
if (global.opspdstyle &gt; 2) global.opspdstyle = 0;
}
else if (global.curropt == 9) { // TOUCH SCALE
if ((floor(oControl.touch_scale) &gt; 1) &amp;&amp; (oTouchControls.st_radius &lt; (display_get_height()/3))) {
oControl.touch_scale --;
sfx_play(sndMenuMove);
event_user(2);
inputdel = 30;
}
}
}
if (((oControl.kLeft &gt; 0 &amp;&amp; oControl.kLeftPushedSteps == 0) || (oControl.kRight &gt; 0 &amp;&amp; oControl.kRightPushedSteps == 0)) &amp;&amp; (((os_type != os_android) &amp;&amp; global.curropt &lt; 6) || ((os_type == os_android || os_type == os_linux) &amp;&amp; global.curropt &lt; 8)) &amp;&amp; ((oControl.kDown == 0) &amp;&amp; (oControl.kUp == 0))) {
if (global.curropt == 0) global.opaimstyle = !global.opaimstyle;
if (global.curropt == 1) global.opmslstyle = !global.opmslstyle;
if (global.curropt == 2) global.opmrpstyle = !global.opmrpstyle;
if (global.curropt == 4) global.opautoclimb = !global.opautoclimb;
if (global.curropt == 5) global.opautomorph = !global.opautomorph;
if (os_type == os_android &amp;&amp; global.curropt == 6) {
global.opxjoyvib = !global.opxjoyvib;
if (global.opxjoyvib) ctrl_vibrate(1, 1, 15);
}
if ((os_type == os_android || os_type == os_linux) &amp;&amp; global.curropt == 7) { // OG
global.compatibilitymode = !global.compatibilitymode;
}
sfx_play(sndMenuMove);
event_user(2);
}
if (oControl.kMenu1 &amp;&amp; oControl.kMenu1PushedSteps == 0) {
if (os_type != os_android &amp;&amp; global.curropt == 6) {
save_gameoptions();
view_object[0] = noone;
view_yview[0] = 0;
instance_create(50, 92, oOptionsKeyboard);
instance_destroy();
sfx_play(sndMenuSel);
}
if (global.curropt == 8 &amp;&amp; canedit[8]) {
save_gameoptions();
view_object[0] = noone;
view_yview[0] = 0;
if ((os_type != os_android) &amp;&amp; (os_type != os_linux) &amp;&amp; (global.controltype == 2)) {
instance_create(50, 92, oOptionsXJoypad);
}
else if (((os_type == os_android) || (os_type == os_linux)) &amp;&amp; global.compatibilitymode == 0) {
instance_create(50, 92, oOptionsMogaJoypad);
} else {
instance_create(50, 92, oOptionsJoypad);
}
instance_destroy();
sfx_play(sndMenuSel);
}
if (global.curropt == 10) {
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 (active)
if (targety != y) y += (targety - y) / 10;
timer -= 1;
if (timer &lt; 0) timer = 8;
inputdel = max(0, inputdel - 1);
</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>if (global.opaimstyle) {
op[0].optext = get_text("OptionsControl", "AimingStyle_2Buttons");
} else op[0].optext = get_text("OptionsControl", "AimingStyle_1Button");
if (global.opmslstyle) {
op[1].optext = get_text("OptionsControl", "MissileStyle_Toggle");
} else op[1].optext = get_text("OptionsControl", "MissileStyle_Hold");
if (global.opmrpstyle) {
op[2].optext = get_text("GlobalOptions", "Enabled");
} else op[2].optext = get_text("GlobalOptions", "Disabled");
if (global.opspdstyle == 0) op[3].optext = get_text("OptionsControl", "SpiderballActivation_Toggle");
if (global.opspdstyle == 1) op[3].optext = get_text("OptionsControl", "SpiderballActivation_Classic");
if (global.opspdstyle == 2) op[3].optext = get_text("OptionsControl", "SpiderballActivation_Hold");
if (global.opautoclimb) {
op[4].optext = get_text("GlobalOptions", "Enabled");
} else op[4].optext = get_text("GlobalOptions", "Disabled");
if (global.opautomorph) {
op[5].optext = get_text("GlobalOptions", "Enabled");
} else op[5].optext = get_text("GlobalOptions", "Disabled");
if(os_type == os_android) {
if (global.opxjoyvib) {
op[6].optext = get_text("GlobalOptions", "Enabled");
} else op[6].optext = get_text("GlobalOptions", "Disabled");
}
if (global.compatibilitymode) {
op[7].optext = get_text("GlobalOptions", "Enabled");
} else op[7].optext = get_text("GlobalOptions", "Disabled");
if (global.curropt == 0) {
if (global.opaimstyle) {
global.tiptext = get_text("OptionsControl", "AimingStyle_2Buttons_Tip");
} else global.tiptext = get_text("OptionsControl", "AimingStyle_1Button_Tip");
}
if (global.curropt == 1) {
if (global.opmslstyle) {
global.tiptext = get_text("OptionsControl", "MissileStyle_Toggle_Tip");
} else global.tiptext = get_text("OptionsControl", "MissileStyle_Hold_Tip");
}
if (global.curropt == 2) {
if (global.opmrpstyle) {
global.tiptext = get_text("OptionsControl", "ClassicMorphball_Enabled_Tip");
} else global.tiptext = get_text("OptionsControl", "ClassicMorphball_Disabled_Tip");
}
if (global.curropt == 3) {
if (global.opspdstyle == 0) global.tiptext = get_text("OptionsControl", "SpiderballActivation_Toggle_Tip");
if (global.opspdstyle == 1) global.tiptext = get_text("OptionsControl", "SpiderballActivation_Classic_Tip");
if (global.opspdstyle == 2) global.tiptext = get_text("OptionsControl", "SpiderballActivation_Hold_Tip");
}
op[9].optext = string(abs(oControl.touch_scale-9));
if (instance_exists(oTouchControls)) {
with (oTouchControls) {
event_user(0);
}
}
</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>with (op[0]) instance_destroy();
with (op[1]) instance_destroy();
with (op[2]) instance_destroy();
with (op[3]) instance_destroy();
with (op[4]) instance_destroy();
with (op[5]) instance_destroy();
with (op[6]) instance_destroy();
with (op[7]) instance_destroy();
with (op[8]) instance_destroy();
with (op[9]) instance_destroy();
with (op[10]) 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>y -= 8;
sep = 16;
op[50] = instance_create(x, y, oMenuLabel);
op[50].text = get_text("OptionsControl", "Title_Control");
op[0] = instance_create(x, y + sep, oOptionLR);
op[0].label = get_text("OptionsControl", "AimingStyle");
op[0].optionid = 0;
op[1] = instance_create(x, y + sep * 2, oOptionLR);
op[1].label = get_text("OptionsControl", "MissileStyle");
op[1].optionid = 1;
op[2] = instance_create(x, y + sep * 3, oOptionLR);
op[2].label = get_text("OptionsControl", "ClassicMorphball");
op[2].optionid = 2;
op[3] = instance_create(x, y + sep * 4, oOptionLR);
op[3].label = get_text("OptionsControl", "SpiderballActivation");
op[3].optionid = 3;
op[4] = instance_create(x, y + sep * 5, oOptionLR);
op[4].label = get_text("OptionsControl", "AutoClimb");
op[4].optionid = 4;
op[5] = instance_create(x, y + sep * 6, oOptionLR);
op[5].label = get_text("OptionsControl", "AutoMorph");
op[5].optionid = 5;
if(os_type != os_android) {
op[6] = instance_create(x, y + sep * 7, oPauseOption);
op[6].optionid = 6;
op[6].label = get_text("OptionsControl", "KeyboardSettings");
}
else {
op[6] = instance_create(x, y + sep * 7, oOptionLR);
op[6].label = get_text("Android", "Haptics");
op[6].optionid = 6;
}
op[7] = instance_create(x, y + sep * 8, oOptionLR);
op[7].optionid = 7;
op[7].label = get_text("Android", "CompatibilityMode");
op[7].visible = false; // OG False
canedit[7] = 0; // OG 0
if(os_type == os_android || os_type == os_linux) {
op[7].visible = true;
canedit[7] = 1;
}
i = 8; // OG 8 PLEASE DON'T BE BORKED ON ANDROID
if(os_type == os_android || os_type == os_linux) i = 9; // probably don't need the linux one here but idk
op[8] = instance_create(x, y + sep * i, oPauseOption);
op[8].optionid = 8;
op[8].label = get_text("OptionsControl", "JoypadSettings");
op[8].enabled = 1;
if (global.joydetected == 0 &amp;&amp; !gamepad_is_connected(global.gamepadIndex)) {
op[8].enabled = 0;
canedit[8] = 0;
op[8].label = get_text("OptionsControl", "NoJoypad");
}
i++ // AHHHHHHHHHHHH
op[9] = instance_create(x, y + sep * i, oOptionLR);
op[9].optionid = 9;
op[9].label = get_text("Android", "TouchScale");
if (os_type != os_android) { // cleanup, I hope
op[9].visible = false;
canedit[9] = 0;
i --;
}
i++;
op[10] = instance_create(x, y + sep * i, oPauseOption);
op[10].optionid = 10;
op[10].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>