commit 98e31e07cff79b30ec5631373dc0b16ece02f1cf
Author: Wintermute0110 <wintermute0110@gmail.com>
AuthorDate: Tue Mar 21 01:01:15 2017 +0900
Commit: Jonathan Dowland <jon+github@alcopop.org>
CommitDate: Tue Mar 21 09:50:03 2017 +0000
Create a savegame name by pressing Fire with joystick.
---
src/doom/m_menu.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c
index 2331d5e5..490e32a9 100644
--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -1454,6 +1454,23 @@ boolean M_Responder (event_t* ev)
key = key_menu_activate;
joywait = I_GetTime() + 5;
}
+
+ // Fill-in the savegame name if user press Fire on the joystick
+ if (saveStringEnter && joybmenu >= 0 && ev->data1&1)
+ {
+ // Create a savegame string
+ char savestring[SAVESTRINGSIZE];
+
+ memset(savestring, 0, SAVESTRINGSIZE);
+ M_snprintf(savestring, SAVESTRINGSIZE - 1, "JOYSTICK SLOT %i", saveSlot);
+ saveCharIndex = strlen(savestring);
+ memcpy(savegamestrings[saveSlot], savestring, SAVESTRINGSIZE);
+
+ // Simulate a KEY_ENTER press. Wait a log time to generate another
+ // keypress.
+ key = KEY_ENTER;
+ joywait = I_GetTime() + 15;
+ }
}
else
{