src/settings_gui.cpp
changeset 7954 57b51c69c072
parent 7931 b0a46cd92225
child 7991 d6a95a5593ba
equal deleted inserted replaced
7953:db4cd9ef0efc 7954:57b51c69c072
   509 			/* Don't allow clients to make any changes */
   509 			/* Don't allow clients to make any changes */
   510 			if  (_networking && !_network_server)
   510 			if  (_networking && !_network_server)
   511 				return;
   511 				return;
   512 
   512 
   513 			x = e->we.click.pt.x - 5;
   513 			x = e->we.click.pt.x - 5;
   514 			if (!IS_INT_INSIDE(x, 0, 21)) // Button area
   514 			if (!IsInsideMM(x, 0, 21)) // Button area
   515 				return;
   515 				return;
   516 
   516 
   517 			y = e->we.click.pt.y - GAMEDIFF_WND_TOP_OFFSET;
   517 			y = e->we.click.pt.y - GAMEDIFF_WND_TOP_OFFSET;
   518 			if (y < 0)
   518 			if (y < 0)
   519 				return;
   519 				return;
  1099 			StringID str = 0;
  1099 			StringID str = 0;
  1100 			CharSetFilter afilter = CS_ALPHANUMERAL;
  1100 			CharSetFilter afilter = CS_ALPHANUMERAL;
  1101 
  1101 
  1102 			switch (line) {
  1102 			switch (line) {
  1103 				case 0: // rate
  1103 				case 0: // rate
  1104 					if (IS_INT_INSIDE(x, 10, 30)) { // clicked buttons
  1104 					if (IsInsideMM(x, 10, 30)) { // clicked buttons
  1105 						if (x < 20) {
  1105 						if (x < 20) {
  1106 							if (_custom_currency.rate > 1) _custom_currency.rate--;
  1106 							if (_custom_currency.rate > 1) _custom_currency.rate--;
  1107 							WP(w,def_d).data_1 = 1 << (line * 2 + 0);
  1107 							WP(w,def_d).data_1 = 1 << (line * 2 + 0);
  1108 						} else {
  1108 						} else {
  1109 							if (_custom_currency.rate < 5000) _custom_currency.rate++;
  1109 							if (_custom_currency.rate < 5000) _custom_currency.rate++;
  1116 						afilter = CS_NUMERAL;
  1116 						afilter = CS_NUMERAL;
  1117 					}
  1117 					}
  1118 					break;
  1118 					break;
  1119 
  1119 
  1120 				case 1: // separator
  1120 				case 1: // separator
  1121 					if (IS_INT_INSIDE(x, 10, 30)) { // clicked button
  1121 					if (IsInsideMM(x, 10, 30)) { // clicked button
  1122 						WP(w,def_d).data_1 = 1 << (line * 2 + 1);
  1122 						WP(w,def_d).data_1 = 1 << (line * 2 + 1);
  1123 					}
  1123 					}
  1124 					str = BindCString(_str_separator);
  1124 					str = BindCString(_str_separator);
  1125 					len = 1;
  1125 					len = 1;
  1126 					break;
  1126 					break;
  1127 
  1127 
  1128 				case 2: // prefix
  1128 				case 2: // prefix
  1129 					if (IS_INT_INSIDE(x, 10, 30)) { // clicked button
  1129 					if (IsInsideMM(x, 10, 30)) { // clicked button
  1130 						WP(w,def_d).data_1 = 1 << (line * 2 + 1);
  1130 						WP(w,def_d).data_1 = 1 << (line * 2 + 1);
  1131 					}
  1131 					}
  1132 					str = BindCString(_custom_currency.prefix);
  1132 					str = BindCString(_custom_currency.prefix);
  1133 					len = 12;
  1133 					len = 12;
  1134 					break;
  1134 					break;
  1135 
  1135 
  1136 				case 3: // suffix
  1136 				case 3: // suffix
  1137 					if (IS_INT_INSIDE(x, 10, 30)) { // clicked button
  1137 					if (IsInsideMM(x, 10, 30)) { // clicked button
  1138 						WP(w,def_d).data_1 = 1 << (line * 2 + 1);
  1138 						WP(w,def_d).data_1 = 1 << (line * 2 + 1);
  1139 					}
  1139 					}
  1140 					str = BindCString(_custom_currency.suffix);
  1140 					str = BindCString(_custom_currency.suffix);
  1141 					len = 12;
  1141 					len = 12;
  1142 					break;
  1142 					break;
  1143 
  1143 
  1144 				case 4: // to euro
  1144 				case 4: // to euro
  1145 					if (IS_INT_INSIDE(x, 10, 30)) { // clicked buttons
  1145 					if (IsInsideMM(x, 10, 30)) { // clicked buttons
  1146 						if (x < 20) {
  1146 						if (x < 20) {
  1147 							_custom_currency.to_euro = (_custom_currency.to_euro <= 2000) ?
  1147 							_custom_currency.to_euro = (_custom_currency.to_euro <= 2000) ?
  1148 								CF_NOEURO : _custom_currency.to_euro - 1;
  1148 								CF_NOEURO : _custom_currency.to_euro - 1;
  1149 							WP(w,def_d).data_1 = 1 << (line * 2 + 0);
  1149 							WP(w,def_d).data_1 = 1 << (line * 2 + 0);
  1150 						} else {
  1150 						} else {