Fixed crashing 1.5.3indev display menu

pull/102/head
Lojemiru 5 years ago
parent a56cd1f5d8
commit 299a4d25ba

@ -488,7 +488,7 @@
<option_use_fast_collision>False</option_use_fast_collision> <option_use_fast_collision>False</option_use_fast_collision>
<option_use_new_audio>True</option_use_new_audio> <option_use_new_audio>True</option_use_new_audio>
<option_variableerrors>False</option_variableerrors> <option_variableerrors>False</option_variableerrors>
<option_version>152</option_version> <option_version>153</option_version>
<option_version_build>0</option_version_build> <option_version_build>0</option_version_build>
<option_version_company></option_version_company> <option_version_company></option_version_company>
<option_version_copyright></option_version_copyright> <option_version_copyright></option_version_copyright>
@ -496,7 +496,7 @@
<option_version_major>1</option_version_major> <option_version_major>1</option_version_major>
<option_version_minor>5</option_version_minor> <option_version_minor>5</option_version_minor>
<option_version_product></option_version_product> <option_version_product></option_version_product>
<option_version_release>2</option_version_release> <option_version_release>3</option_version_release>
<option_win8_advertising_appid></option_win8_advertising_appid> <option_win8_advertising_appid></option_win8_advertising_appid>
<option_win8_advertising_enable>0</option_win8_advertising_enable> <option_win8_advertising_enable>0</option_win8_advertising_enable>
<option_win8_advertising_key></option_win8_advertising_key> <option_win8_advertising_key></option_win8_advertising_key>
@ -581,7 +581,7 @@
<option_windows_major_version>1</option_windows_major_version> <option_windows_major_version>1</option_windows_major_version>
<option_windows_nsis_file>Configs\Default\windows\RunnerInstaller.nsi</option_windows_nsis_file> <option_windows_nsis_file>Configs\Default\windows\RunnerInstaller.nsi</option_windows_nsis_file>
<option_windows_product_info></option_windows_product_info> <option_windows_product_info></option_windows_product_info>
<option_windows_release_version>2</option_windows_release_version> <option_windows_release_version>3</option_windows_release_version>
<option_windows_runner_finished>Configs\Default\windows\Runner_finish.bmp</option_windows_runner_finished> <option_windows_runner_finished>Configs\Default\windows\Runner_finish.bmp</option_windows_runner_finished>
<option_windows_runner_header>Configs\Default\windows\Runner_header.bmp</option_windows_runner_header> <option_windows_runner_header>Configs\Default\windows\Runner_header.bmp</option_windows_runner_header>
<option_windows_save_location>0</option_windows_save_location> <option_windows_save_location>0</option_windows_save_location>

@ -33,6 +33,10 @@ active = 0;
targetY = y; targetY = y;
timer = 0; timer = 0;
SPACER = 16; SPACER = 16;
buttonsEnabled = true;
if (os_type != os_android &amp;&amp; !gamepad_is_connected(global.gamepadIndex)) || (os_type == os_android &amp;&amp; (!global.joydetected || global.compatibilitymode)) {
buttonsEnabled = false;
}
view_object[0] = id; view_object[0] = id;
@ -62,7 +66,9 @@ opShowMap = i++;
opCounterStyle = i++; opCounterStyle = i++;
// NOTIFICATIONS // NOTIFICATIONS
opShowHints = i++; opShowHints = i++;
opButtonType = i++; if (buttonsEnabled) {
opButtonType = i++;
}
opShowScans = i++; opShowScans = i++;
opLanguage = i++; opLanguage = i++;
@ -302,7 +308,7 @@ display_reset(0, global.opvsync);
if (global.curropt == opShowHints) global.ophudshowhints = !global.ophudshowhints; if (global.curropt == opShowHints) global.ophudshowhints = !global.ophudshowhints;
// Button Prompt Style // Button Prompt Style
if (global.curropt == opButtonType) { if (buttonsEnabled &amp;&amp; global.curropt == opButtonType) {
var inputMax = 5 - ((os_type == os_android) * 2); var inputMax = 5 - ((os_type == os_android) * 2);
oControl.mod_buttonsconfig = wrap(oControl.mod_buttonsconfig + input, 0, inputMax); oControl.mod_buttonsconfig = wrap(oControl.mod_buttonsconfig + input, 0, inputMax);
@ -393,7 +399,9 @@ op[opShowMap].label = get_text("OptionsDisplay", "HUDMap");
op[opCounterStyle].label = get_text("OptionsDisplay", "MonsterCounter"); op[opCounterStyle].label = get_text("OptionsDisplay", "MonsterCounter");
op[52].text = get_text("OptionsDisplay", "Title_Notifications"); op[52].text = get_text("OptionsDisplay", "Title_Notifications");
op[opShowHints].label = get_text("OptionsDisplay", "Hints"); op[opShowHints].label = get_text("OptionsDisplay", "Hints");
op[opButtonType].label = get_text("ExtrasMenu", "Controller"); if (buttonsEnabled) {
op[opButtonType].label = get_text("ExtrasMenu", "Controller");
}
op[opShowScans].label = get_text("OptionsDisplay", "ScanNotifications"); op[opShowScans].label = get_text("OptionsDisplay", "ScanNotifications");
op[opLanguage].label = get_text("OptionsDisplay", "Language"); op[opLanguage].label = get_text("OptionsDisplay", "Language");
@ -442,7 +450,9 @@ tip[opShowHUD] = get_text("OptionsDisplay", "HUDDisplay_Tip");
tip[opShowMap] = get_text("OptionsDisplay", "HUDMap_Tip"); tip[opShowMap] = get_text("OptionsDisplay", "HUDMap_Tip");
tip[opCounterStyle] = get_text("OptionsDisplay", "MonsterCounter_Tip"); tip[opCounterStyle] = get_text("OptionsDisplay", "MonsterCounter_Tip");
tip[opShowHints] = get_text("OptionsDisplay", "Hints_Tip"); tip[opShowHints] = get_text("OptionsDisplay", "Hints_Tip");
tip[opButtonType] = get_text("ExtrasMenu", "Controller_Tip"); if (buttonsEnabled) {
tip[opButtonType] = get_text("ExtrasMenu", "Controller_Tip");
}
tip[opShowScans] = get_text("OptionsDisplay", "ScanNotifications_Tip"); tip[opShowScans] = get_text("OptionsDisplay", "ScanNotifications_Tip");
tip[opLanguage] = get_text("OptionsDisplay", "Language_Tip"); tip[opLanguage] = get_text("OptionsDisplay", "Language_Tip");
tip[menuSize] = get_text("GlobalOptions", "ExitMain_Tip"); tip[menuSize] = get_text("GlobalOptions", "ExitMain_Tip");
@ -546,14 +556,16 @@ if (global.ophudshowhints) {
} else op[opShowHints].optext = get_text("GlobalOptions", "Disabled"); } else op[opShowHints].optext = get_text("GlobalOptions", "Disabled");
// Button Display Type // Button Display Type
switch (oControl.mod_buttonsconfig) { if (buttonsEnabled) {
case 0: op[opButtonType].optext = get_text("ExtrasMenu", "XBox"); break; switch (oControl.mod_buttonsconfig) {
case 1: op[opButtonType].optext = get_text("ExtrasMenu", "Playstation"); break; case 0: op[opButtonType].optext = get_text("ExtrasMenu", "XBox"); break;
case 2: op[opButtonType].optext = get_text("ExtrasMenu", "NintendoPro"); break; case 1: op[opButtonType].optext = get_text("ExtrasMenu", "Playstation"); break;
case 3: op[opButtonType].optext = get_text("ExtrasMenu", "SNESColored"); break; case 2: op[opButtonType].optext = get_text("ExtrasMenu", "NintendoPro"); break;
case 4: op[opButtonType].optext = get_text("ExtrasMenu", "MOGA"); break; case 3: op[opButtonType].optext = get_text("ExtrasMenu", "SNESColored"); break;
case 5: op[opButtonType].optext = get_text("ExtrasMenu", "OUYA"); break; case 4: op[opButtonType].optext = get_text("ExtrasMenu", "MOGA"); break;
default: op[opButtonType].optext = "[!]"; break; case 5: op[opButtonType].optext = get_text("ExtrasMenu", "OUYA"); break;
default: op[opButtonType].optext = "[!]"; break;
}
} }
// Show Scans // Show Scans
@ -696,7 +708,7 @@ op[opShowHints].optionid = opShowHints;
i++; i++;
// Button Display Type // Button Display Type
if ((os_type != os_android &amp;&amp; !gamepad_is_connected(global.gamepadIndex)) || (os_type == os_android &amp;&amp; (!global.joydetected || global.compatibilitymode)) || (os_type == os_android &amp;&amp; global.compatibilitymode)) { if (buttonsEnabled) {
op[opButtonType] = instance_create(x, y + SPACER * i, oOptionLR); op[opButtonType] = instance_create(x, y + SPACER * i, oOptionLR);
op[opButtonType].label = get_text("ExtrasMenu", "Controller"); op[opButtonType].label = get_text("ExtrasMenu", "Controller");
op[opButtonType].optionid = opButtonType; op[opButtonType].optionid = opButtonType;

Loading…
Cancel
Save