tFixed bug with redrawing of messages window in GTK+ client - vaccinewars - be … | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit a02a21fb70ab9c2710bbba8d4ee4be220f5c90ac | |
parent 62a5428ac6617321414c49f511328138b66258da | |
Author: Ben Webb <[email protected]> | |
Date: Sun, 10 Sep 2000 23:55:33 +0000 | |
Fixed bug with redrawing of messages window in GTK+ client | |
Diffstat: | |
M po/dopewars.pot | 236 ++++++++++++++++-------------… | |
M src/gtk_client.c | 45 ++++++++++++++++++++---------… | |
2 files changed, 147 insertions(+), 134 deletions(-) | |
--- | |
diff --git a/po/dopewars.pot b/po/dopewars.pot | |
t@@ -6,7 +6,7 @@ | |
msgid "" | |
msgstr "" | |
"Project-Id-Version: PACKAGE VERSION\n" | |
-"POT-Creation-Date: 2000-09-10 22:48+0100\n" | |
+"POT-Creation-Date: 2000-09-11 00:51+0100\n" | |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | |
"Language-Team: LANGUAGE <[email protected]>\n" | |
t@@ -998,7 +998,7 @@ msgstr "" | |
msgid "CLQP" | |
msgstr "" | |
-#: src/curses_client.c:363 src/gtk_client.c:800 | |
+#: src/curses_client.c:363 src/gtk_client.c:811 | |
msgid "Where to, dude ? " | |
msgstr "" | |
t@@ -1104,12 +1104,12 @@ msgstr "" | |
msgid "The server has terminated. Reverting to single player mode." | |
msgstr "" | |
-#: src/curses_client.c:635 src/gtk_client.c:328 src/serverside.c:258 | |
+#: src/curses_client.c:635 src/gtk_client.c:338 src/serverside.c:258 | |
#, c-format | |
msgid "%s joins the game!" | |
msgstr "" | |
-#: src/curses_client.c:640 src/gtk_client.c:334 | |
+#: src/curses_client.c:640 src/gtk_client.c:344 | |
#, c-format | |
msgid "%s has left the game." | |
msgstr "" | |
t@@ -1146,22 +1146,22 @@ msgstr "" | |
msgid "You don't have any %s to sell!" | |
msgstr "" | |
-#: src/curses_client.c:807 src/gtk_client.c:1072 | |
+#: src/curses_client.c:807 src/gtk_client.c:1087 | |
#, c-format | |
msgid "You'll need more %s to carry any more %s!" | |
msgstr "" | |
-#: src/curses_client.c:829 src/gtk_client.c:1076 | |
+#: src/curses_client.c:829 src/gtk_client.c:1091 | |
#, c-format | |
msgid "You don't have enough space to carry that %s!" | |
msgstr "" | |
-#: src/curses_client.c:837 src/gtk_client.c:1080 | |
+#: src/curses_client.c:837 src/gtk_client.c:1095 | |
#, c-format | |
msgid "You don't have enough cash to buy that %s!" | |
msgstr "" | |
-#: src/curses_client.c:850 src/gtk_client.c:1084 | |
+#: src/curses_client.c:850 src/gtk_client.c:1099 | |
msgid "You don't have any to sell!" | |
msgstr "" | |
t@@ -1169,7 +1169,7 @@ msgstr "" | |
msgid "How much money do you pay back? " | |
msgstr "" | |
-#: src/curses_client.c:880 src/curses_client.c:910 src/gtk_client.c:1888 | |
+#: src/curses_client.c:880 src/curses_client.c:910 src/gtk_client.c:1901 | |
msgid "You don't have that much money!" | |
msgstr "" | |
t@@ -1185,7 +1185,7 @@ msgstr "" | |
msgid "How much money? " | |
msgstr "" | |
-#: src/curses_client.c:913 src/gtk_client.c:1881 | |
+#: src/curses_client.c:913 src/gtk_client.c:1894 | |
msgid "There isn't that much money in the bank..." | |
msgstr "" | |
t@@ -1197,7 +1197,7 @@ msgstr "" | |
msgid "Messages" | |
msgstr "" | |
-#: src/curses_client.c:1130 src/gtk_client.c:1371 | |
+#: src/curses_client.c:1130 src/gtk_client.c:1384 | |
msgid "Stats" | |
msgstr "" | |
t@@ -1429,228 +1429,228 @@ msgstr "" | |
msgid "Message" | |
msgstr "" | |
-#: src/gtk_client.c:172 | |
+#: src/gtk_client.c:168 src/gtk_client.c:179 | |
msgid "Quit Game" | |
msgstr "" | |
-#: src/gtk_client.c:172 src/gtk_client.c:181 | |
+#: src/gtk_client.c:168 src/gtk_client.c:180 src/gtk_client.c:187 | |
msgid "Abandon current game?" | |
msgstr "" | |
-#: src/gtk_client.c:180 | |
+#: src/gtk_client.c:186 | |
msgid "Start new game" | |
msgstr "" | |
-#: src/gtk_client.c:202 | |
+#: src/gtk_client.c:208 | |
msgid "Inventory" | |
msgstr "" | |
-#: src/gtk_client.c:230 src/gtk_client.c:2124 src/gtk_client.c:2492 | |
+#: src/gtk_client.c:236 src/gtk_client.c:2137 src/gtk_client.c:2505 | |
msgid "Close" | |
msgstr "" | |
-#: src/gtk_client.c:260 | |
+#: src/gtk_client.c:266 | |
msgid "Connection to server lost - switching to single player mode" | |
msgstr "" | |
-#: src/gtk_client.c:302 | |
+#: src/gtk_client.c:312 | |
msgid "You have been pushed from the server." | |
msgstr "" | |
-#: src/gtk_client.c:307 | |
+#: src/gtk_client.c:317 | |
msgid "The server has terminated." | |
msgstr "" | |
-#: src/gtk_client.c:347 | |
+#: src/gtk_client.c:357 | |
#, c-format | |
msgid "Jetting to %s" | |
msgstr "" | |
-#: src/gtk_client.c:352 | |
+#: src/gtk_client.c:362 | |
msgid "<main>/Errands/Spy" | |
msgstr "" | |
-#: src/gtk_client.c:354 | |
+#: src/gtk_client.c:364 | |
#, c-format | |
msgid "_Spy\t(%s)" | |
msgstr "" | |
-#: src/gtk_client.c:358 | |
+#: src/gtk_client.c:368 | |
#, c-format | |
msgid "_Tipoff\t(%s)" | |
msgstr "" | |
-#: src/gtk_client.c:360 | |
+#: src/gtk_client.c:370 | |
msgid "<main>/Errands/Tipoff" | |
msgstr "" | |
-#: src/gtk_client.c:393 | |
+#: src/gtk_client.c:406 | |
msgid "High Scores" | |
msgstr "" | |
-#: src/gtk_client.c:427 src/gtk_client.c:1023 src/gtk_client.c:1484 | |
-#: src/gtk_client.c:1797 src/gtk_client.c:1962 src/gtk_client.c:2241 | |
-#: src/gtk_client.c:2399 | |
+#: src/gtk_client.c:440 src/gtk_client.c:1038 src/gtk_client.c:1497 | |
+#: src/gtk_client.c:1810 src/gtk_client.c:1975 src/gtk_client.c:2254 | |
+#: src/gtk_client.c:2412 | |
msgid "OK" | |
msgstr "" | |
-#: src/gtk_client.c:506 | |
+#: src/gtk_client.c:522 | |
msgid "Fight" | |
msgstr "" | |
-#: src/gtk_client.c:533 | |
+#: src/gtk_client.c:549 | |
#, c-format | |
msgid "_Deal %s" | |
msgstr "" | |
-#: src/gtk_client.c:537 src/gtk_client.c:1119 src/gtk_client.c:1316 | |
+#: src/gtk_client.c:553 src/gtk_client.c:1131 src/gtk_client.c:1327 | |
msgid "_Fight" | |
msgstr "" | |
-#: src/gtk_client.c:540 | |
+#: src/gtk_client.c:556 | |
msgid "_Stand" | |
msgstr "" | |
-#: src/gtk_client.c:543 src/gtk_client.c:1118 | |
+#: src/gtk_client.c:559 src/gtk_client.c:1130 | |
msgid "_Run" | |
msgstr "" | |
-#: src/gtk_client.c:791 | |
+#: src/gtk_client.c:802 | |
msgid "Jet to location" | |
msgstr "" | |
-#: src/gtk_client.c:856 | |
+#: src/gtk_client.c:871 | |
#, c-format | |
msgid "at %s" | |
msgstr "" | |
-#: src/gtk_client.c:861 | |
+#: src/gtk_client.c:876 | |
#, c-format | |
msgid "You are currently carrying %d %s" | |
msgstr "" | |
-#: src/gtk_client.c:866 | |
+#: src/gtk_client.c:881 | |
#, c-format | |
msgid "Available space: %d" | |
msgstr "" | |
-#: src/gtk_client.c:871 | |
+#: src/gtk_client.c:886 | |
#, c-format | |
msgid "You can afford %d" | |
msgstr "" | |
-#: src/gtk_client.c:921 src/gtk_client.c:1052 | |
+#: src/gtk_client.c:936 src/gtk_client.c:1067 | |
msgid "Buy" | |
msgstr "" | |
-#: src/gtk_client.c:922 src/gtk_client.c:1053 | |
+#: src/gtk_client.c:937 src/gtk_client.c:1068 | |
msgid "Sell" | |
msgstr "" | |
-#: src/gtk_client.c:923 src/gtk_client.c:1054 | |
+#: src/gtk_client.c:938 src/gtk_client.c:1069 | |
msgid "Drop" | |
msgstr "" | |
-#: src/gtk_client.c:1011 | |
+#: src/gtk_client.c:1026 | |
#, c-format | |
msgid "%s how many?" | |
msgstr "" | |
-#: src/gtk_client.c:1029 src/gtk_client.c:1797 src/gtk_client.c:1973 | |
-#: src/gtk_client.c:2249 | |
+#: src/gtk_client.c:1044 src/gtk_client.c:1810 src/gtk_client.c:1986 | |
+#: src/gtk_client.c:2262 | |
msgid "Cancel" | |
msgstr "" | |
-#: src/gtk_client.c:1068 | |
+#: src/gtk_client.c:1083 | |
#, c-format | |
msgid "You don't have any %s!" | |
msgstr "" | |
-#: src/gtk_client.c:1118 src/gtk_client.c:1798 | |
+#: src/gtk_client.c:1130 src/gtk_client.c:1811 | |
msgid "_Yes" | |
msgstr "" | |
-#: src/gtk_client.c:1118 src/gtk_client.c:1798 | |
+#: src/gtk_client.c:1130 src/gtk_client.c:1811 | |
msgid "_No" | |
msgstr "" | |
-#: src/gtk_client.c:1119 | |
+#: src/gtk_client.c:1131 | |
msgid "_Attack" | |
msgstr "" | |
-#: src/gtk_client.c:1119 | |
+#: src/gtk_client.c:1131 | |
msgid "_Evade" | |
msgstr "" | |
-#: src/gtk_client.c:1138 | |
+#: src/gtk_client.c:1149 | |
msgid "Question" | |
msgstr "" | |
-#: src/gtk_client.c:1246 | |
+#: src/gtk_client.c:1257 | |
msgid "<main>/Talk" | |
msgstr "" | |
-#: src/gtk_client.c:1248 | |
+#: src/gtk_client.c:1259 | |
msgid "<main>/List" | |
msgstr "" | |
-#: src/gtk_client.c:1250 | |
+#: src/gtk_client.c:1261 | |
msgid "<main>/Errands" | |
msgstr "" | |
-#: src/gtk_client.c:1266 | |
+#: src/gtk_client.c:1277 | |
msgid "Space" | |
msgstr "" | |
-#: src/gtk_client.c:1271 | |
+#: src/gtk_client.c:1282 | |
msgid "Cash" | |
msgstr "" | |
-#: src/gtk_client.c:1276 | |
+#: src/gtk_client.c:1287 | |
msgid "Debt" | |
msgstr "" | |
-#: src/gtk_client.c:1281 | |
+#: src/gtk_client.c:1292 | |
msgid "Bank" | |
msgstr "" | |
-#: src/gtk_client.c:1296 | |
+#: src/gtk_client.c:1307 | |
msgid "Health" | |
msgstr "" | |
-#: src/gtk_client.c:1316 | |
+#: src/gtk_client.c:1327 | |
msgid "_Jet!" | |
msgstr "" | |
-#: src/gtk_client.c:1347 | |
+#: src/gtk_client.c:1358 | |
msgid "dopewars" | |
msgstr "" | |
-#: src/gtk_client.c:1431 | |
+#: src/gtk_client.c:1444 | |
msgid "Drug Dealing and Research" | |
msgstr "" | |
-#: src/gtk_client.c:1432 | |
+#: src/gtk_client.c:1445 | |
msgid "Play Testing" | |
msgstr "" | |
-#: src/gtk_client.c:1433 | |
+#: src/gtk_client.c:1446 | |
msgid "Extensive Play Testing" | |
msgstr "" | |
-#: src/gtk_client.c:1435 | |
+#: src/gtk_client.c:1448 | |
msgid "Constructive Criticism" | |
msgstr "" | |
-#: src/gtk_client.c:1437 | |
+#: src/gtk_client.c:1450 | |
msgid "Unconstructive Criticism" | |
msgstr "" | |
-#: src/gtk_client.c:1441 | |
+#: src/gtk_client.c:1454 | |
msgid "About dopewars" | |
msgstr "" | |
-#: src/gtk_client.c:1450 | |
+#: src/gtk_client.c:1463 | |
msgid "" | |
"Based on John E. Dell's old Drug Wars game, dopewars is a simulation of an\n" | |
"imaginary drug market. dopewars is an All-American game which features\n" | |
t@@ -1662,150 +1662,150 @@ msgid "" | |
"have one month of game time to make your fortune.\n" | |
msgstr "" | |
-#: src/gtk_client.c:1458 | |
+#: src/gtk_client.c:1471 | |
#, c-format | |
msgid "" | |
"Version %s Copyright (C) 1998-2000 Ben Webb [email protected]\n" | |
"dopewars is released under the GNU General Public Licence\n" | |
msgstr "" | |
-#: src/gtk_client.c:1476 | |
+#: src/gtk_client.c:1489 | |
msgid "" | |
"\n" | |
"For information on the command line options, type dopewars -h at your\n" | |
"Unix prompt. This will display a help screen, listing the availableoptions." | |
msgstr "" | |
-#: src/gtk_client.c:1514 src/gtk_client.c:1599 | |
+#: src/gtk_client.c:1527 src/gtk_client.c:1612 | |
msgid "Status: Attempting to contact server..." | |
msgstr "" | |
-#: src/gtk_client.c:1520 src/gtk_client.c:1605 | |
+#: src/gtk_client.c:1533 src/gtk_client.c:1618 | |
#, c-format | |
msgid "Status: Could not connect (%s)" | |
msgstr "" | |
-#: src/gtk_client.c:1554 | |
+#: src/gtk_client.c:1567 | |
#, c-format | |
msgid "%d of %d" | |
msgstr "" | |
-#: src/gtk_client.c:1621 src/gtk_client.c:1658 src/gtk_client.c:1699 | |
+#: src/gtk_client.c:1634 src/gtk_client.c:1671 src/gtk_client.c:1712 | |
msgid "Server" | |
msgstr "" | |
-#: src/gtk_client.c:1622 src/gtk_client.c:1673 | |
+#: src/gtk_client.c:1635 src/gtk_client.c:1686 | |
msgid "Port" | |
msgstr "" | |
-#: src/gtk_client.c:1623 | |
+#: src/gtk_client.c:1636 | |
msgid "Version" | |
msgstr "" | |
-#: src/gtk_client.c:1624 | |
+#: src/gtk_client.c:1637 | |
msgid "Players" | |
msgstr "" | |
-#: src/gtk_client.c:1625 | |
+#: src/gtk_client.c:1638 | |
msgid "Comment" | |
msgstr "" | |
-#: src/gtk_client.c:1634 | |
+#: src/gtk_client.c:1647 | |
msgid "New Game" | |
msgstr "" | |
-#: src/gtk_client.c:1643 | |
+#: src/gtk_client.c:1656 | |
msgid "Hey dude, what's your _name?" | |
msgstr "" | |
-#: src/gtk_client.c:1665 | |
+#: src/gtk_client.c:1678 | |
msgid "Host name" | |
msgstr "" | |
-#: src/gtk_client.c:1688 src/gtk_client.c:1751 | |
+#: src/gtk_client.c:1701 src/gtk_client.c:1764 | |
msgid "_Connect" | |
msgstr "" | |
-#: src/gtk_client.c:1701 src/gtk_client.c:1722 | |
+#: src/gtk_client.c:1714 src/gtk_client.c:1735 | |
msgid "Single player" | |
msgstr "" | |
-#: src/gtk_client.c:1707 | |
+#: src/gtk_client.c:1720 | |
msgid "_Antique mode" | |
msgstr "" | |
-#: src/gtk_client.c:1714 | |
+#: src/gtk_client.c:1727 | |
msgid "_Start single-player game" | |
msgstr "" | |
-#: src/gtk_client.c:1724 src/gtk_client.c:1762 | |
+#: src/gtk_client.c:1737 src/gtk_client.c:1775 | |
msgid "Metaserver" | |
msgstr "" | |
-#: src/gtk_client.c:1741 | |
+#: src/gtk_client.c:1754 | |
msgid "_Update" | |
msgstr "" | |
-#: src/gtk_client.c:1766 | |
+#: src/gtk_client.c:1779 | |
msgid "Status: Waiting for user input" | |
msgstr "" | |
-#: src/gtk_client.c:1919 | |
+#: src/gtk_client.c:1932 | |
#, c-format | |
msgid "Cash: %s" | |
msgstr "" | |
-#: src/gtk_client.c:1926 | |
+#: src/gtk_client.c:1939 | |
#, c-format | |
msgid "Debt: %s" | |
msgstr "" | |
-#: src/gtk_client.c:1929 | |
+#: src/gtk_client.c:1942 | |
#, c-format | |
msgid "Bank: %s" | |
msgstr "" | |
-#: src/gtk_client.c:1937 | |
+#: src/gtk_client.c:1950 | |
msgid "Pay back:" | |
msgstr "" | |
-#: src/gtk_client.c:1940 | |
+#: src/gtk_client.c:1953 | |
msgid "Deposit" | |
msgstr "" | |
-#: src/gtk_client.c:1944 | |
+#: src/gtk_client.c:1957 | |
msgid "Withdraw" | |
msgstr "" | |
-#: src/gtk_client.c:1968 | |
+#: src/gtk_client.c:1981 | |
msgid "Pay all" | |
msgstr "" | |
-#: src/gtk_client.c:1990 | |
+#: src/gtk_client.c:2003 | |
msgid "Player List" | |
msgstr "" | |
-#: src/gtk_client.c:2079 | |
+#: src/gtk_client.c:2092 | |
msgid "Talk to player(s)" | |
msgstr "" | |
-#: src/gtk_client.c:2101 | |
+#: src/gtk_client.c:2114 | |
msgid "Talk to all players" | |
msgstr "" | |
-#: src/gtk_client.c:2105 | |
+#: src/gtk_client.c:2118 | |
msgid "Message:-" | |
msgstr "" | |
-#: src/gtk_client.c:2118 | |
+#: src/gtk_client.c:2131 | |
msgid "Send" | |
msgstr "" | |
-#: src/gtk_client.c:2211 | |
+#: src/gtk_client.c:2224 | |
msgid "Spy On Player" | |
msgstr "" | |
-#: src/gtk_client.c:2213 | |
+#: src/gtk_client.c:2226 | |
#, c-format | |
msgid "" | |
"Please choose the player to spy on. Your %s will\n" | |
t@@ -1815,11 +1815,11 @@ msgid "" | |
"you, so any %s or %s that he's carrying may be lost!" | |
msgstr "" | |
-#: src/gtk_client.c:2221 | |
+#: src/gtk_client.c:2234 | |
msgid "Tip Off The Cops" | |
msgstr "" | |
-#: src/gtk_client.c:2223 | |
+#: src/gtk_client.c:2236 | |
#, c-format | |
msgid "" | |
"Please choose the player to tip off the cops to. Your %s will\n" | |
t@@ -1828,71 +1828,71 @@ msgid "" | |
"so any %s or %s that he's carrying may be lost!" | |
msgstr "" | |
-#: src/gtk_client.c:2263 | |
+#: src/gtk_client.c:2276 | |
#, c-format | |
msgid "Sack %s" | |
msgstr "" | |
-#: src/gtk_client.c:2264 | |
+#: src/gtk_client.c:2277 | |
#, c-format | |
msgid "" | |
"Are you sure? (Any %s or %s carried\n" | |
"by this %s may be lost!)" | |
msgstr "" | |
-#: src/gtk_client.c:2285 | |
+#: src/gtk_client.c:2298 | |
msgid "Name" | |
msgstr "" | |
-#: src/gtk_client.c:2286 | |
+#: src/gtk_client.c:2299 | |
msgid "Price" | |
msgstr "" | |
-#: src/gtk_client.c:2287 | |
+#: src/gtk_client.c:2300 | |
msgid "Number" | |
msgstr "" | |
-#: src/gtk_client.c:2289 | |
+#: src/gtk_client.c:2302 | |
msgid "_Buy ->" | |
msgstr "" | |
-#: src/gtk_client.c:2290 | |
+#: src/gtk_client.c:2303 | |
msgid "<- _Sell" | |
msgstr "" | |
-#: src/gtk_client.c:2291 | |
+#: src/gtk_client.c:2304 | |
msgid "_Drop <-" | |
msgstr "" | |
-#: src/gtk_client.c:2296 | |
+#: src/gtk_client.c:2309 | |
#, c-format | |
msgid "%s here" | |
msgstr "" | |
-#: src/gtk_client.c:2299 | |
+#: src/gtk_client.c:2312 | |
#, c-format | |
msgid "%s carried" | |
msgstr "" | |
-#: src/gtk_client.c:2375 | |
+#: src/gtk_client.c:2388 | |
msgid "Change Name" | |
msgstr "" | |
-#: src/gtk_client.c:2385 | |
+#: src/gtk_client.c:2398 | |
msgid "" | |
"Unfortunately, somebody else is already using \"your\" name. Please change " | |
"it:-" | |
msgstr "" | |
-#: src/gtk_client.c:2444 | |
+#: src/gtk_client.c:2457 | |
msgid "Done" | |
msgstr "" | |
-#: src/gtk_client.c:2478 | |
+#: src/gtk_client.c:2491 | |
msgid "Spy reports" | |
msgstr "" | |
-#: src/gtk_client.c:2549 | |
+#: src/gtk_client.c:2562 | |
msgid "" | |
"No GTK+ client available - rebuild the binary passing the\n" | |
"--enable-gtk-client option to configure, or use the curses\n" | |
diff --git a/src/gtk_client.c b/src/gtk_client.c | |
t@@ -81,8 +81,8 @@ static gboolean IsShowingPlayerList=FALSE,IsShowingTalkList=… | |
IsShowingInventory=FALSE,IsShowingGunShop=FALSE; | |
static void display_intro(GtkWidget *widget,gpointer data); | |
-static void DestroyGtk(GtkWidget *widget,gpointer data); | |
static void QuitGame(GtkWidget *widget,gpointer data); | |
+static void DestroyGtk(GtkWidget *widget,gpointer data); | |
static void NewGame(GtkWidget *widget,gpointer data); | |
static void ListScores(GtkWidget *widget,gpointer data); | |
static void ListInventory(GtkWidget *widget,gpointer data); | |
t@@ -163,10 +163,6 @@ static void LogMessage(const gchar *log_domain,GLogLevelF… | |
message,MB_OK); | |
} | |
-void DestroyGtk(GtkWidget *widget,gpointer data) { | |
- gtk_main_quit(); | |
-} | |
- | |
void QuitGame(GtkWidget *widget,gpointer data) { | |
if (!InGame || | |
MessageBox(ClientData.window,_("Quit Game"),_("Abandon current game?"), | |
t@@ -175,6 +171,16 @@ void QuitGame(GtkWidget *widget,gpointer data) { | |
} | |
} | |
+void DestroyGtk(GtkWidget *widget,gpointer data) { | |
+ gtk_main_quit(); | |
+} | |
+ | |
+gint MainDelete(GtkWidget *widget,GdkEvent *event,gpointer data) { | |
+ return (InGame && MessageBox(ClientData.window,_("Quit Game"), | |
+ _("Abandon current game?"),MB_YES|MB_NO)==MB_NO); | |
+} | |
+ | |
+ | |
void NewGame(GtkWidget *widget,gpointer data) { | |
if (InGame) { | |
if (MessageBox(ClientData.window,_("Start new game"), | |
t@@ -280,6 +286,10 @@ void HandleClientMessage(char *pt,Player *ReallyTo) { | |
gboolean Handled; | |
GtkWidget *MenuItem; | |
GSList *list; | |
+ | |
+/* Handle events first */ | |
+ while (gtk_main_iteration_do(FALSE)); | |
+ | |
if (ProcessMessage(pt,&From,&AICode,&Code,&To,&Data,FirstClient)==-1) { | |
return; | |
} | |
t@@ -379,6 +389,9 @@ void HandleClientMessage(char *pt,Player *ReallyTo) { | |
break; | |
} | |
g_free(Data); | |
+ | |
+/* Handle events again */ | |
+ while (gtk_main_iteration_do(FALSE)); | |
} | |
struct HiScoreDiaStruct { | |
t@@ -442,6 +455,7 @@ void PrintMessage(char *text) { | |
messages=GTK_EDITABLE(ClientData.messages); | |
+ gtk_text_freeze(GTK_TEXT(messages)); | |
g_strdelimit(text,"^",'\n'); | |
EditPos=gtk_text_get_length(GTK_TEXT(ClientData.messages)); | |
while (*text=='\n') text++; | |
t@@ -449,6 +463,8 @@ void PrintMessage(char *text) { | |
if (text[strlen(text)-1]!='\n') { | |
gtk_editable_insert_text(messages,cr,1,&EditPos); | |
} | |
+ gtk_text_thaw(GTK_TEXT(messages)); | |
+ gtk_editable_set_position(messages,EditPos); | |
} | |
static void FightCallback(GtkWidget *widget,gpointer data) { | |
t@@ -758,14 +774,11 @@ static void JetCallback(GtkWidget *widget,gpointer data)… | |
JetDialog = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(widget),"dialog")); | |
NewLocation = GPOINTER_TO_INT(data); | |
+ gtk_widget_destroy(JetDialog); | |
text=g_strdup_printf("%d",NewLocation); | |
SendClientMessage(ClientData.Play,C_NONE,C_REQUESTJET,NULL, | |
text,ClientData.Play); | |
g_free(text); | |
- gtk_widget_destroy(JetDialog); | |
- if (Network) { | |
- SetSocketWriteTest(ClientData.Play,TRUE); | |
- } | |
} | |
void JetButtonPressed(GtkWidget *widget,gpointer data) { | |
t@@ -785,8 +798,6 @@ void Jet() { | |
accel_group=gtk_accel_group_new(); | |
- if (Network) gdk_input_remove(ClientData.GdkInputTag); | |
- | |
dialog=gtk_window_new(GTK_WINDOW_DIALOG); | |
gtk_window_set_title(GTK_WINDOW(dialog),_("Jet to location")); | |
gtk_container_set_border_width(GTK_CONTAINER(dialog),7); | |
t@@ -803,8 +814,12 @@ void Jet() { | |
/* Generate a square box of buttons for all locations */ | |
boxsize=1; | |
while (boxsize*boxsize < NumLocation) boxsize++; | |
+ col=boxsize; row=1; | |
+ | |
+ /* Avoid creating a box with an entire row empty at the bottom */ | |
+ while (row*col < NumLocation) row++; | |
- table=gtk_table_new(boxsize,boxsize,TRUE); | |
+ table=gtk_table_new(row,col,TRUE); | |
for (i=0;i<NumLocation;i++) { | |
if (i<9) AccelChar='1'+i; | |
t@@ -1105,9 +1120,6 @@ static void QuestionCallback(GtkWidget *widget,gpointer … | |
SendClientMessage(ClientData.Play,C_NONE,C_ANSWER,To,text,ClientData.Play); | |
gtk_widget_destroy(dialog); | |
- if (Network) { | |
- SetSocketWriteTest(ClientData.Play,TRUE); | |
- } | |
} | |
void QuestionDialog(char *Data,Player *From) { | |
t@@ -1129,7 +1141,6 @@ void QuestionDialog(char *Data,Player *From) { | |
Responses=split[0]; LabelText=split[1]; | |
- if (Network) gdk_input_remove(ClientData.GdkInputTag); | |
dialog=gtk_window_new(GTK_WINDOW_DIALOG); | |
accel_group=gtk_accel_group_new(); | |
gtk_signal_connect(GTK_OBJECT(dialog),"delete_event", | |
t@@ -1346,6 +1357,8 @@ char GtkLoop(int *argc,char **argv[],char ReturnOnFail) { | |
window=ClientData.window=gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
gtk_window_set_title(GTK_WINDOW(window),_("dopewars")); | |
gtk_window_set_default_size(GTK_WINDOW(window),450,390); | |
+ gtk_signal_connect(GTK_OBJECT(window),"delete_event", | |
+ GTK_SIGNAL_FUNC(MainDelete),NULL); | |
gtk_signal_connect(GTK_OBJECT(window),"destroy", | |
GTK_SIGNAL_FUNC(DestroyGtk),NULL); | |