[Pkg-nethack-devel] nethack/win/win32 mhdlg.c,1.1.1.1,1.2 mswproc.c,1.1.1.1,1.2 winhack.rc,1.1.1.1,1.2

Joshua Kwan joshk-guest@quantz.debian.org
Tue, 09 Dec 2003 16:14:48 +0000


Update of /cvsroot/pkg-nethack/nethack/win/win32
In directory quantz:/tmp/cvs-serv9687/win/win32

Modified Files:
	mhdlg.c mswproc.c winhack.rc 
Log Message:
Merge Nethack 3.4.3 upstream source.


Index: mhdlg.c
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/win/win32/mhdlg.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- mhdlg.c	7 Oct 2003 19:00:44 -0000	1.1.1.1
+++ mhdlg.c	9 Dec 2003 16:14:46 -0000	1.2
@@ -438,6 +438,20 @@
 	return FALSE;
 }
 
+void setComboBoxValue(HWND hWnd, int combo_box, int value)
+{
+	int index_max = SendDlgItemMessage(hWnd, combo_box, CB_GETCOUNT, 0, 0);
+	int index;
+	int value_to_set = LB_ERR;
+	for (index = 0; index < index_max; index++) {
+	    if (SendDlgItemMessage(hWnd, combo_box, CB_GETITEMDATA, (WPARAM)index, 0) == value) {
+		value_to_set = index;
+		break;
+	    }
+	}
+	SendDlgItemMessage(hWnd, combo_box, CB_SETCURSEL, (WPARAM)value_to_set, 0);
+}
+
 /* initialize player selector dialog */
 void plselInitDialog(HWND hWnd)
 {
@@ -471,7 +485,7 @@
 	} else {
 		CheckDlgButton(hWnd, IDC_PLSEL_ROLE_RANDOM, BST_UNCHECKED);
 		EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_ROLE_LIST), TRUE);
-		SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_LIST, CB_SETCURSEL, (WPARAM)flags.initrole, 0);
+		setComboBoxValue(hWnd, IDC_PLSEL_ROLE_LIST, flags.initrole);
 	}
 
 	/* intialize races list */
@@ -481,7 +495,7 @@
 	} else {
 		CheckDlgButton(hWnd, IDC_PLSEL_RACE_RANDOM, BST_UNCHECKED);
 		EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_RACE_LIST), TRUE);
-		SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_LIST, CB_SETCURSEL, (WPARAM)flags.initrace, 0);
+		setComboBoxValue(hWnd, IDC_PLSEL_RACE_LIST, flags.initrace);
 	}
 
 	/* intialize genders list */
@@ -491,7 +505,7 @@
 	} else {
 		CheckDlgButton(hWnd, IDC_PLSEL_GENDER_RANDOM, BST_UNCHECKED);
 		EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_GENDER_LIST), TRUE);
-		SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_LIST, CB_SETCURSEL, (WPARAM)flags.initgend, 0);
+		setComboBoxValue(hWnd, IDC_PLSEL_GENDER_LIST, flags.initgend);
 	}
 
 	/* intialize alignments list */
@@ -501,7 +515,7 @@
 	} else {
 		CheckDlgButton(hWnd, IDC_PLSEL_ALIGN_RANDOM, BST_UNCHECKED);
 		EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_ALIGN_LIST), TRUE);
-		SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_LIST, CB_SETCURSEL, (WPARAM)flags.initalign, 0);
+		setComboBoxValue(hWnd, IDC_PLSEL_ALIGN_LIST, flags.initalign);
 	}
 }
 
@@ -545,17 +559,15 @@
 		/* reset content and populate the list */
 		SendMessage(control_role, CB_RESETCONTENT, 0, 0); 
 		for (i = 0; roles[i].name.m; i++) {
-			if (ok_role(i, initrace, initgend, initalign)) {
-			    if (initgend>=0 && flags.female && roles[i].name.f)
-					ind = SendMessage(control_role, CB_ADDSTRING, (WPARAM)0, (LPARAM)NH_A2W(roles[i].name.f, wbuf, sizeof(wbuf)) );
-				else 
-					ind = SendMessage(control_role, CB_ADDSTRING, (WPARAM)0, (LPARAM)NH_A2W(roles[i].name.m, wbuf, sizeof(wbuf)) );
+			if (initgend>=0 && flags.female && roles[i].name.f)
+				ind = SendMessage(control_role, CB_ADDSTRING, (WPARAM)0, (LPARAM)NH_A2W(roles[i].name.f, wbuf, sizeof(wbuf)) );
+			else 
+				ind = SendMessage(control_role, CB_ADDSTRING, (WPARAM)0, (LPARAM)NH_A2W(roles[i].name.m, wbuf, sizeof(wbuf)) );
 
-				SendMessage(control_role, CB_SETITEMDATA, (WPARAM)ind, (LPARAM)i );
-				if( i==initrole ) { 
-					SendMessage(control_role, CB_SETCURSEL, (WPARAM)ind, (LPARAM)0 );
-					valid_opt = 1;
-				}
+			SendMessage(control_role, CB_SETITEMDATA, (WPARAM)ind, (LPARAM)i );
+			if( i==initrole ) { 
+				SendMessage(control_role, CB_SETCURSEL, (WPARAM)ind, (LPARAM)0 );
+				valid_opt = 1;
 			}
 		}
 		

Index: mswproc.c
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/win/win32/mswproc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- mswproc.c	7 Oct 2003 19:00:45 -0000	1.1.1.1
+++ mswproc.c	9 Dec 2003 16:14:46 -0000	1.2
@@ -2107,7 +2107,7 @@
 /* Reading and writing settings from the registry. */
 #define CATEGORYKEY         "Software"
 #define COMPANYKEY          "NetHack"
-#define PRODUCTKEY          "NetHack 3.4.2"
+#define PRODUCTKEY          "NetHack 3.4.3"
 #define SETTINGSKEY         "Settings"
 #define MAINSHOWSTATEKEY    "MainShowState"
 #define MAINMINXKEY         "MainMinX"

Index: winhack.rc
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/win/win32/winhack.rc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- winhack.rc	7 Oct 2003 19:00:46 -0000	1.1.1.1
+++ winhack.rc	9 Dec 2003 16:14:46 -0000	1.2
@@ -319,8 +319,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 3,4,2,0
- PRODUCTVERSION 3,4,2,0
+ FILEVERSION 3,4,3,0
+ PRODUCTVERSION 3,4,3,0
  FILEFLAGSMASK 0x1fL
 #ifdef _DEBUG
  FILEFLAGS 0x9L
@@ -336,13 +336,13 @@
         BLOCK "040904b0"
         BEGIN
             VALUE "FileDescription", "NetHack for Windows - Graphical Interface\0"
-            VALUE "FileVersion", "3.4.2\0"
+            VALUE "FileVersion", "3.4.3\0"
             VALUE "InternalName", "NetHackW\0"
             VALUE "LegalCopyright", "Copyright (C) 1985 - 2003.  By Stichting Mathematisch Centrum and M. Stephenson.  See license for details.\0"
             VALUE "OriginalFilename", "NetHackW.exe\0"
-            VALUE "PrivateBuild", "030825\0"
+            VALUE "PrivateBuild", "031014\0"
             VALUE "ProductName", "NetHack\0"
-            VALUE "ProductVersion", "3.4.2\0"
+            VALUE "ProductVersion", "3.4.3\0"
         END
     END
     BLOCK "VarFileInfo"