From 29985cea837f9683e308db522c106fff143f361b Mon Sep 17 00:00:00 2001
From: johns <>
Date: Sat, 30 Mar 2002 13:14:14 +0000
Subject: [PATCH] Fixed bug #536733: Text entries don't handle upper-case (from
 Daniel).

---
 src/include/interface.h | 2 ++
 src/include/menus.h     | 2 +-
 src/ui/interface.cpp    | 3 ++-
 src/ui/menus.cpp        | 6 +++---
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/include/interface.h b/src/include/interface.h
index fa3f97eb9..ab13ecd9d 100644
--- a/src/include/interface.h
+++ b/src/include/interface.h
@@ -198,6 +198,8 @@ enum _scroll_state_ {
 extern char GameRunning;
     /// Flag telling if the game is paused
 extern char GamePaused;
+    /// Flag telling not to advance to the next game cycle
+extern char SkipGameCycle;
 
     /// pressed mouse buttons (normal,double,dragged,long)
 extern enum _mouse_buttons_ MouseButtons;
diff --git a/src/include/menus.h b/src/include/menus.h
index e95e384a4..5c512c574 100644
--- a/src/include/menus.h
+++ b/src/include/menus.h
@@ -248,7 +248,7 @@ extern void DrawMenuButton(MenuButtonId button,unsigned flags,unsigned w,unsigne
     /// Draw and process a menu
 extern void ProcessMenu(int MenuId, int Loop);
     /// Keyboard handler for menus
-extern int MenuHandleKeyboard(int key);
+extern int MenuHandleKeyboard(int key, int keychar);
     /// Called if the mouse is moved in Menu interface state
 extern void MenuHandleMouseMove(int x,int y);
     /// Called if any mouse button is pressed down
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index b31fe1bb6..871933432 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -71,6 +71,7 @@ local int InputIndex;		/// current index into input
 local char InputStatusLine[80];	/// Last input status line
 global char GameRunning;	/// Current running state
 global char GamePaused;		/// Current pause state
+global char SkipGameCycle;	/// Skip the next game cycle
 global enum _iface_state_ InterfaceState; /// Current interface state
 
 /*----------------------------------------------------------------------------
@@ -776,7 +777,7 @@ global void HandleKeyDown(unsigned key,unsigned keychar)
 	    return;
 
 	case IfaceStateMenu:			// Menu active
-	    MenuHandleKeyboard(key);
+	    MenuHandleKeyboard(key, keychar);
 	    return;
     }
 }
diff --git a/src/ui/menus.cpp b/src/ui/menus.cpp
index fce0459b0..3d8d004a7 100644
--- a/src/ui/menus.cpp
+++ b/src/ui/menus.cpp
@@ -624,7 +624,7 @@ local Menuitem NetMultiClientMenuItems[] = {
     { MI_TYPE_PULLDOWN, 220, 10+300, 0, GameFont, NULL, NULL,
 	{ pulldown:{ tssoptions, 152, 20, MBUTTON_PULLDOWN, GameTSSAction, 5, 0, 0, 0, MI_PSTATE_PASSIVE} } },
 
-    { MI_TYPE_GEM, 10, 32+22, 0, LargeFont, NULL, NULL,
+    { MI_TYPE_GEM, 10, 32+22*1, 0, LargeFont, NULL, NULL,
 	{ gem:{ 0, 18, 18, MBUTTON_GEM_SQUARE, MultiClientGemAction} } },
     { MI_TYPE_GEM, 10, 32+22*2, 0, LargeFont, NULL, NULL,
 	{ gem:{ 0, 18, 18, MBUTTON_GEM_SQUARE, MultiClientGemAction} } },
@@ -2521,7 +2521,7 @@ global void NetClientUpdateState(void)
 **	@param key	Key scancode.
 **	@return		True, if key is handled; otherwise false.
 */
-global int MenuHandleKeyboard(int key)		// FIXME: Should be MenuKeyDown(), and act on _new_ MenuKeyUp() !!!
+global int MenuHandleKeyboard(int key, int keychar)		// FIXME: Should be MenuKeyDown(), and act on _new_ MenuKeyUp() !!!
 {					//        to implement button animation (depress before action)
     int i, n;
     Menuitem *mi;
@@ -2560,7 +2560,7 @@ inkey:
 		default:
 		    if (key >= 32 && key < 0x100) {
 			if (mi->d.input.nch < mi->d.input.maxch) {
-			    mi->d.input.buffer[mi->d.input.nch++] = key;
+			    mi->d.input.buffer[mi->d.input.nch++] = keychar;
 			    strcpy(mi->d.input.buffer + mi->d.input.nch, "~!_");
 			    MustRedraw |= RedrawMenu;
 			}