src/settings_gui.cpp
branchcpp_gui
changeset 6308 646711c5feaa
parent 6307 f40e88cff863
--- a/src/settings_gui.cpp	Sun Apr 15 17:04:44 2007 +0000
+++ b/src/settings_gui.cpp	Sat Apr 21 08:23:57 2007 +0000
@@ -115,7 +115,7 @@
 
 		w->DrawWidgets();
 		DrawString(20, 175, STR_OPTIONS_FULLSCREEN, 0); // fullscreen
-	}	break;
+	} break;
 
 	case WE_CLICK:
 		switch (e->we.click.widget) {
@@ -225,6 +225,7 @@
 
 /** Change the side of the road vehicles drive on (server only).
  * @param tile unused
+ * @param flags operation to perform
  * @param p1 the side of the road; 0 = left side and 1 = right side
  * @param p2 unused
  */
@@ -325,13 +326,6 @@
 	{  0,   2,  1, STR_6839_PERMISSIVE},
 };
 
-static inline bool GetBitAndShift(uint32 *b)
-{
-	uint32 x = *b;
-	*b >>= 1;
-	return HASBIT(x, 0);
-}
-
 /*
  * A: competitors
  * B: start time in months / 3
@@ -430,9 +424,9 @@
 
 		y = GAMEDIFF_WND_TOP_OFFSET;
 		for (i = 0; i != GAME_DIFFICULTY_NUM; i++) {
-			DrawFrameRect( 5, y,  5 + 8, y + 8, 3, GetBitAndShift(&click_a) ? FR_LOWERED : FR_NONE);
-			DrawFrameRect(15, y, 15 + 8, y + 8, 3, GetBitAndShift(&click_b) ? FR_LOWERED : FR_NONE);
-			if (GetBitAndShift(&disabled) || (_networking && !_network_server)) {
+			DrawFrameRect( 5, y,  5 + 8, y + 8, 3, HASBIT(click_a, i) ? FR_LOWERED : FR_NONE);
+			DrawFrameRect(15, y, 15 + 8, y + 8, 3, HASBIT(click_b, i) ? FR_LOWERED : FR_NONE);
+			if (HASBIT(disabled, i) || (_networking && !_network_server)) {
 				int color = (1 << PALETTE_MODIFIER_GREYOUT) | _colour_gradient[COLOUR_YELLOW][2];
 				GfxFillRect( 6, y + 1,  6 + 8, y + 8, color);
 				GfxFillRect(16, y + 1, 16 + 8, y + 8, color);
@@ -500,9 +494,11 @@
 
 			// save value in temporary variable
 			((int*)&_opt_mod_temp.diff)[btn] = val;
+			w->RaiseWidget(_opt_mod_temp.diff_level + 3);
 			SetDifficultyLevel(3, &_opt_mod_temp); // set difficulty level to custom
+			w->LowerWidget(_opt_mod_temp.diff_level + 3);
 			w->SetDirty();
-		}	break;
+		} break;
 		case 3: case 4: case 5: case 6: /* Easy / Medium / Hard / Custom */
 			// temporarily change difficulty level
 			w->RaiseWidget(_opt_mod_temp.diff_level + 3);
@@ -639,6 +635,7 @@
 	"allow_shares",
 	"town_growth_rate",
 	"larger_towns",
+	"initial_city_size",
 };
 
 static const char *_patches_ai[] = {